1.centos7启动报错

Starting mysqld (via systemctl):  Job for mysqld.service failed because the control process exited with error code. 

See "systemctl status mysqld.service" and "journalctl -xe" for details.

2. more /var/log/mysqld.log 查看日志

2018-09-13T02:45:55.234888Z 0 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file 

'/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file
 or directory)
2018-09-13T02:45:55.234901Z 0 [ERROR] Can't start server: can't create PID file: No such file or directory
[root@izwz9i6slp0lyfpq28b2xoz local]# more /var/log/mysqld.log 

缺少目录文件

# mkdir -p  /var/run/mysqld  ,该文件会创建一个mysqld.pid

3.启动依然报错,权限问题

2018-09-13T02:51:20.206992Z 0 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13 - Permission 
denied)
2018-09-13T02:51:20.207004Z 0 [ERROR] Can't start server: can't create PID file: Permission denied

4. chown mysql.mysql /var/run/mysqld/

Logo

更多推荐