Modify the parameter variable bitsCN.com without restarting mysql.
Everyone on earth knows that updating mysql configuration requires restarting mysql to take effect. However, sometimes mysql is online and may not be allowed to be restarted. what should I do at this time?
Let's look at an example:
12345678910 mysql> show variables like 'log _ slave_updates '; + ------------------- + ------- + | Variable_name | Value | + ------------------- + ------- + | log_slave_updates | OFF | + ------------------- + ------- + 1 row in set (0.00 sec) mysql> set global log_slave_updates = 1; ERROR 1238 (HY000): Variable 'log _ slave_updates 'is a read only variable
See it? An error is reported!
Later, I checked the information and found that there was something called gdb, which was quite cool. I could change mysql parameters online. See the example below:
12345678 mysql> system gdb-p $ (pidof mysqld)-ex "set opt_log_slave_updates = 1"-batchmysql> show variables like 'log _ slave_updates '; + ------------------- + ------- + | Variable_name | Value | + ------------------- + ------- + | log_slave_updates | ON | + ----------------- + ------- + 1 row in set (0.00 sec)
But some repeated parameters cannot be changed directly with set. what should we do at this time? Foreigners gave a solution:
12345678910 mysql> show slave status/G... replicate_Do_DB: test... mysql> system gdb-p $ (pidof mysqld)-ex 'Call rpl_filter-> add_do_db (strdup ("hehehe") '-batchmysql> show slave status/G... replicate_Do_DB: test, hehehehe... bitsCN.com