MySQL 升級 5.5 無法啟動 unknown option ‘–skip-locking’

2015-04-27 MySQL

今天在幫一台 MySQL 主機由 5.1 升級為 5.5 ,升級完後在啟動 MySQL 的時候發生 fail 無法啟動

 

從 mysql 的 log 中看到錯誤訊息

 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended  
 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql  
 [Note] Plugin 'FEDERATED' is disabled.  
 InnoDB: The InnoDB memory heap is disabled  
 InnoDB: Mutexes and rw_locks use GCC atomic builtins  
 InnoDB: Compressed tables use zlib 1.2.3  
 InnoDB: Using Linux native AIO  
 InnoDB: Initializing buffer pool, size = 128.0M  
 InnoDB: Completed initialization of buffer pool  
 InnoDB: highest supported file format is Barracuda.  
 InnoDB: Waiting for the background threads to start  
 InnoDB: 5.5.35 started; log sequence number 1589359  
 [ERROR] /usr/libexec/mysqld: unknown option '--skip-locking'  
 [ERROR] Aborting

 

其中 [ERROR] /usr/libexec/mysqld: unknown option ‘–skip-locking’ 這項設定在 5.1 是正常的 option

 

到 MySQL 官方找到 MySQL 5.5 Manual

原來在 MySQL 5.5 中改了許多參數設定,在本偏範例中是 –skip-locking 已經改為  –skip-external-locking

 

所以在 my.cnf 中就必須將參數修改,為 skip-external-locking 即可正常

 

 

可以看到在 MySQL 5.5 官方文件中載名了許多設定參數的改變,尤其一個重點是將原本預設的 MyISAM 改為 InnoDB

 

若是原本的資料庫是 MyISAM 就必須將 MySQL 的資料庫引擎改為 MyISAM

 

而 InnoDB 必須注意的是不在像 MyISAM 可以直接將 database file 直接備份到另一台執行

而必須用 mysqldump 將資料庫 dump 出來才可以使用。

 

參考資料

MySQL 5.5 Manual

 

給 Mr. 沙先生一點建議

彙整

分類

展開全部 | 收合全部

License

訂閱 Mr. 沙先生 的文章

輸入你的 email 用於訂閱