Install Mysql5.7.19 and centos7mysql5.7.19 on centos 7
1. decompress the file
[Root @ centos3 ~] # Tar-zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz-C/usr/local/
2. Rename
[Root @ centos3 ~] # Cd/usr/local/
[Root @ centos3 local] # Music mysql-5.7.19-linux-glibc2.12-x86_64/mysql
3. Configure Environment Variables
[Root @ centos3 local] # vi +/etc/profile
[Root @ centos3 local] # source/etc/profile
4. Create and authorize a group and user
[Root @ centos3 local] # groupadd mysql
[Root @ centos3 local] # useradd-r-g mysql-s/bin/false mysql
[Root @ centos3 local] # chown-R mysql/
[Root @ centos3 local] # chgrp-R mysql/
5. initialize and remember the last 12-bit password
[Root @ centos3 local] #/usr/local/mysql/bin/mysqld -- initialize -- user = mysql -- basedir =/usr/local/mysql/-- datadir =/usr/local /mysql/data/-- lc_messages_dir =/usr/local/mysql/share -- lc_messages = zh_CN
6. Modify the mysql. server. File and copy it to the/etc/init. d/directory.
[Root @ centos3 local] # cd/usr/local/mysql/support-files/
[Root @ centos3 support-files] # vi mysql. server
[Root @ centos3 support-files] # cp mysql. server/etc/init. d/mysqld
7. Rename my. cnf
[Root @ centos3 support-files] # mv/etc/my. cnf/etc/my_default.cnf
8. Set startup
[Root @ centos3 support-files] # chmod + x/etc/init. d/mysqld
[Root @ centos3 support-files] # chkconfig -- add mysqld
[Root @ centos3 support-files] # chkconfig mysqld on
// Check whether startup is successful
[Root @ centos3 support-files] # chkconfig -- list mysqld
9. Start the service
[Root @ centos3 support-files] #/etc/init. d/mysqld start
[Root @ centos3 support-files] # service mysql start
10. log on to and change the password. The password is generated by the system in step 1.
[Root @ centos3 support-files] # mysql-uroot-p
Mysql> set password = password ("1234 ");