SOLVED Mysql is ignoring /etc/my.cnf setting

Dedan Irungu

Member
Oct 19, 2017
7
0
1
Nairobi
cPanel Access Level
DataCenter Provider
I have tried to disable xxx by setting it to zero(0) but it mysql is ignoring the setting provide in /etc/my.cnf.

[mysqld]
skip-name-resolve=0

I have attempt to introduce errors by removing [mysqld] to see if file is called and I the system did show errors on restart which means the file is called.

How can I make it work and disable skip-name-resolve
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
465
113
UK
cPanel Access Level
Root Administrator
As well as an /etc/my.cnf , you may have a /usr/my.cnf file that is read after the /etc/my.cnf
 

Dedan Irungu

Member
Oct 19, 2017
7
0
1
Nairobi
cPanel Access Level
DataCenter Provider
Thank for quick response.

I have check in the server and file /usr/my.cnf does not exist. The other file that exists is /usr/etc/my.cnf and is empty.

All mysql .cnf files are listed below.

sudo find / -name "*my*cnf"

/root/.my.cnf
/usr/local/cpanel/scripts/check_users_my_cnf
/usr/etc/my.cnf
/usr/share/mysql/my-default.cnf
/usr/share/doc/MySQL56-server-5.6.37/my-default.cnf
/usr/share/mysql-test/include/default_my.cnf
/usr/share/mysql-test/include/default_mysqld.cnf
/usr/share/mysql-test/include/default_mysqld_autosize.cnf
/usr/share/mysql-test/suite/rpl_ndb/my.cnf
/usr/share/mysql-test/suite/rpl/extension/bhs/my.cnf
/usr/share/mysql-test/suite/rpl/my.cnf
/usr/share/mysql-test/suite/federated/my.cnf
/usr/share/mysql-test/suite/ndb_team/my.cnf
/usr/share/mysql-test/suite/ndb/include/ndb_add_node_mysqld.cnf
/usr/share/mysql-test/suite/ndb/ndb_config_mycnf1.cnf
/usr/share/mysql-test/suite/ndb/my.cnf
/usr/share/mysql-test/suite/ndb/ndb_config_mycnf2.cnf
/usr/share/mysql-test/suite/ndb_binlog/my.cnf
/usr/share/mysql-test/suite/ndb_big/my.cnf
/usr/share/mysql-test/suite/ndb_rpl/my.cnf
/usr/share/mysql-test/t/mysql_client_test_embedded.cnf
/usr/share/mysql-test/std_data/.mylogin.cnf
/etc/my.cnf
 

Dedan Irungu

Member
Oct 19, 2017
7
0
1
Nairobi
cPanel Access Level
DataCenter Provider
I have found a solution.

Warning: World-writable config file '/etc/my.cnf' is ignored.

The reasons for this situation is: MySQL deliberately not let user permissions override my.cnf, default is 644, namely -rw-r--r--, if the permissions that are not 644, will appear this kind of circumstance.

To change it use this command.

sudo chmod 600 /etc/my.cnf
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
465
113
UK
cPanel Access Level
Root Administrator
I would like to draw your attention to a post (admittedly quite old) on these forums that you may want to review before doing anything:
Hello,

cPanel isn't designed or tested with the skip-name-resolve option in the /etc/my.cnf , so enabling this option in your /etc/my.cnf file will break certain functionality. Is there a specific reason you have enabled it on this system? The easier path to addressing the issue is to resolve the problem that's leading to the use of the option.

Thank you.
 
Last edited:

cPWilliamL

cP Technical Analyst II
Staff member
May 15, 2017
258
30
103
America
cPanel Access Level
Root Administrator
As rpvw pointed out, disabling skip-name-resolve can certainly cause issues; at the very least for remote MySQL servers. I don't think disabling this is as big a performance boost as optimizing queries or databases.