分类 运维 下的文章

启动错误信息如下:

mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Mon 2021-12-20 10:30:05 CST; 1s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 2996 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
  Process: 2978 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)

Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: Failed to start MySQL Server.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: Unit mysqld.service entered failed state.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: mysqld.service failed.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: mysqld.service holdoff time over, scheduling restart.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: Stopped MySQL Server.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: start request repeated too quickly for mysqld.service
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: Failed to start MySQL Server.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: Unit mysqld.service entered failed state.
Dec 20 10:30:05 iZbp188uiv7i1p64qq0oicZ systemd[1]: mysqld.service failed.

一 查找配置文件
find / -name my.cnf
/usr/local/mysql/etc/my.cnf

二 查看日志文件路径
cat /usr/local/mysql/etc/my.cnf | grep log-error
/web/logs/mysql/mysqld.log

三 查看日志文件尾页
tail -200 /web/logs/mysql/mysqld.log
2021-12-20T02:30:03.534858Z 0 [ERROR] Unix socket lock file is empty /tmp/mysql.sock.lock.
2021-12-20T02:30:03.534864Z 0 [ERROR] Unable to setup unix socket lock file.
2021-12-20T02:30:03.534867Z 0 [ERROR] Aborting

四 排除ERROR内容
rm -rf ./mysql.sock.lock