The server quit without updating PID file (/usr/local/mysql/data/master.pid).[FAILED]
在重启MySQL的时候,出现上述问题。
/usr/local/mysql/data/iZbp1fu303s3z6qri8iw4vZ.pid
该文件早不到,这是因为原来的主机名叫做iZbp1fu303s3z6qri8iw4vZ
,但是后面将主机名改成了master
,所以找不到这个文件。
解决办法是:复制一份cp /usr/local/mysql/data/iZbp1fu303s3z6qri8iw4vZ.pid /usr/local/mysql/data/master.pid
之后再进行重启systemctl restart mysql
就不会出现这个问题了
[root@master local]# systemctl status mysqld.service
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2023-07-29 16:45:03 CST; 1min 38s ago
Docs: man:systemd-sysv-generator(8)
Process: 23138 ExecStop=/etc/rc.d/init.d/mysqld stop (code=exited, status=0/SUCCESS)
Process: 29952 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)
Tasks: 150
Memory: 427.3M
CGroup: /system.slice/mysqld.service
├─2117 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/iZbp1fu303s3z6qri8iw4vZ.pid
└─2477 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mariadb/mariadb.log --pi...
Jul 29 16:43:22 master systemd[1]: Starting LSB: start and stop MySQL...
Jul 29 16:45:03 master mysqld[29952]: Starting MySQL.....................................................................................................The server quit without updating PID ....pid).[FAILED]Jul 29 16:45:03 master systemd[1]: mysqld.service: control process exited, code=exited status=1
Jul 29 16:45:03 master systemd[1]: Failed to start LSB: start and stop MySQL.
Jul 29 16:45:03 master systemd[1]: Unit mysqld.service entered failed state.
Jul 29 16:45:03 master systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@master local]#