LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-16-2006, 12:57 AM   #1
Chowroc
Member
 
Registered: Dec 2004
Posts: 145

Rep: Reputation: 15
How to reload /etc/my.cnf without restart mysqld?


Is there any way that I can reload /etc/my.cnf without restart mysqld:
# mysqladmin -u root -p shutdown
# mysqld_safe &

I mean can I reload my.cnf in mysql client
mysql>
?

Or is there any other tools. I haven't found such command of mysqldadmin to do this.

Because the database is busy and there is always some programs insert datas to it.

Thanks.
 
Old 01-16-2006, 02:19 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
It's probably a bad idea to reconfigure the sql daemon while the database is busy. All the same you could try this at the bash command line, not in the sql command prompt.

kill -HUP <pid>

Last edited by stress_junkie; 01-16-2006 at 02:20 AM.
 
1 members found this post helpful.
Old 01-16-2006, 02:40 AM   #3
scott_R
Member
 
Registered: Jul 2003
Location: Brighton, Michigan, USA
Distribution: Lots of distros in the past, now Linux Mint
Posts: 748

Rep: Reputation: 31
You can, as far as reloading from the "mysql>" prompt, use the "system" command, as in:

system su -c '/etc/rc5.d/S20mysql restart'

A better solution, especially for a heavily used system, is to reexamine your configuration, and make improvements. One thing I'd suggest is making sure you have a second server, and set them up for replication. This will allow you to take one machine "offline" for a while, make your changes, then sync with the second server when you're finished. Using virtual machines (such as Xen), you don't even need to add hardware, if that's an issue.

This has numerous benefits. For one thing, you'll have a backup system, if needed. Second, you'll be able to perform backups more efficiently, without losing data or missing transactions, while retaining good end user speeds. Third, especially in your current situation, if there is a problem when you go to restart, you don't end up completely out of luck, having to scramble to undo your changes. Finally, it offers you a second system to test new ideas and software, without major downtime and related headaches.

If your information is that heavily used and important, it's something I'd seriously look into. More info on mysql replication is here:

http://www.onlamp.com/pub/a/onlamp/2.../MySQLian.html

and Xen info is here:

http://www.cl.cam.ac.uk/Research/SRG/netos/xen/

Hope it helps!
 
Old 01-16-2006, 10:13 AM   #4
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Quote:
Originally Posted by stress_junkie
It's probably a bad idea to reconfigure the sql daemon while the database is busy.
Actually he should be fine as the kill -HUP is designed to allow existing threads to complete before the process is killed.
 
Old 01-16-2006, 11:52 AM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I'm glad to hear that my suggestion was better than I had thought. I knew it was good for various daemon processes but the database server process was a concern to me.
 
  


Reply



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
My.cnf Maxman Linux - General 4 10-28-2005 07:52 AM
my.cnf mnauta Linux - General 2 02-06-2004 11:31 AM
Automating firewall reload on i/f (ppp) restart aelms Linux - Security 0 10-25-2003 02:14 PM
Closing mysqld Port via my.cnf dai Linux - Security 4 07-30-2003 02:02 PM
my.cnf doodah Linux - General 2 05-31-2001 09:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:35 AM.

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