Mysql – Setting up MySQL database replication [without restarting thesql]

databaseMySQLmysql-replication

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

I was using this tutorial: http://www.howtoforge.com/mysql_database_replication

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?

Best Answer

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
Related Topic