Opensuse

無法啟動mysql服務

  • August 22, 2017

試圖啟動我的mysql服務。

/etc/init.d/mysql start

返回:

Job failed. See system logs and 'systemctl status' for details.

更遠:

systemctl status mysql.service

返回:

mysql.service - LSB: Start the MySQL database server
     Loaded: loaded (/etc/init.d/mysql)
     Active: failed since Mon, 04 Aug 2014 16:20:43 -0400; 38s ago
    Process: 14148 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
    Process: 16457 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
     CGroup: name=systemd:/system/mysql.service

有什麼想法可以讓我知道發生了什麼嗎?

最新條目/var/log/mysql/mysqld.log

140805 08:52:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140805  8:52:42 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
140805  8:53:13 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_contr$
140805  8:53:13 [ERROR] Plugin 'Aria' init function returned error.
140805  8:53:13 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
140805  8:53:13 [ERROR] Failed to initialize plugins.
140805  8:53:13 [ERROR] Aborting

140805  8:53:13 [Note] /usr/sbin/mysqld: Shutdown complete

140805 08:53:13 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended

/var/lib/mysql/aria_log_control文件已被另一個程序打開,因此mysqld無法啟動。

檢查誰/什麼目前打開了文件:

lsof `/var/lib/mysql/aria_log_control`

它應該列出打開它的程序。

COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
mysqld  1506 mysql   10uW  REG  253,1       52 263948 /var/lib/mysql/aria_log_control

如果該過程絕對不應該執行,則使用以下命令將其關閉:

sudo kill -SIGTERM <PID>

如果失敗:

sudo kill -SIGKILL <PID>

或者重啟。

引用自:https://unix.stackexchange.com/questions/148387