mysql启动失败,错误日志:[ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 [Note] InnoDB: Check that you

mysql启动失败:

● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: activating (start) since Wed 2018-04-04 10:30:50 CST; 14s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 29463 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
  Control: 29480 (mysqld)
   CGroup: /system.slice/mysqld.service
           ├─29480 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
           └─29484 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Apr 04 10:30:50 izuf65ylvdo8oui0t2l08oz systemd[1]: mysqld.service holdoff time over, sch...t.
Apr 04 10:30:50 izuf65ylvdo8oui0t2l08oz systemd[1]: Starting MySQL Server...
Hint: Some lines were ellipsized, use -l to show in full.

查看错误日志:

[ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
[Note] InnoDB: Check that you do not already have                                                                                         another mysqld process using the same InnoDB data or log files.

可以看出进程被占用了
查看进程:ps -ef | grep mysql

root     27325     1  0 Apr03 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql    27456 27325  0 Apr03 ?        00:00:34 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
mysql    30158     1  0 10:59 ?        00:00:00 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
mysql    30162     1  0 10:59 ?        00:00:00 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
root     30181 29139  0 11:00 pts/2    00:00:00 grep --color=auto mysql

kill -9 27456
杀死进程之后再重新启动:systemctl start mysqld.service
查看状态:systemctl status mysqld.service

● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2018-04-04 11:01:00 CST; 1min 48s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 30158 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 30141 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 30162 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─30162 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Apr 04 10:59:30 izuf65ylvdo8oui0t2l08oz systemd[1]: mysqld.service holdoff time over, scheduling restart.
Apr 04 10:59:30 izuf65ylvdo8oui0t2l08oz systemd[1]: Starting MySQL Server...
Apr 04 11:01:00 izuf65ylvdo8oui0t2l08oz systemd[1]: Started MySQL Server.

猜你喜欢

转载自blog.csdn.net/miss_audrey/article/details/79815024