0
点赞
收藏
分享

微信扫一扫

Unknown table 'COLUMN_STATISTICS' in information_schema

问题:
备份数据库的时候报错:
mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM,
'$."number-of-buckets-specified"') FROM
information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'db' AND
TABLE_NAME = 'Abcdefg';':
Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
结果是一个不完整的转储。

答案
这是因为mysqldump 8中默认启用了一个新标志,可以通过添加--column-statistics=0来禁用它,命令类似于:
mysqldump --column-statistics=0 --host=<server> --user=<user> --password=<password>

若要在默认情况下禁用列统计信息,可以添加
[mysqldump]
column-statistics=0
到MySQL配置文件,如/etc/my.cnf或~/.my.cnf

举报

相关推荐

0 条评论