1. Make sure the system has the required libaio software. If not: 2. Unpack the binary MySQL package 3. Enter /usr/local 4. Change the name of the software package or create a soft link 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 user and group 6. Change the current directory owner to the newly created mysql user chown -R mysql:mysql /usr/local/mysql 7. Initialize the MySQL database (create 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 mysql service to system services cp mysql/support-files/mysql.server /etc/init.d/mysqld chown +x /etc/init.d/mysqld chkconfig --add mysqld 10. Open mysql Check whether the service is enabled: 11. Create a soft link: 12. Enter the mysql database: exit Exit the database 13.Change mysql password; mysqladmin -uroot -p 'Initial generated password' password 'The password you want to change' ============================================================================== If you forget your mysql password: 1. Stop mysql first: 2. Make sure there are no processes related to mysql: 3. Skip the authorization table to start the service: mysql directly enter the mysql database mysql>show databases; +-----------------------------+ | Database | +-----------------------------+ | information_schema | |mysql | | performance_schema | |sys| +-------------------------------+ 4 rows in set (0.01 sec) mysql> use mysql mysql> show tables; mysql> desc user; mysql> select user,authentication_string (to save password) from user; mysql>update user set authentication_string=PASSWORD('the password you want to set') where user='root'; mysql>flush privileges; (refresh authorization table) mysql>exit Kill the process after exiting kill -9 process number Then start the service: Summarize The above is the method of installing binary MySQL on Linux and cracking MySQL password introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time! You may also be interested in:
|
<<: MySQL data migration using MySQLdump command
>>: Deleting the database and running away? How to use xtraback to back up the MySQL database
In the process of making web pages, it is inevita...
Use "onInput(event)" to detect whether ...
Table of contents 1. Basic theory 1.1 Transaction...
Section Course content Hours 1 Web Design Overvie...
Preface How to write efficient SQL statements is ...
The default firewall of CentOS7 is not iptables, ...
The first cutter in China github.com/chokcoco Fir...
This article example shares the specific code of ...
Preface I have been summarizing my front-end know...
Today, I will record how to install MySQL 8.0.18 ...
wangEditor is a web rich text editor developed ba...
A registration page template implemented with HTM...
1. Refine the selector By using combinators, the ...
1. Leading fuzzy query cannot use index (like ...
Install MySQL 8.0 docker run -p 63306:3306 -e MYS...