Unable to start mariadb: Can't read dir of '/etc/my.cnf.'

Created:

2017-01-19 05:23:29 UTC

Modified:

2017-08-08 13:15:27 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Unable to start mariadb: Can't read dir of '/etc/my.cnf.'

Issue Symptoms

Unable to start mariadb service:

# systemctl status mariadb.service

● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-01-19 11:58:18 +07; 9s ago
Process: 3569 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
Process: 3568 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 3540 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 3568 (code=exited, status=0/SUCCESS)
Jan 19 11:58:17 server_name mysqld_safe[3568]: Fatal error in defaults handling. Program aborted
Jan 19 11:58:17 server_name mysqld_safe[3568]: [74B blob data]
Jan 19 11:58:17 server_name mysqld_safe[3568]: Fatal error in defaults handling.
Program aborted
Jan 19 11:58:17 server_name mysqld_safe[3568]: 170119 11:58:17 mysqld_safe Logging to '/var/lib/mysql/server_name.err'.
Jan 19 11:58:17 server_name mysqld_safe[3568]: 170119 11:58:17 mysqld_safe
Starting mysqld daemon with databases from /var/lib/mysql
Jan 19 11:58:17 server_name mysqld_safe[3568]: 170119 11:58:17 mysqld_safe mysqld from pid file /var/lib/mysql/server_name.pid ended

Following error can be found in /var/lib/mysql/server_name.err:

170119 11:52:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

^G/usr/libexec/mysqld: Can't read dir of '/etc/my.cnf.' (Errcode: 2)
Fatal error in defaults handling. Program aborted
170119 11:52:41 mysqld_safe mysqld from pid file /var/lib/mysql/server_name.pid ended

Conditions

Under investigation.

Resolution:

Add one more line in the end of /etc/my.cnf:

# cat /etc/my.cnf

.......
!includedir /etc/my.cnf.d
# add new line here
Have more questions? Submit a request
Please sign in to leave a comment.