FAQ_03_ubuntu10.10 下 MySQL 啟動失敗

來源:互聯網
上載者:User

今天MySQL,出了點小問題。遂記之。現描述如下:

 

啟動MySQL 

./bin/mysqld_safe --user=mysql & 

 

 莫名其妙的出現這一行:

 mysqld_safe mysqld from pid file /usr/local/mysql/data/mark.pid ended 

 

根據經驗,一定是沒有啟動MySQL,果然netstat -na | more沒有看到3306

 

查看錯誤記錄檔:

cd /usr/local/mysql/data<br />cat mark.err 

 

//////////////////////////////////////////////////////////////////////////////////////////////////<br />110510 09:59:40 mysqld_safe mysqld from pid file /usr/local/mysql/data/mark.pid ended<br />110510 10:01:16 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data<br />110510 10:01:16 [Note] Plugin 'FEDERATED' is disabled.<br />110510 10:01:16 InnoDB: The InnoDB memory heap is disabled<br />110510 10:01:16 InnoDB: Mutexes and rw_locks use InnoDB's own implementation<br />110510 10:01:16 InnoDB: Compressed tables use zlib 1.2.3<br />110510 10:01:16 InnoDB: Using Linux native AIO<br />110510 10:01:16 InnoDB: Initializing buffer pool, size = 128.0M<br />110510 10:01:16 InnoDB: Completed initialization of buffer pool<br />110510 10:01:16 InnoDB: highest supported file format is Barracuda.<br />110510 10:01:16 InnoDB: Waiting for the background threads to start<br />110510 10:01:17 InnoDB: 1.1.6 started; log sequence number 1610190<br />/usr/local/mysql/bin/mysqld: File './mysql-bin.000006' not found (Errcode: 13)<br />110510 10:01:17 [ERROR] Failed to open log (file './mysql-bin.000006', errno 13)<br />110510 10:01:17 [ERROR] Could not open log file<br />110510 10:01:17 [ERROR] Can't init tc log<br />110510 10:01:17 [ERROR] Aborting<br />110510 10:01:17 InnoDB: Starting shutdown...<br />110510 10:01:18 InnoDB: Shutdown completed; log sequence number 1610190<br />110510 10:01:18 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete<br />///////////////////////////////////////////////////////////////////////////////////////////////// 

 

解決辦法:

 

看到Failed to open log (file './mysql-bin.000006', errno 13) 然後,

cd /usr/local/mysql/data<br />rm -f mysql-bin.* 

 

ok,搞定!

 

再次啟動,成功。

 

嘿嘿,/usr/local/mysql/data下面終於出現 mark.pid.

 

造成這種原因是因為突然斷電或者強制關機,沒有正常退出MySQL。只是估計。

還有一種情況導致這個錯誤的發生:

修改了 /etc/my.cnf 檔案(這個檔案是從 mysql 安裝目錄ln -s 過來的,具體可以看http://blog.csdn.net/androidbluetooth/article/details/6394301),比如說修改 mysql 預設字元集編碼等。

如果出現類似上述現象,請將該檔案恢複到原來的內容,按照前面所說的刪除 mysql-bin.*檔案,再次啟動 mysql 即可!

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.