MySQL - MariaDB - CentOS 7 - Can't start server: can't create PID file: Permission denied
Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2024
MySQL - MariaDB - CentOS 7 - Can't start server: can't create PID file: Permission denied
Ошибка вида
# journalctl -xe - Unit mariadb.service has begun starting up. Feb 03 15:09:11 vps mysqld_safe[3464]: 170203 15:09:11 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'. Feb 03 15:09:11 vps mysqld_safe[3464]: 170203 15:09:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql Feb 03 15:09:13 vps mysqld_safe[3464]: 170203 15:09:13 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended Feb 03 15:09:13 vps systemd[1]: mariadb.service: control process exited, code=exited status=1 Feb 03 15:09:13 vps systemd[1]: Failed to start MariaDB database server. -- Subject: Unit mariadb.service has failed -- Defined-By: systemd
Смотрим делатальнее логи MariaDB
# tail -100 /var/log/mariadb/mariadb.log 170203 15:09:12 InnoDB: Waiting for the background threads to start 170203 15:09:13 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 1670303 170203 15:09:13 [Note] Plugin 'FEEDBACK' is disabled. 170203 15:09:13 [Note] Server socket created on IP: '0.0.0.0'. 170203 15:09:13 [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 13) 170203 15:09:13 [ERROR] Can't start server: can't create PID file: Permission denied 170203 15:09:13 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
Решение - подправить владельца на директорию:
#chown -R mysql:mysql /var/run/mariadb/ # systemctl restart mariadb.service