Link to home
Start Free TrialLog in
Avatar of CCVOIP
CCVOIP

asked on

Mysql is not using /etc/my.cnf

Hi
I have mysql 5.1.73 installed on centos6.4

when I stop/start mysqld :
/etc/init.d/mysqd stop/start
 , as a root user, the system variables within /etc/my.cnf are applied
when I stop/start mysqld :
/etc/init.d/mysqd stop/start
 , as a mysql user I notice the following variables changes logged into error.log
151023 19:58:15 [Warning] Changed limits: max_open_files: 1024  max_connections: 886  table_cache: 64

any idea why this is happening?

Thanks,
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Have you looked to see if the 'user' has a separate 'my.cnf' file?
ASKER CERTIFIED SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CCVOIP
CCVOIP

ASKER

Hello Tomas,

 
[root@ ~]#mysql --help | grep "Default options" -A 1
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
[root@ ~]#cat /etc/mysql/my.cnf
cat: /etc/mysql/my.cnf: No such file or directory
[root@ ~]# cat ~/.my.cnf
cat: /root/.my.cnf: No such file or directory
[mysql@ ~]# cat ~/.my.cnf
cat: /home/mysql/.my.cnf: No such file or directory

Open in new window


rebooted the machine, but still the same thing :( . any other suggestions??

I followed your suggestion to fix open files and it worked perfectly. Thanks

Regards,
Hi!

The command
locate my.cnf

Open in new window

(issued as root) should give you all my.cnf files on your host.
Note that if you don't find any my.cnf on the default paths then you can always create one (in the /etc/ path ) and configure the system parameters you want to differ from default. :)

Regards,
      Tomas Helgi
Avatar of CCVOIP

ASKER

Hi,
I do have a my.cnf  file under /etc/ where I specified all the configuration . it's just I don't understand why root user uses the /etc/my.cnf and mysql user uses something else which I don't seem to find.!!

Thanks
Hi!

The default location for the my.cnf is usually in the /etc folder where the mysql user (user running the deamon) accesses it.


Regards,
     Tomas Helgi
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CCVOIP

ASKER

Hi,
both commands return nothing
[root@~]# ps -ef | grep mysql | grep "defaults-file"
[root@~]#

Open in new window

[root@ ~]# mysql --print-defaults
mysql would have been started with the following arguments:

[root@ ~]#

Open in new window

Avatar of CCVOIP

ASKER

I've requested that this question be closed as follows:

Accepted answer: 0 points for CCVOIP's comment #a41135975
Assisted answer: 250 points for TomasHelgi's comment #a41104064
Assisted answer: 250 points for TomasHelgi's comment #a41134047

for the following reason:

thank you all for your responses. but still having the same issue!!
Avatar of CCVOIP

ASKER

Thanks all for your response. but I still have the same issue!!!