在使用mysqldump导出数据表结构和数据时遇到问题:
执行:
mysqldump -uxxx -pxxx -h10.202.254.219 -P3306 northwind_demo2 categories city customers employees order_details orders products province shippers suppliers > northwind.sql
报错:
Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'northwind_demo2' AND TABLE_NAME = 'categories';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
(base) yy@jingyudeMacBook-Pro Documents % mysqldump --column-statistics=0
解决:增加参数–column-statistics=0
mysqldump --column-statistics=0 -uxxx -pxxxx -h10.202.254.219 -P3306 --databases northwind_demo2 --tables categories city customers employees order_details orders products province shippers suppliers > northwind111.sql