mysql从5.5直接升级到5.7 mysqlpump备份出现1577错误

mysql官网不支持夸大版本升级,比如跳过5.6直接升级到5.7,但由于一些客观原因,项目需要从5.5直接升级到5.7,以下是具体操作

1、备份之前mysql,(数据量少,可直接拷贝安装目录及data目录和配置文件,本例使用的为Percona XtraBackup工具进行的备份)

2、将data目录移出mysql5.5安装目录

3、解压mysql5.7版本

4、修改5.7需要配置文件my.cnf,添加datadir,指向5.5数据目录

5、初始化,该步骤可选,(新安装数据库,或者数据目录不存在,可执行如下命令初始化数据目录,本例中不需要执行如下操作)

bin/mysqld --initialize --user=mysql

6、执行ssl相关操作

bin/mysql_ssl_rsa_setup

7、启动mysql

8、此时数据目录还是5.5的,需要执行mysql_upgrade进行升级,使用方法与mysql命令登录命令行一样,mysql会自动检测当前表并自动修复

mysql_upgrade -uroot -p

9、修复完成后,若发现mysql启动有server-key.pem相关的ssl错误,则是server-key.pem文件权限问题

chmod 644 server-key.pem

10、但此时若执行mysqlpum备份数据,可能会出现异常

mysqlpump --user=root --password mytest > mytest.sql

错误信息:

mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.
mysqlpump: [ERROR] (1577) Cannot proceed because system tables used by Event Scheduler were found damaged at server start
Dump process encountered error and will not continue.

解决方法:重启mysql服务 (本例中是这样解决的问题)

重新执行mysqlpump

Dump progress: 1/28 tables, 0/353 rows
Dump progress: 36/343 tables, 0/19746 rows
Dump progress: 180/343 tables, 6151/19746 rows
Dump completed in 3675 milliseconds

数据被正确备份下来,且备份速度很快,从备份文件可以看到,内容与mysqldump备份有很多不同

本次只是简单尝试mysqlpump,待后续再对mysqlpump做深入了解

猜你喜欢

转载自www.cnblogs.com/qq931399960/p/10243758.html
今日推荐