您现在的位置是:网站首页> 编程资料编程资料
optimize table出错解决方法_RedHat/Centos_操作系统_
2023-03-25
793人已围观
简介 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功能
相关内容
- Linux centos系统的IP设置配置方法_RedHat/Centos_操作系统_
- CentOS 5 安装免费虚拟主机管理系统Kloxo_RedHat/Centos_操作系统_
- centos下安装VMware Server 虚拟机的方法_RedHat/Centos_操作系统_
- centOS5.5下配置vnc的步骤分享(开启linux远程桌面)_RedHat/Centos_操作系统_
- CentOS 6 的安全配置(CentOS Linux服务器安全设置)_RedHat/Centos_操作系统_
- CentOS 5 服务器 Nginx 环境推荐教程_RedHat/Centos_操作系统_
- centos5 源码安装Nginx + mysql + apache + php的方法_RedHat/Centos_操作系统_
- Red Hat 6企业版系统故障修复方法_RedHat/Centos_操作系统_
- CentOS 6.X 开机错误修复步骤分享_RedHat/Centos_操作系统_
- Centos Nginx + Svbversion配置安装方法分享_RedHat/Centos_操作系统_
