您现在的位置是:网站首页>列表内容
optimize table出错解决方法_RedHat/Centos_操作系统_
2024-03-06 14:23:11
94人已围观
简介 optimize table出错解决方法_RedHat/Centos_操作系统_
一个某某库大概360W,为了提高查询效率,做点优化,使用optimize table table.name;出现Table does not support optimize, doing recreate + analyze instead
果断谷歌,查到一段E文。。。
Everytime you do optimize MySQL, by using mysqlcheck -A -o or using ./mysql_optimize from here.
You may see the output
Table does not support optimize, doing recreate + analyze instead.
It is because the table that you are using is InnoDB.
You can optimize the InnoDB tables by using this.
ALTER TABLE table.name ENGINE='InnoDB';
This will create a copy of the original table, and drop the original table, and replace to the original place.
Although this is safe, but I suggest you do backup and test first before doing this.
原来如此,大致意思是说innodb的数据库不支持optimize,可以用
ALTER TABLE table.name ENGINE='InnoDB';
该方法会对旧表以复制的方式新建一个新表,然后删除旧表。虽然这个过程是安全的,但是在进行操作时还是先进行备份为好
还有一种方式:
You can make OPTIMIZE TABLE work on other storage engines by starting mysqld with the --skip-new or --safe-mode option. In this case, OPTIMIZE TABLE is just mapped toALTER TABLE.
上面是说要求我们在启动的时候指定--skip-new或者--safe-mode选项来支持optimize功能
果断谷歌,查到一段E文。。。
Everytime you do optimize MySQL, by using mysqlcheck -A -o or using ./mysql_optimize from here.
You may see the output
Table does not support optimize, doing recreate + analyze instead.
It is because the table that you are using is InnoDB.
You can optimize the InnoDB tables by using this.
复制代码
代码如下:ALTER TABLE table.name ENGINE='InnoDB';
This will create a copy of the original table, and drop the original table, and replace to the original place.
Although this is safe, but I suggest you do backup and test first before doing this.
原来如此,大致意思是说innodb的数据库不支持optimize,可以用
ALTER TABLE table.name ENGINE='InnoDB';
该方法会对旧表以复制的方式新建一个新表,然后删除旧表。虽然这个过程是安全的,但是在进行操作时还是先进行备份为好
还有一种方式:
You can make OPTIMIZE TABLE work on other storage engines by starting mysqld with the --skip-new or --safe-mode option. In this case, OPTIMIZE TABLE is just mapped toALTER TABLE.
上面是说要求我们在启动的时候指定--skip-new或者--safe-mode选项来支持optimize功能
点击排行
![](http://img.jbzj.com/file_images/game/201409/2014092915245038.jpg)
- dnf低级转移晶石怎么兑换高级的 转移晶石兑换地点介绍_网络游戏_游戏攻略_
- CF英雄刀风之啸狼英雄级武器 9月英雄级武器英雄刀风之啸狼介绍_网络游戏_游戏攻略_
- dnf七彩转移晶石怎么得 作用介绍_网络游戏_游戏攻略_
- 魔兽宠物6.0熔火幼犬/霜狼幼崽/霜狼幽灵幼崽 感觉萌萌哒_网络游戏_游戏攻略_
- WCA2014穿越火线项目赛程与赛制资料预览_网络游戏_游戏攻略_
- 激战2国服9月12日新版本游侠长弓大剑流玩法介绍说明_网络游戏_游戏攻略_
- 逆战56式GP步枪属性介绍 9.2更新新武器56式GP步枪一览_网络游戏_游戏攻略_
- 逆战9月我是幸运星活动网址介绍_逆战9月我是幸运星奖励一览_网络游戏_游戏攻略_
- 逆战AKM月劵步枪怎么样 AKM月劵步枪属性视频分析_网络游戏_游戏攻略_
本栏推荐
![](http://img.jbzj.com/file_images/game/201409/2014092915245038.jpg)
-
dnf低级转移晶石怎么兑换高级的 转移晶石兑换地点介绍_网络游戏_游戏攻略_
-
CF英雄刀风之啸狼英雄级武器 9月英雄级武器英雄刀风之啸狼介绍_网络游戏_游戏攻略_
-
dnf七彩转移晶石怎么得 作用介绍_网络游戏_游戏攻略_
-
魔兽宠物6.0熔火幼犬/霜狼幼崽/霜狼幽灵幼崽 感觉萌萌哒_网络游戏_游戏攻略_
-
WCA2014穿越火线项目赛程与赛制资料预览_网络游戏_游戏攻略_
-
激战2国服9月12日新版本游侠长弓大剑流玩法介绍说明_网络游戏_游戏攻略_
-
逆战56式GP步枪属性介绍 9.2更新新武器56式GP步枪一览_网络游戏_游戏攻略_
-
逆战9月我是幸运星活动网址介绍_逆战9月我是幸运星奖励一览_网络游戏_游戏攻略_
-
逆战AKM月劵步枪怎么样 AKM月劵步枪属性视频分析_网络游戏_游戏攻略_