Unknown table ‘column_statistics‘ in information_schema (1109)

问题描述

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, SON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')  FROM information_schema.COLUMN_STATISTICS      WHERE SCHEMA_NAME = 'student' AND TABLE_NAME = 'history';': Unknown table 'column_statistics' in information_schema (1109)

 问题分析

因为新版的mysqldump默认启用了一个新标志,通过- -column-statistics=0来禁用它

解决办法

mysqldump的时候加上参数:--column-statistics=0

解决方法:

导出数据库:

mysqldump --column-statistics=0 -uroot -proot mydatabase2 > f:/mydb.sql

导出多个表:

mysqldump --column-statistics=0 -uroot -proot mydatabase2 my_student my_int >f:/my_student_int.sql

你可能感兴趣的:(java实战知识,数据库,sql,mysql)