当前位置:   article > 正文

mysql data目录修改后 ,启动报错 -13: 权限不够_status: "server shutdown complete" error: 13 (权限不够

status: "server shutdown complete" error: 13 (权限不够)

1、错误信息

$ systemctl status mysqld.service
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2023-06-07 15:09:41 CST; 18s ago
  Process: 2100381 ExecStopPost=/usr/libexec/mysql-wait-stop (code=exited, status=0/SUCCESS)
  Process: 2100378 ExecStart=/usr/libexec/mysqld --basedir=/usr (code=exited, status=1/FAILURE)
  Process: 2100341 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
  Process: 2100316 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 2100378 (code=exited, status=1/FAILURE)
   Status: "Server shutdown complete"
    Error: 13 (权限不够)

6月 07 15:09:40 edh09.gk.com systemd[1]: Starting MySQL 8.0 database server...
6月 07 15:09:41 edh09.gk.com systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
6月 07 15:09:41 edh09.gk.com systemd[1]: mysqld.service: Failed with result 'exit-code'.
6月 07 15:09:41 edh09.gk.com systemd[1]: Failed to start MySQL 8.0 database server.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

2、解决方案

chown -R mysql [mysql 目录]
  • 1

如果是修改了mysql的目录,不再使用默认的目录地址,还需执行以下命令,保证mysql目录附带mysqld_db_t标志

chcon -R -t mysqld_db_t [mysql 目录]
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/114772
推荐阅读
相关标签
  

闽ICP备14008679号