Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup MySQL db replication, it seems pretty straight forward.

I was using this tutorial:

Now I run a rather large MySQL database for a very large website, and in this tutorial it asks me to restart MySQL to apply the new settings in the /etc/my.cnf file.

I'm try to avoid that step at all costs, as I know that restarting MySQL can take a few minutes on my machine (due to large logs/dbs), and I don't want any downtime.

Is there a way to apply the necessary settings WITHOUT fully restarting Mysql?

share|improve this question
up vote 1 down vote accepted

Lots of settings in my.cnf can be applied from within MySQL with SET GLOBAL. For instance:

mysql> SET GLOBAL log_slow_queries = On;

But some are read-only from within MySQL; log-bin is one of these.

mysql> set global log_bin = foo;
ERROR 1238 (HY000): Variable 'log_bin' is a read only variable
share|improve this answer

You need to add new DB to existing DB or merge two existing DB servers? If you need to add new one, check that your server collecting binlogs on production server by command "show master status". You will need to set server ID on new server (it must be not 1, because 1 is default server ID and it used on your "old" server). Also check that your "old" server listen on real interfaces. If "old" server used only, you will need to restart it, because you can't change listen and ID params on running server without restart. All other replication params may be changed by "set global" command, but I strongly recommended to set it both in my.cnf to avoid problems when old server restarted.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.