我无法将myISAM转换为innodb。

9

我进行了清除和恢复操作。

  1. 我备份了当前的innodb表格。(mysqldump)
  2. 我将其加载到数据库中。
  3. 由于某种原因...这些表现在全部变成了myisam而不是innodb...奇怪!
  4. 我尝试执行:

    ALTER TABLE xxx ENGINE=innodb;

但它对任何表格都没有产生任何影响。

"Show table status" 仍然是 "MyISAM"

mysql> alter table auth_user_user_permissions engine=innodb;
Query OK, 0 rows affected, 1 warning (0.06 sec)
Records: 0  Duplicates: 0  Warnings: 0



+------------+----------+----------------------------------------------------------------+
| Engine     | Support  | Comment                                                        |
+------------+----------+----------------------------------------------------------------+
| MyISAM     | DEFAULT  | Default engine as of MySQL 3.23 with great performance         |
| MEMORY     | YES      | Hash based, stored in memory, useful for temporary tables      |
| InnoDB     | DISABLED | Supports transactions, row-level locking, and foreign keys     |
| BerkeleyDB | NO       | Supports transactions and page-level locking                   |
| BLACKHOLE  | YES      | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE    | NO       | Example storage engine                                         |
| ARCHIVE    | YES      | Archive storage engine                                         |
| CSV        | YES      | CSV storage engine                                             |
| ndbcluster | DISABLED | Clustered, fault-tolerant, memory-based tables                 |
| FEDERATED  | DISABLED | Federated MySQL storage engine                                 |
| MRG_MYISAM | YES      | Collection of identical MyISAM tables                          |
| ISAM       | NO       | Obsolete storage engine                                        |
+------------+----------+----------------------------------------------------------------+



# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb

innodb_buffer_pool_size = 10000M
innodb_additional_mem_pool_size = 20M
innodb_log_file_size=1024M
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit = 0


mysql> alter table auth_group engine=innodb;
Query OK, 0 rows affected, 1 warning (0.05 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show warnings;
+---------+------+----------------------------------------------------+
| Level   | Code | Message                                            |
+---------+------+----------------------------------------------------+
| Warning | 1266 | Using storage engine MyISAM for table 'auth_group' |
+---------+------+----------------------------------------------------+
1 row in set (0.00 sec)

1
这可能有点冒险,但是你的新安装的MySQL是否可能不包括InnoDB支持?要查看支持的引擎,请发出以下查询:show engines;。输出是什么? - Asaph
我看到您已经更新了一个显示警告的内容。以下查询语句的输出是什么:show warnings; - Asaph
非常老的MySQL版本默认情况下不启用InnoDB。您使用的是哪个版本的MySQL?以下查询的输出是什么:select version(); - Asaph
1个回答

10

我在你的show engines输出中看到,你的MySQL安装中已禁用InnoDB引擎。你需要启用它才能将表从MyISAM转换为InnoDB。


@alex:你在使用哪个版本的MySQL?请用select version();进行确认。 - Asaph
@alex:MySQL错误日志中是否有任何条目(在启动期间)似乎与InnoDB支持有关? - Asaph
2
我知道了。删除 ib_logfile0 和 ib_logfile1。 - TIMEX

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接