1. View existing MySQL
Rpm-qa | grep MySQL
2. Uninstall
#yum-y-Remove mysql-libs-5.1.66-2.el6_3.x86_64
Check and delete the old version of MySQL development header files and libraries
command: #Rm-fr/usr/lib/mysql
#rm-fr/usr/include/mysql
Note: the data and /etc/my.cnf in/var/lib/mysql after uninstallation are not deleted, if determined, then manually deleted
#rm-F/ETC/MY.CNF
#rm-fr/var/lib/mysql
#rm-fr/usr/share/mysql
3. Install dependent packages
#yum-y install make gcc-c++ cmake bison-devel ncurses-devel Libaio libaio-devel
4.5.7.13 RPM installation package download
: Http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar
5. Decompression
#tar XVF Mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar
6. Installation
#rpm-IVH mysql-community-common-5.7.13-1.el6.x86_64.rpm
#rpm-IVH mysql-community-libs-5.7.13-1.el6.x86_64.rpm
#rpm-IVH mysql-community-client-5.7.13-1.el6.x86_64.rpm
#rpm-IVH mysql-community-server-5.7.13-1.el6.x86_64.rpm
7. Initialization
in order to ensure that the database directory is the owner of the file with the MySQL login user, if you are running the MySQL service as root, you need to perform the following command initialization
#mysqld--initialize--user=mysql
In addition , the--initialize option is initialized in "safe" mode by default, it generates a password for the root user and marks the password as expired, you need to set a new password after logging in, and use --initialize-insecure command does not use Safe mode, it does not Root The user generates a password, which is shown here using the --initialize initialized, which generates a root account password, the password in the log file.
#vim/var/log/mysqld.log
8. Start MySQL
#service mysqld Start
#mysql-U root-p
Password for the password generated at the end of step 7
9. log in to MySQL and change the root password
Msql>alter user ' root ' @ ' localhost ' identified by ' rootroot ';
Mysql>use MySQL;
Msyql>update user set user. host= '% ' where user. user= ' root ';
Mysql>flush privileges;
Mysql>quit
10. Re-login to MySQL
CentOS under RPM installation mysql5.7.13