手机
当前位置:查字典教程网 >操作系统 >RedHat/Centos >optimize table出错解决方法
optimize table出错解决方法
摘要:一个某某库大概360W,为了提高查询效率,做点优化,使用optimizetabletable.name;出现Tabledoesnotsupp...

一个某某库大概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功能

【optimize table出错解决方法】相关文章:

CentOS ip_conntrack: table full, dropping packet 的解决方法

openoffice不能调用SCIM的问题解决方法

apache 403错误 Forbidden解决方法

忘记mysql root密码的解决方法

Linux下忘记root用户密码的解决办法

linux设置iptables防火墙的详细步骤(centos防火墙设置方法)

linux的3种引导方法

CentOS yum 段错误 (core dumped)解决方法

Linux与win2003下修改mac地址方法

调整Linux磁盘分区的大小的方法

精品推荐
分类导航