首页 > 解决方案 > Mysql 服务器未启动错误 13 Ubuntu 20.04

问题描述

我的 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

标签: mysqlubuntuubuntu-20.04

解决方案


推荐阅读