MySQL本地大版本升级(5.6.40到5.7.19)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL本地大版本升级(5.6.40到5.7.19)相关的知识,希望对你有一定的参考价值。
本次测试mysql 5.6.40升级至MySQL 5.7.19过程,采用本地升级的方法。
1、安装MySQL5.7.19,并关闭MySQL5.7.19的服务
[root@mysql5 mysql]# /usr/local/mysql5.7/bin/mysqladmin -h127.0.0.1 -uroot -p shutdown
2、关闭MySQL 5.6.40服务
[root@mysql5 mysql]# /usr/local/mysql5.6/bin/mysqladmin -h127.0.0.1 -uroot -p shutdown
3、复制MySQL 5.6.40的data目录至MySQL 5.7的data
[root@mysql5 mysql]# cp -rp /data/mysql5.6/data /data/mysql5.7/data
4、启动MySQL 5.7.19服务
[root@mysql5 mysql]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
[root@mysql5 mysql]# ps -elf | grep -v grep | grep mysql
root 26407 7822 0 10:18 pts/4 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf
mysql 26930 26407 4 10:18 pts/4 00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/data/mysql-err.log --open-files-limit=65535 --pid-file=/data/mysql/data/mysql.pid --socket=/tmp/mysqld.sock --port=3306
5、运行mysql_upgrade
[root@mysql5 mysql]# /usr/local/mysql/bin/mysql_upgrade -uroot -p --defaults-file=/etc/my.cnf
Enter password:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
mysql.db OK
mysql.engine_cost OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Upgrading the sys schema.
Checking databases.
sys.sys_config OK
Upgrade process completed successfully.
Checking if update is needed.
6、登录MySQL并核查数据
[root@mysql5 mysql]# /usr/local/mysql5.7/bin/mysql -h127.0.0.1 -uroot -p
以上是关于MySQL本地大版本升级(5.6.40到5.7.19)的主要内容,如果未能解决你的问题,请参考以下文章