In the process of deploying MySQL is generally used in the binary package, so when upgrading the MySQL version of the latest MySQL package is also extracted to basedir, of course, if there is no data in MySQL directly removed reinstall can also, in the update need to stop the MySQL service , note that if the production environment needs to do the corresponding standby switch in the upgrade, the next upgrade only normal version of the iteration, and can not boast version updates, such as 5.1 upgrade to 5.7 is not feasible, the normal should be 5.6 upgrade to 5.7, the following is a simple word on how to use the Mysql_ under the binary package Upgrade to make a version upgrade:
#在关闭MySQL的进程后开始升级 [[email protected] ~]# cd /usr/ local/[[email protected] local]# rm -rf mysql[[email protected] local]# tar -jxvf /usr/local/src/mysql-5.7.17-linux-glibc2.5-x86_64.tar.bz2 -c ./[[email protected] local]# mv mysql-5.7.17-linux-glibc2.5-x86_64 mysql[[email protected ] local]# cat /etc/ld.so.conf.d/mysql.conf# Check if the Lib path is right/usr/local/mysql/lib[[email protected] local]# ldconfig -v# Reload the latest package into the system, note that some software that relies on MySQL may need to be recompiled [[email protected] local]# /etc/init.d/mysqld start# try to start, note that in mysql 5.7 some variable parameters are canceled, preferably in another installed mysql 5.7 The server on the query my.cnf in the existence of the variable, if there is no description in the new version has been canceled this parameter needs to be deleted until started [[email protected] local]# /usr/local/ mysql/bin/mysql_upgrade -u root -p# upgrade with Mysql_upgrade update
In support Mysql_upgrade, the old version of the data will be checked and modified to confirm that the upgrade will be successful after the upgrade, after the upgrade is completed under Databasedir will generate Mysql_upgrade_info record the latest MySQL version, start MySQL, upgrade completed
MySQL binary package upgraded with Mysql_upgrade version update MySQL 5.7