MySQL Binary Package update MySQL 5.7 With mysql_upgrade
MySQL is usually deployed using binary packages. Therefore, when you upgrade MySQL, You can decompress the latest MySQL package to basedir, of course, if MySQL does not have any data, you can delete it and reinstall it. During the update, you must stop the MySQL service, note: In the production environment, you need to perform a proper backup switch before upgrading. In the next upgrade, you can only perform normal version iterations, but not verbose version updates, for example, upgrading from 5.1 to 5.7 is not feasible. Normally, the upgrade from 5.6 to 5.7 is normal. The following describes how to use mysql_upgrade in a binary package for Version Upgrade:
# Start upgrading after the MySQL process is disabled
[Root @ localhost ~] # Cd/usr/local/
[Root @ localhost local] # rm-rf mysql
[Root @ localhost local] # tar-jxvf/usr/local/src/mysql-5.7.17-linux-glibc2.5-x86_64.tar.bz2-C ./
[Root @ localhost local] # Music mysql-5.7.17-linux-glibc2.5-x86_64 mysql
[Root @ localhost local] # cat/etc/ld. so. conf. d/mysql. conf # Check whether the lib path is correct.
/Usr/local/mysql/lib
[Root @ localhost local] # ldconfig-v # reload the latest package to the system. Note that some MySQL-dependent software may need to be recompiled.
[Root @ localhost local] #/etc/init. d/mysqld start # Try to start. Note that some variable parameters in MySQL 5.7 are canceled. It is best to query my on another installed MySQL 5.7 server. whether the variable in cnf exists. If it does not exist, the parameter has been canceled in the new version until it is started.
[Root @ localhost local] #/usr/local/mysql/bin/mysql_upgrade-u root-p # update and upgrade using mysql_upgrade
In support of mysql_upgrade, the old version of data will be checked and modified. After the upgrade is confirmed, the new version of MySQL will be generated under databasedir after the upgrade is complete, start MySQL, upgrade complete