mysql:Job for mysqld.service failed because the control process exited with error

时间:2024-05-23 22:34:45

1.启动mysql时出现Job for mysqld.service failed because the control process exited with error
mysql:Job for mysqld.service failed because the control process exited with error
2.先查看mysql的日志:tail -40f /var/log/mysql.log
mysql:Job for mysqld.service failed because the control process exited with error
红圈里面的信息是说明不能建立临时文件“/var/lib/mysql/temp/ib1GIFsS”

3.接下来是修改配置文件,指定temp的存放路径
vi /etc/my.cnf
mysql:Job for mysqld.service failed because the control process exited with error
在配置文件里面添加一句“temdir=/var/lib/mysql/temp/”,保存后退出

4.建立文件夹、授权
[[email protected] etc]# mkdir -p /var/lib/mysql/temp

[[email protected] etc]# chown mysql.mysql /var/lib/mysql/temp

/var/lib/mysql/temp的属主和属组还是root,mysql并不能在其中创建文件,后修改该目录的属主和属组

5.启动成功
mysql:Job for mysqld.service failed because the control process exited with error
6.查看mysql的运行状态
mysql:Job for mysqld.service failed because the control process exited with error
————————————————
版权声明:本文为****博主「xc_123」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.****.net/xc_123/article/details/100518898