文章内容

2021/11/6 16:03:44,作 者: 黄兵

mysqldump: Couldn't execute 'SELECT COLUMN_NAME,

最近在使用 mysqldump 做数据迁移的时候出现了如下错误:

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.

mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'IdentityServer' AND TABLE_NAME = 'ApiClaims';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

出现问题的原因:

这是由于 column-statistics 在 mysqldump 8 中默认启用了一个标志。您可以通过添加 --column-statistics=0.

解决方案:

加上,示例如下:

mysqldump --column-statistics=0 -h mysql_host -P 3306 -uroot -p databases_name > /home/ubuntu/databases_name.sql

问题解决。


参考资料:

1、mysqldump: Couldn't execute. Unknown table 'column_statistics' in information_schema


黄兵个人博客原创。

转载请注明出处:黄兵个人博客 - mysqldump: Couldn't execute 'SELECT COLUMN_NAME,

分享到:

发表评论

评论列表