在MySQL中更改表引擎 [英] Changing Table Engine in MySQL

查看:142
本文介绍了在MySQL中更改表引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用mysql和mysql工作台。我创建了5个表与innodb引擎。我检查了他们的引擎,它是innodb之前,我插入数据到他们。我从5个MyISAM表插入数据,现在我的innodb表是MyISAM。我不能改变它们。我使用alter table engine = innodb,但它不工作。我只是想知道我可以如何解决这个问题。
Thanx alot。

解决方案

从手册: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html p>

例如,要将表转换为 InnoDB 表,请使用以下语句:

  ALTER TABLE t1 ENGINE = InnoDB; 

尝试更改表的存储引擎的结果受所需存储引擎是否可用以及 NO_ENGINE_SUBSTITUTION SQL模式的设置,如第5.1.7 节服务器SQL模式。



http://dev.mysql.com/doc/refman/5.1/en/server- sql-mode.html#sqlmode_no_engine_substitution



创建表时,您会收到关于引擎类型不可用的任何警告吗?


I am using mysql and mysql workbench. I created 5 tables with innodb engine. I checked their engine and it was innodb before I insert data into them. I inserted data from 5 MyISAM tables and now my innodb tables are MyISAM. I can't change them. I used the alter table engine=innodb but it doesn't work. I just wanna know how I can fix this. Thanx alot.

解决方案

From the manual: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

For example, to convert a table to be an InnoDB table, use this statement:

ALTER TABLE t1 ENGINE = InnoDB;

The outcome of attempting to change a table's storage engine is affected by whether the desired storage engine is available and the setting of the NO_ENGINE_SUBSTITUTION SQL mode, as described in Section 5.1.7, "Server SQL Modes".

http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html#sqlmode_no_engine_substitution

When you create the table do you get any warning about the Engine type being unavailable?

这篇关于在MySQL中更改表引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆