2009-12-10 80 views
9

我做了擦除和恢復。我無法將myISAM轉換爲innodb

  1. 我備份了我目前的innodb表。 (mysqldump)
  2. 我把它加載到數據庫中。
  3. 由於某種原因......桌子現在都是myisam而不是innodb ......怪異!
  4. 我試着做:

    ALTER TABLE xxx ENGINE = innodb;

而且它對任何表都沒有任何影響。

「顯示錶狀態」仍是「的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 2009-12-10 05:03:18

+0

我看到您已包含顯示有警告的更新。以下查詢的輸出是什麼:'show warnings;'? – Asaph 2009-12-10 05:04:46

+0

很老的MySQL版本默認沒有啓用InnoDB。你使用的是什麼版本的MySQL?以下查詢的輸出是什麼:'select version();'? – Asaph 2009-12-10 05:09:34

回答

10

我在InnoDB的是在你的MySQL安裝禁用您show engines輸出中看到。您需要啓用它才能將您的表從MyISAM轉換爲InnoDB。

+1

如何啓用它? – TIMEX 2009-12-10 05:08:04

+0

@alex:你使用的是什麼版本的MySQL?用'select version();'檢查。 – Asaph 2009-12-10 05:10:29

+0

@alex:在MySQL錯誤日誌(可能是啓動期間)中是否有任何條目似乎與InnoDB支持有關? – Asaph 2009-12-10 05:14:20