Mysql database server Adjustment
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