1、高版本mysqldump导出低版本mysql数据库
报错信息: mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'discuz' AND TABLE_NAME = 'common_admincp_cmenu';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
这种错误一般是出现在导出远程MySQL数据库服务器的数据的时候 因为新版本mysql启用了一个新特性,关闭即可导出 解决方法1: 用 --column-statistics=0 选项来关闭 mysqldump --column-statistics=0 -uroot -p --all-databases > mysql.sql 解决方法2: 用对应版本的mysqldump来导出,如果本地不方便安装的情况: Windows 电脑:下载对应mysql版本的windows包来直接运行 Linux 电脑:下载对应版本的mysql的rpm包,包名就是mysql-版本号.rpm 用7Z解压或者用 rpm2cpio xxx.rpm | cpio -div 命令解压,然后找到mysqldump文件直接执行 ./mysqldump -uroot -p --all-databases > mysql.sql
2、GTID警告错误
警告信息: Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases--triggers --routines --events. 解决方法: 加入 --set-gtid-purged=OFF 选项 如果需要完整导出用 --all-databases--triggers --routines --events 选项
关于GTID的参考链接
https://www.cnblogs.com/ywxbbbbb/p/9778241.html