Grant Replication Slave on * * to [e-mail protected] ' IP ' identified by ' xxx ';
Flush privileges;
Change Master to master_host= ' 192.168.1.103 ', master_port=3306,master_user= ' repl ', master_password= ' ffffff ', master_ Auto_position=1;
Start slave;
Show Slave Status\g
MY.CNF file
# for advice The change settings
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[Client]
Port = 3306
Socket =/tmp/mysqld1.sock
[Mysqld]
# Remove Leading # and set to the amount of RAM for the most important data
# Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove Leading # to turn on a very important data integrity option:logging
# Changes to the binary log between backups.
# Log_bin
# These is commonly set, remove the # and set as required.
Basedir =/USR/LOCAL/MYSQL1
DataDir =/DATA/MYSQL1
Port = 3306
Socket =/tmp/mysqld1.sock
Server-id = 1
#binlog
Log-bin =/data/mysql1/logs/mysql1-bin
Binlog_format = row
Binlog-row-image = Minimal
Binlog_cache_size = 512K
Max_binlog_size = 100M
Gtid-mode=on
Enforce-gtid-consistency=true
Log-slave-updates=true
Slave_parallel_workers = 2
Sync_binlog = 1
#relay Log
Relay-log =/data/mysql1/logs/relay1-log
Max_relay_log_size = 100M
#check Binlog
Binlog_checksum = CRC32
slave_allow_batching = 1
Master_verify_checksum = 1
Slave_sql_verify_checksum = 1
Binlog_rows_query_log_events = 1
Master-info-repository=table
Relay-log-info-repository=table
Sync-master-info=1
Binlog-ignore-db=mysql
Binlog-ignore-db=information_schema
Binlog-ignore-db=performance_schema
Replicate-ignore-db=mysql
Replicate-ignore-db=information_schema
Replicate-ignore-db=performance_schema
auto-increment-increment=10
Auto-increment-offset=1
# Remove Leading # To set options mainly useful for reporting servers.
# The server defaults is faster for transactions and fast selects.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
MySQL 5.6 gtid Copy