mysql 导入innodb,mysql5.6在导入时报innodb_table_stats不存在

今天在处理问题时遇到这个报错

InnoDB: Error: Fetch of persistent statistics requested for table "mytest"."pomstd" but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats insttestd.

InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

InnoDB: Recalculation of persistent statistics requested for table "mytest"."pomstd" but the required persistent statistics storage is not present or is corrupted. Using transient stats insttestd.

检查目录,没有找到这个文件

这是mysql5.6新增的性能分析文件,通常处理办法就是创建此文件:

CREATE TABLE `innodb_table_stats` (

`database_name` varchar(64) COLLATE utf8_bin NOT NULL,

`table_name` varchar(64) COLLATE utf8_bin NOT NULL,

`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

`n_rows` bigint(20) unsigned NOT NULL,

`clustered_index_size` bigint(20) unsigned NOT NULL,

`sum_of_other_index_sizes` bigint(20) unsigned NOT NULL,

PRIMARY KEY (`database_name`,`table_name`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;

CREATE TABLE `innodb_index_stats` (

`database_name` varchar(64) COLLATE utf8_bin NOT NULL,

`table_name` varchar(64) COLLATE utf8_bin NOT NULL,

`index_name` varchar(64) COLLATE utf8_bin NOT NULL,

`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

`stat_name` varchar(64) COLLATE utf8_bin NOT NULL,

`stat_value` bigint(20) unsigned NOT NULL,

`sample_size` bigint(20) unsigned DEFAULT NULL,

`stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,

PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值