html tool

2019年9月1日星期日

mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'databases' AND TABLE_NAME = 'xxxx';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109) /*!40000 ALTER TABLE `xxxx` ENABLE KEYS */; UNLOCK TABLES;



错误提示:

mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'databases' AND TABLE_NAME = 'xxxx';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
/*!40000 ALTER TABLE `xxxx` ENABLE KEYS */;
UNLOCK TABLES;

环境:
client:
mysqldump  Ver 8.0.17 for Linux on x86_64 (MySQL Community Server - GPL)

server:
Server version: 5.5.5-10.2.10-MariaDB-log MariaDB Server

解答:

This is due to a new flag that is enabled by default in mysqldump 8. 
You can disable it by adding --column-statistics=0. The command will be something like:
mysqldump --column-statistics=0 --host=<server> --user=<user> --password=<password> 
[popexizhi:
这是因为新版的mysqldump默认启用了一个新标志,通过--column-statistics=0来禁用他。官方文档的解释
Add ANALYZE TABLE statements to the output to generate histogram statistics for dumped tables when the dump file is reloaded. This option is disabled by default because histogram generation for large tables can take a long time.
]
Check this link for more information. To disable column statistics by default, you can add
[mysqldump]
column-statistics=0
to a MySQL config file, such as /etc/my.cnf or ~/.my.cnf.

没有评论:

发表评论