Mysql does not restart to modify the parameter variable _ MySQL

Source: Internet
Author: User
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
...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.