启动数据库时报错
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details
根据提示使用命令
systemctl status mysqld.service
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 四 2024-08-29 19:56:10 CST; 29s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 2703 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 2676 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 2703 (code=exited, status=1/FAILURE)
Status: "Server shutdown complete"
Error: 13 (权限不够)
8月 29 19:56:02 localhost.localdomain systemd[1]: Starting MySQL Server...
8月 29 19:56:10 localhost.localdomain systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
8月 29 19:56:10 localhost.localdomain systemd[1]: Failed to start MySQL Server.
8月 29 19:56:10 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
8月 29 19:56:10 localhost.localdomain systemd[1]: mysqld.service failed.
错误信息13
尝试使用
[root@localhost log]# getenforce
Enforcing
[root@localhost log]# setenforce 0
[root@localhost log]# getenforce
Permissive
之后连接成功