试图启动我的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>
或重启.