首页 > 其他分享 >Unknown table 'COLUMN_STATISTICS' in information_schema

Unknown table 'COLUMN_STATISTICS' in information_schema

时间:2023-02-03 14:36:09浏览次数:49  
标签:information STATISTICS COLUMN column -- statistics mysqldump 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

标签:information,STATISTICS,COLUMN,column,--,statistics,mysqldump,schema
From: https://blog.51cto.com/u_13236892/6035819

相关文章