mysqldump Error: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)
- By : Mydatahack
- Category : DBA, Infrastructure
- Tags: DBA, MySQL, Troubleshoot
mysqldump 8 enabled a new flag called columm-statistics by default. When you have MySQL client above 8 and try to run mysqldump on older MySQL versions, you will get the error below.
mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM '$"number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'myschema' AND TABLE_NAME = 'craue_config_setting';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
The solution is simple. We can either run mysqldump with –column-statistics=0 as below.
mysqldump --column-statistics=0 ...
We can also disable this globally by adding mysqldump config in my.cnf file.
[mysqldump] column-statistics=0
With Mac, my.cnf is in /usr/local/etc. You can check the version of your mysqldume with mysqldump –version.