mysql dump schema,mysqldump:无法执行。 information_schema中的未知表'column_statistics'

本文介绍了一种在使用mysqldump导出数据库时遇到的未知table 'column_statistics' 错误,并提供了解决方案。通过禁用默认启用的column-statistics标志,可以避免在导出过程中出现此问题。

I want to dump my database, even after following correct syntax it thows me following error.

Syntax I used :

mysqldump -uroot -p omnichannel_store_india > omnichannel_store_india.sql

Throws errors :

mysqldump: Couldn't execute

'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'omnichannel_store_india' AND TABLE_NAME = 'consignment_items';':

Unknown table 'column_statistics' in information_schema (1109)

解决方案

This is due to a flag "column-statistics" 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= --user --password

To disable column statistics by default, you can add following in a MySQL config file, such as /etc/my.cnf or ~/.my.cnf.

[mysqldump]

column-statistics=0

It's brilliantly work for me.

More details about "column-statistics"

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.

Ref ( mysql official documentaion link )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值