mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'ndbinfo_version'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)


centos7.5 导出整个数据库报错

问题:

[root@db01 ~]# mysqldump -uroot -pBgx123.com --all-databases --single-transaction --master-data=1 --flush-logs >/root/db_$(date +%F)_all.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'gtid\_mode'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)

原因:

需要升级mysql

解决方法:

[root@db01 ~]# mysql_upgrade -u root -pBgx123.com --force	#升级mysql
[root@db01 ~]# systemctl restart mysqld		#注意需要重启mysqld
[root@db01 ~]# mysqldump -uroot -pBgx123.com --all-databases --single-transaction --master-data=1 --set-gtid-purged=OFF --flush-logs >/root/db_$(date +%F)_all.sql	#成功
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@db01 ~]# ll
-rw-r--r--  1 root root 529693 Mar  6 19:51 db_2019-03-06_all.sql


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM