LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-16-2009, 07:04 AM   #1
karll
LQ Newbie
 
Registered: Sep 2009
Location: United Kingdom
Distribution: RHEL, Fedora, FreeBSD
Posts: 21

Rep: Reputation: 0
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!

Last edited by karll; 09-16-2009 at 07:14 AM.
 
Old 09-16-2009, 08:28 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
I think you cant load configuration file(my.cnf) at reload and check your startup script which path defined for my.cnf
 
Old 09-16-2009, 04:03 PM   #3
karll
LQ Newbie
 
Registered: Sep 2009
Location: United Kingdom
Distribution: RHEL, Fedora, FreeBSD
Posts: 21

Original Poster
Rep: Reputation: 0
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/ ?
 
Old 09-17-2009, 12:17 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Quote:
I think mysqld is hardcoded
Nope, check your mysql startup script at /etc/rc.d/init.d location this just a shell script
 
Old 09-17-2009, 07:09 AM   #5
karll
LQ Newbie
 
Registered: Sep 2009
Location: United Kingdom
Distribution: RHEL, Fedora, FreeBSD
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kirukan View Post
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!
 
  


Reply

Tags
mycnf, mysql



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing my.cnf after installing mysql 5.1.35 jdnow09 Linux - General 3 06-18-2009 11:10 PM
change to config file MySQL my.cnf does not take nephish Linux - Server 2 09-27-2008 11:46 AM
MySQL startup process and my.cnf lord-fu *BSD 4 07-11-2007 07:44 AM
how to config the mysql my.cnf? treotan Linux - General 1 09-14-2005 11:05 AM
MySQL server & my.cnf hct224 Linux - Newbie 0 04-02-2004 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration