Can't read my.cnf file bug

Started by feronso, December 15, 2017, 08:00:26 AM

Previous topic - Next topic

feronso

Hello,

CPU Model: Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
CPU Details: 1 Core (2500 MHz)
Distro Name: CentOS Linux release 7.4.1708 (Core)
Kernel Version: 3.10.0-693.11.1.el7.x86_64
Platform: x86_64 [kvm]

Fresh Installed, and after optimise settings follow by CSF security check rebooted server, just edit the file of my.cnf within the server and added this line: local-infile=0  under [client-server]. save exit reboot server and mariadb server won't start any more with new unique error generating in /var/log/messages . and no matter you redo the changes it remain same stable mariadb down



QuoteDec 15 15:45:47 server1 systemd: Starting MariaDB database server...
Dec 15 15:45:47 server1 sh: #007/usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:45:47 server1 sh: Fatal error in defaults handling. Program aborted
Dec 15 15:45:47 server1 mysqld: #007/usr/sbin/mysqld: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:45:47 server1 mysqld: Fatal error in defaults handling. Program aborted
Dec 15 15:45:47 server1 systemd: mariadb.service: main process exited, code=exited, status=1/FAILURE
Dec 15 15:45:47 server1 systemd: Failed to start MariaDB database server.
Dec 15 15:45:47 server1 systemd: Unit mariadb.service entered failed state.
Dec 15 15:45:47 server1 systemd: mariadb.service failed.

Dec 15 15:45:58 server1 systemd: Starting MariaDB database server...
Dec 15 15:45:58 server1 sh: #007/usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:45:58 server1 sh: Fatal error in defaults handling. Program aborted
Dec 15 15:45:58 server1 mysqld: #007/usr/sbin/mysqld: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:45:58 server1 mysqld: Fatal error in defaults handling. Program aborted
Dec 15 15:45:58 server1 systemd: mariadb.service: main process exited, code=exited, status=1/FAILURE
Dec 15 15:45:58 server1 systemd: Failed to start MariaDB database server.
Dec 15 15:45:58 server1 systemd: Unit mariadb.service entered failed state.
Dec 15 15:45:58 server1 systemd: mariadb.service failed.
Dec 15 15:46:08 server1 systemd: Starting MariaDB database server...
Dec 15 15:46:08 server1 sh: #007/usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:46:08 server1 sh: Fatal error in defaults handling. Program aborted
Dec 15 15:46:08 server1 mysqld: #007/usr/sbin/mysqld: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:46:08 server1 mysqld: Fatal error in defaults handling. Program aborted
Dec 15 15:46:08 server1 systemd: mariadb.service: main process exited, code=exited, status=1/FAILURE
Dec 15 15:46:08 server1 systemd: Failed to start MariaDB database server.
Dec 15 15:46:08 server1 systemd: Unit mariadb.service entered failed state.
Dec 15 15:46:08 server1 systemd: mariadb.service failed.
Dec 15 15:46:18 server1 systemd: Starting MariaDB database server...
Dec 15 15:46:18 server1 sh: #007/usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:46:18 server1 sh: Fatal error in defaults handling. Program aborted
Dec 15 15:46:18 server1 mysqld: #007/usr/sbin/mysqld: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory")
Dec 15 15:46:18 server1 mysqld: Fatal error in defaults handling. Program aborted
Dec 15 15:46:18 server1 systemd: mariadb.service: main process exited, code=exited, status=1/FAILURE
Dec 15 15:46:18 server1 systemd: Failed to start MariaDB database server.
Dec 15 15:46:18 server1 systemd: Unit mariadb.service entered failed state.
Dec 15 15:46:18 server1 systemd: mariadb.service failed.


if you notice this line mysqld: #007/usr/sbin/mysqld: Can't read dir of '/etc/my.cnf.' (Errcode: 2 "No such file or directory") and after hours efforts what i did is to add dot . in the end of my.cnf file name in /etc/my.cnf so it will be now /etc/my.cnf. with an extra dot in the end. i don't how and why this happens but i believe this is programing bug within panel but i have more server where same configuration work without any extra dot . so i m curious to know the reason from developer.

Thanks advanced

feronso


cwp_user2018

looks like my.cnf file dosn't exists.
login with ssh and create empty one. mysql should run with default configuration

darkness

There`s no my.cnf, there`s .my.cnf :)
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

daniel123

Hi all,

the problem here is that my.cnf needs to be saved with the new line at the end of the file. Some editors, e.g. vim do it automatically and they put a "new line" character at the end of each file - without having the user to actually see it - so it appears that the file ends with the very last character.

However if you open this file up with with a different editor, e.g. Mousepad, you will find out that tere is an extra line - a new line - at the end of the file. If there is not - that is the problem - because MySQL fails to process that kind of configuration.

Apparently there is a standard for having files end with a new line. Some software upholds it strictly (e.g. MySQL) and that's why we can find this error in MySQL explicitely.

Details: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

I hope I've saved someone a whole lotta of trouble researching this bug. :)