LoginSignup
2
1

More than 5 years have passed since last update.

MariaDBを起動しようとすると、(Errcode: 13 "Permission denied")で起動エラーとなる場合の対処方法

Posted at

Mariadbの保存ディレクトリをmy.cnf出変更した後
Mariadbを起動しようとすると下記のようなエラーが発生起動できませんでした。

Jan 10 10:03:42 localhost mysqld: 2018-01-10 10:03:42 140713415448832 [Warning] Can't create test file /home/mysql/localhost.lower-test
Jan 10 10:03:42 localhost mysqld: #007/usr/sbin/mysqld: Can't change dir to '/home/mysql/' (Errcode: 13 "Permission denied")
Jan 10 10:03:42 localhost mysqld: 2018-01-10 10:03:42 140713415448832 [ERROR] Aborting
Jan 10 10:03:42 localhost systemd: mariadb.service: main process exited, code=exited, status=1/FAILURE

プロテクトが標準で有効になっているため、/usr/lib/systemd/system/mariadb.serviceファイルを下記のように変更します。

mariadb.service
# Prevent writes to /usr, /boot, and /etc
ProtectSystem=off

# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=true

PrivateDevices=true

# Prevent accessing /home, /root and /run/user
ProtectHome=false

mariadbを起動して正常に起動すればOK

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1