Mysql database server adjustment, mysql Database Server

Source: Internet
Author: User

Mysql database server adjustment, mysql Database Server

Make a database server adjustment to the customer the day before yesterday, discard the previous host, promote the master from the database, and then add the new slave. Here, record the operation steps:

1. Enable read-only for the old master database so that the database can be rolled back after a problem occurs: flush tables with read lock

2. Upgrade 110.1.102 to the master database, pause synchronization, reset master, clear relay information, and restart the database.

Stop slave, reset master, mv master.info relay. log/tmp

Modify the configuration file my. cnf and add expire_logs_days = 15 and innodb_file_per_table

3. Enable read-only for the new master database: flush tables with read lock

Export logical backup: mysqldump-u root-p -- single-transaction-R -- flush-logs -- master-data = 1-databases db1 db2 db3> database1204. SQL

4. show master status, import data to the new slave database, and change master

5. view the status information of all slave databases, show slave status, and unlock the tables of the master database.

Note that mysql5.5 does not support masterhost and other parameters in/etc/my. cnf, and must be connected to mysql to execute change master

Related Article

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.