Job for mysqld.service failed because the control process exited with error code.
See “systemctl status mysqld.service” and “journalctl -xe” for details.
[FAILED]
查看日志发现:无法创建PID文件:权限被拒绝
解决办法:
修改 /var/run/mysqld/权限为mysql
[root@djaljdw ~]# chown -R mysql /var/run/mysqld
[root@djaljdw ~]# chgrp -R mysql /var/run/mysqld
[root@djaljdw ~]# chmod 777 /var/run/mysqld
重启服务完美解决
tip:看日志是解决问题的一个很好的办法! 好用点个收藏~~
远程连接
【1】
mysql里远程连接授权
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘YYBrhr_2018’ WITH GRANT OPTION;
【2】开放3306端口
查看开放端口 :firewall-cmd --list-all
firewall-cmd --permanent --add-port=3306/tcp
【3】重启防火墙
service firewalld restart
【4】查看3306端口是否开放
firewall-cmd --query-port=3306/tcp