Home >Database >Mysql Tutorial >CentOS 6.9 upgrades MySQL 5.6.36 to 5.7.18
CentOS 6.9 UpgradeMySQL 5.6.36 to5.7.18
MySQL 5.6.36 Installation process:
The upgrade method is very simple
1, Safely close the database
[root@001 ~]# service mysqld stop
2, upload mysql5.7.18 to the server and extract it to /usr/local
[root@001 ~]# tar zxf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /usr/local/
3, cancel the soft connection of 5.6, and establish 5.7 New link
[root@001 ~]# cd /usr/local/
[root@001 local]# unlink mysql
[root@001 local]# ln -sv mysql-5.7.18-linux-glibc2.5-x86_64/ mysql
[root@001 local]# cp -rf /data/mysqldata/mysql mysql_old #Back up here first to prevent the later stage If you want to roll back the version, just replace the backup mysql_old with mysql, and then follow the steps below
[root@001 local]# service mysqld start
Starting MySQL........................................ ....SUCCESS!
4. The above steps have actually been successfully upgraded and can be started successfully, but they can only guarantee that the data files will be compatible. You need to use mysql_upgrade to upgrade the files of 5.6 to 5.7
[root@001 local]# mysql_upgrade -uroot -p
#The parameter -s must be added, which means that only the system table will be updated. If -s is not added, the tables of all libraries will be rebuilt in the 5.7.9 method. Never do this online
#Because the database binary files are compatible, there is no need to upgrade
#When is -s not needed? When some older versions of the storage format require new features ,
# To improve performance, do not add -s
# Even if you upgrade through slave, it is recommended to use this method to upgrade, which is faster
[root@001 local]# mysql -V #Viewmysqlversion
update successed! ! !
The above is the detailed content of CentOS 6.9 upgrades MySQL 5.6.36 to 5.7.18. For more information, please follow other related articles on the PHP Chinese website!