systemctl 状态 mysql:

systemctl 状态 mysql:

我的 mysql 服务器无法启动,出现错误 13(权限被拒绝)

我刚刚更改了 mysql 数据目录(说实话我不确定我是否做得正确)

我已确保新目录的组和所有者为 mysql

systemctl 状态 mysql:

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-10-07 18:54:56 CEST; 6s ago
    Process: 1119 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 1127 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
   Main PID: 1127 (code=exited, status=1/FAILURE)
     Status: "Server startup in progress"
      Error: 13 (Permission denied)

Oct 07 18:54:56 Main systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Oct 07 18:54:56 Main systemd[1]: Stopped MySQL Community Server.
Oct 07 18:54:56 Main systemd[1]: mysql.service: Start request repeated too quickly.
Oct 07 18:54:56 Main systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 07 18:54:56 Main systemd[1]: Failed to start MySQL Community Server.

和新配置

猫/etc/mysql/conf.d/local_configs.cnf:

[mysqld]
datadir=/mnt/HC_Volume_13969265/mysql-data

目录权限:

drwxr-xr-x 13 mysql mysql 12288 Oct  7 18:41 mysql-data

相关内容