The following describes how to modify a parameter variable without restarting mysql.
In general, updating mysql configuration my. cnf requires restarting mysql to take effect, but sometimes mysql is online and may not be allowed to be restarted. what should I do at this time?
Example:
Mysql> show variables like 'log _ slave_updates ';
+ ----------------- + ------- +
| Variable_name | Value |
+ ----------------- + ------- +
| Log_slave_updates | OFF |
+ ----------------- + ------- +
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! Www.jbxue.com
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:
Mysql> system gdb-p $ (pidof mysqld)-ex "set opt_log_slave_updates = 1"-batch
Mysql> show variables like 'log _ slave_updates ';
+ ----------------- + ------- +
| Variable_name | Value |
+ ----------------- + ------- +
| Log_slave_updates | ON |
+ ----------------- + ------- +
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:
Mysql> show slave status/G
...
Replicate_Do_DB: test
...
Mysql> system gdb-p $ (pidof mysqld)
-Ex 'Call rpl_filter-> add_do_db (strdup ("hehehe") '-batch
Mysql> show slave status/G
...
Replicate_Do_DB: test, hehehehe
...