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

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_第1张图片
2.先查看mysql的日志:tail -40f /var/log/mysql.log
mysql:Job for mysqld.service failed because the control process exited with error_第2张图片
红圈里面的信息是说明不能建立临时文件“/var/lib/mysql/temp/ib1GIFsS”

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

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

[root@localhost etc]# chown mysql.mysql /var/lib/mysql/temp

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

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

你可能感兴趣的:(问题解决)