Author Topic: Can't read my.cnf file bug  (Read 11633 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Can't read my.cnf file bug
« on: December 15, 2017, 08:00:26 AM »
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



Quote
Dec 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
« Last Edit: December 15, 2017, 08:03:04 AM by feronso »

Offline
*
Re: Can't read my.cnf file bug
« Reply #1 on: January 09, 2018, 09:36:04 AM »
WOW, no responses

Offline
*
Re: Can't read my.cnf file bug
« Reply #2 on: January 09, 2018, 10:55:48 AM »
looks like my.cnf file dosn't exists.
login with ssh and create empty one. mysql should run with default configuration

Offline
***
Re: Can't read my.cnf file bug
« Reply #3 on: January 09, 2018, 08:26:37 PM »
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 ...

Offline
*
Re: Can't read my.cnf file bug
« Reply #4 on: April 30, 2018, 09:09:53 AM »
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. :)