MYSQL 错误:13(权限被拒绝)

Nat*_*ate 8 mysql 19.10

我得到 *Job for mysql.service 失败,因为控制进程以错误代码退出。

See "systemctl status mysql.service" and "journalctl -xe" for details.* 
Run Code Online (Sandbox Code Playgroud)

当我运行该命令时,我得到

? 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.*
Run Code Online (Sandbox Code Playgroud)

Nat*_*ate 7

我运行了以下命令,它在 Ubuntu Server 19.10 上运行:

sudo chown -R mysql:mysql /var/lib/mysql/
Run Code Online (Sandbox Code Playgroud)

  • 请在您的答案中提供更多详细信息,以便它是独立的。仅仅命令是不够的。 (2认同)