Since this installation is a big loop for MySQL, keep in mind that this article helps friends who are still on the road.
If you have previously installed, but did not install the success, then you need to first delete all the relevant files
, delete the section to go to Baidu or Google query, here no longer narrate
First of all, the MySQL version I used is mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
First step: Add a MySQL group, operation instructions Groupadd MySQL
Step Two: Add a user, operation instructions Useradd-r-G MySQL MySQL
The third step: Unzip the downloaded package, operation instructions tar-xzvf/usr/local/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz (note: My files are placed in the/usr/local folder)
The extracted folders include
Since I've done the work before, here's just a query
Fourth Step: Rename the name of the folder you just unzipped, operation instructions Mv/usr/local/mysql-5.7.13-linux-glibc2.5-x86_64/usr/local/mysql
Fifth step: Create a folder, one will be used to store data, operation instructions Mkdir/usr/local/mysql/data
Sixth step: Enter the MySQL package, give this package to MySQL, operation instructions Chown-r Mysql:mysql.
Seventh Step: Start the initialization of MySQL, this time please note, because now officially no longer recommend mysql_install_db initialization mode, so we use this method, operation instructions Bin/mysqld--initialize--user=mysql-- Basedir=/usr/local/mysql--datadir=/usr/local/mysql/data This step is complete, if you see it, it means the initialization was successful.
Note that a temporary password was generated at this point, above: yli>7ecpe; YP (need to be used in a moment, please save it)
Eighth step: Set data storage directory, operation instruction Bin/mysql_ssl_rsa_setup--datadir=/usr/local/mysql/data
Nineth step: At this point we go to MySQL under the MySQL folder Support-files, operation instructions CD Support-files
Tenth step: Copy file to Global environment, operation instruction CP Mysql.server/etc/init.d/mysql
11th Step: Modify basedir= own MySQL installation directory modify datadir= own data directory, operation instructions Vim/etc/init.d/mysql
12th step: Start MySQL, operation instructions Bin/mysqld_safe--user=mysql
If it starts up properly, you'll start logging in
13th step: Start logging in, MySQL in the bin directory, operation instructions./mysql-uroot-p
14th Step: Enter the temporary password that you just saved
At this point MySQL only local localhost can access
At this point MySQL only local localhost can access
15th Step: Modify the remote access, operation as
16th Step: Restart the MySQL service
If you encounter the problem of can ' t connect to local MySQL server through socket ' (2) in the above operation, then please check your/etc/my.cnf inside have your own configuration file
Finish!
Linux Server Installation MySQL5.7.19 steps