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张图片

 

 

 

 

你可能感兴趣的:(mysql:Job for mysqld.service failed because the control process exited with error)