Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install binary MySQL and crack MySQL password in Linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how Linux installs binary MySQL and how to crack MySQL passwords. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Ensure that there is dependent libaio software in the system, if not:

Yum-y install libaio

two。 Extract the binary MySQL software package

Tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz-C / usr/local

3. Enter / usr/local

Cd / usr/local

4. Change the name of the package or create a soft connection

Mv mysql-5.7.24-linux-glibc2.12-x86_64/ mysql ln-s mysql-5.7.24-linux-glibc2.12-x86_64/ mysql

5. Add mysql users and groups

Useradd-M-s / sbin/nologin mysql

6. Modify the current directory owner to the newly created mysql user

Chown-R mysql:mysql / usr/local/mysql

7. Initialize the mysql database (establish default libraries and tables)

/ usr/local/mysql/bin/mysqld-user=mysql-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data-initialize

After initializing the database, a password will be generated at the end. Remember this password and use it to enter the database.

8. Modify / etc/my.cnf file

Vim / etc/my.cnf [mysqld] datadir=/usr/local/mysql/data socket=/tmp/mysql.sock [mysqld_safe] log-error=/usr/local/mysql/data/mysql.log pid-file=/usr/local/mysql/data/mysql.pid

9. Add a mysql service to a system service

Cp mysql/support-files/mysql.server / etc/init.d/mysqld chown + x / etc/init.d/mysqld chkconfig-- add mysqld

10. Turn on mysql

Systemctl start mysqld

Check whether the service is enabled: netstat-lnpt | grep 3306

11. Create a soft link:

Ln-s / usr/local/mysql/bin/* / bin/

twelve。 Access the mysql database:

Mysql-uroot-p 'initialize the generated password'

Exit exits the database

13. Modify mysql password

Mysqladmin-uroot-p 'initialize the generated password' password 'the password you want to change'

=

If you forget your mysql password:

1. Stop running mysql first:

Systemctl stop mysqld

two。 Ensure that there are no mysql-related processes:

Ps aux | grep mysqld

3. Skip the authorization table to start the service:

Mysqld_safe-- skip-grant-tables & (put it in the background to run)

Mysql directly enters the mysql database

Mysql > show databases +-- + | Database | +-+ | information_schema | | mysql | | performance_schema | | sys | +-- -+ 4 rows in set (0.01sec) mysql > use mysqlmysql > show tables Mysql > desc user;mysql > select user,authentication_string (save password) from user;mysql > update (update) user set authentication_string=PASSWORD ('password you want to set') where user='root';mysql > flush privileges; (refresh authorization table) mysql > exit

Kill the process first after exiting

Ps aux | grep mysqld

Kill-9 process number

Then start the service: systemctl start mysqld

Thank you for reading! On "Linux how to install binary MySQL and crack MySQL password" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report