1. Create MySQL user and MySQL user group
Groupadd MySQL
Useradd-r-G MySQL MySQL
2. Download the mysql-5.7.17 package to my shared network disk
Link: http://pan.baidu.com/s/1gfAA87p Password: Iuti
3, copy the downloaded installation package to the Linux system, can be via SFTP or shared network disk
TAR-ZXVF mysql-5.7.17-linux-glibc2.5-x86_64
CP Mysql-5.7.17-linux-glibc2.5-x86_64/opt/mysql
4. Create the Data directory
Mkdir/opt/mysql/data
5. Install the database
Switch to the/opt/mysql directory
Cd/opt/mysql
Modify the owner of the current directory to be a MySQL user
Chown-r Mysql:mysql./
Installing the Database
Bin/mysqld--initialize--user=mysql--basedir=/opt/mysql--datadir=/opt/mysql/data
If you are prompted for missing libaio.so installation Libaio, then perform the above installation command
Yum-y Install libai*
The installation succeeds with the following prompt, where NZ*TJVCD?6NC is the password
2017-05-09t03:38:34.197041z 1 [Note] A temporary password is generated for [email protected]: NZ*TJVCD?6NC
6. Execute the following command to create the RSA private key
Bin/mysql_ssl_rsa_setup--datadir=/usr/local/mysql/data
7. Modify the current user owner as Root
Chown-r Root:root./
Modify the current data directory owner for MySQL
Chown-r Mysql:mysql./data
8, modify the MY.CNF and boot start
CD Support-filessudo
CP My-default.cnf/etc/my.cnfsudo
CP Mysql.server/etc/init.d/mysqlsudo
Vim/etc/init.d/mysql
# #修改basedir = installation directory
# #修改datadir = installation directory
9, modify the MY.CNF
Vim/etc/my.cnf
[Mysqld]
Character-set-server=utf8
Datadir=/opt/mysql/data
Basedir=/opt/mysql
Socket=/var/lib/mysql/mysql.sock
[Client]
Socket=/var/lib/mysql/mysql.sock
Create a Directory
Mkdir-p/var/lib/mysql/
Chown-r Mysql:mysql/var/lib/mysql
Start MySQL
Service MySQL Start
MySQL installation detailed process, tar mode