我得到 *Job for mysql.service failed 因为控制进程以错误代码退出。
See "systemctl status mysql.service" and "journalctl -xe" for details.*
当我运行该命令时,我得到
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-04-20 09:32:04 CDT; 19s ago
Process: 7287 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 7295 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Main PID: 7295 (code=exited, status=1/FAILURE)
Status: "Server startup in progress"
Error: 13 (Permission denied)
Apr 20 09:32:04 sturtz.ml systemd[1]: mysql.service: Service RestartSec=100ms expired, scheduling restart.
Apr 20 09:32:04 sturtz.ml systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Apr 20 09:32:04 sturtz.ml systemd[1]: Stopped MySQL Community Server.
Apr 20 09:32:04 sturtz.ml systemd[1]: mysql.service: Start request repeated too quickly.
Apr 20 09:32:04 sturtz.ml systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 20 09:32:04 sturtz.ml systemd[1]: Failed to start MySQL Community Server.*
我运行了以下命令,它在 Ubuntu Server 19.10 上运行:
您可以登录到
/var/log/mysqld
路径并检查mysql
错误。然后就可以看到权限错误路径了。示例如下。
现在您可以使用以下命令授予对上述路径的访问权限:
之后,尝试启动
mysqld
服务。