Log files: binlog, slow query log, query log, error log innodb redo log, transaction log data files: .frm file, .MYD file, .MYI file , .ibd file and ibdata file Replication related files: master.info file, relay log and relay log index, relay_log_info_file configuration file: my.cnf, pid file, socket file1. Shutdown
mysqladmin -uroot -p shutdown
From the library
cd $MYSQL_HOME mysql -uroot -p
Verification parameters show variables like '%read_only%';
The result should be ON (the slave library and disaster recovery should be ON, and the main library should be OFF)"
"Export the entire master library
mysqldump --login-path=root --socket=/var/mysql.sock --default-character-set=UTF8 --single-transaction --events --triggers --routines --all-databases > all_databases.sql
2. Import the slave library
First execute reset master;
then import
mysql -uroot -p --protocol=TCP --port= <all_databases.sql &
Use root to log in and refresh the permission table
flush privileges;"
3. Test the connection
"mysql -udbsync -pPaic1234 -h10.31.224.103 --protocol=TCP --port=3938 10.31.9.241为主机物理IP"
"
change master to master_host='...', master_user='****', master_password='****', master_port=38, master_auto_position = 1;"
4 ."show slave status\G
Look at the following 2 lines
Slave_IO_Running: Yes Slave_SQL_Running: Yes"
The above is the detailed content of Introduction to master-slave configuration in mysql server. For more information, please follow other related articles on the PHP Chinese website!