LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   mysql not using the /etc/init.d/my.cnf file - Please help, I'm desperate! :) (https://www.linuxquestions.org/questions/linux-server-73/mysql-not-using-the-etc-init-d-my-cnf-file-please-help-im-desperate-755597/)

karll 09-16-2009 07:04 AM

mysql not using the /etc/init.d/my.cnf file - Please help, I'm desperate! :)
 
Hi,

Edit: Oops... The title is all wrong, I sound like a total newbie :) It should say "mysql not using the /etc/mysql/my.cnf file". Sorry!

Please forgive me if this is not the right forum for this.

I've recently installed MySQL 5.1.37-community and migrated some databases from a previous MySQL version to the new one.

Now, all this has been working just fine. The other day I decided I wanted to try and fine-tune some of the configuration settings, so I started looking for the my.cnf file. Well, there was no my.cnf to be found anywhere. I looked in all the obvious places. So I guess somehow MySQL must be running with the default settings, and there really is no my.cnf file installed.

So to be able to change the settings, I copied the /usr/share/mysql/my-medium.cnf file to /etc/my.cnf . I then did "/etc/init.d/mysql reload", but it seems it just didn't pick up the config file. I tried changing the ownership to "mysql" and moving it into the /etc/mysql folder which apparently is more appropriate for this version of MySQL, but it still won't pick up the file.

Some details:
# ll -d /etc/mysql/
drwxr-xr-x 2 mysql mysql 4096 Sep 16 06:33 /etc/mysql/

# ll /etc/mysql/
total 8
-rw-r--r-- 1 mysql mysql 4993 Sep 16 03:20 my.cnf

# more /etc/mysql/my.cnf | grep max_connections
max_connections = 475

# /etc/init.d/mysql reload
Reloading service MySQL [ OK ]

# mysqladmin -p variables | grep max_connections
Enter password:
| max_connections | 151 |

Code:

# ps -ef | grep mysql
root    24070    1  0 Sep15 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/[MY HOSTNAME].pid
mysql    24173 24070 15 Sep15 ?        04:20:58 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/[MY HOSTNAME].err --pid-file=/var/lib/mysql/[MY HOSTNAME].pid --socket=/var/lib/mysql/mysql.sock --port=3306
root      7246  2240  0 06:59 pts/0    00:00:00 grep mysql

I would do /etc/init.d/mysql restart, but it's a production website, so I can't do that just now.

The OS is RHEL4 ... (Yes, I know a bit old.)

Please help if you can, I'm getting desperate!

kirukan 09-16-2009 08:28 AM

I think you cant load configuration file(my.cnf) at reload and check your startup script which path defined for my.cnf

karll 09-16-2009 04:03 PM

I thought that was the whole point of reload - to reload the configuration file?

As for the path for my.cnf, I think mysqld is hardcoded to look for my.cnf in ccertain locations, such as in /etc/ and /etc/mysql/ ?

kirukan 09-17-2009 12:17 AM

Quote:

I think mysqld is hardcoded
Nope, check your mysql startup script at /etc/rc.d/init.d location this just a shell script

karll 09-17-2009 07:09 AM

Quote:

Originally Posted by kirukan (Post 3686382)
Nope, check your mysql startup script at /etc/rc.d/init.d location this just a shell script

Hm, yes, but...

Anyway, I just did a "/etc/init.d/mysql restart" instead of a "reload", and then it finally picked up my my.cnf file! So it looks like you are definitely right that "reload" is no good. Thanks for your help!


All times are GMT -5. The time now is 09:33 PM.