Here's what I did. On the master, change /etc/my.cnf
:
[mysqld]
server-id=1
log-bin=mysql-bin
innodb_flush_log_at_trx_commit=1
sync_binlog=1
Save and restart mysql, then log in.
>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%' IDENTIFIED BY '123';
Mysql> flush table with read lock;// Start copy data master (myisam) chuyển sang slave .
Mysql> show master status;
On the slave, change /etc/my.cnf
.
[mysqld]
server-id=2
log-bin=mysql-bin
innodb_flush_log_at_trx_commit=1
sync_binlog=1
Save and restart mysql. Create a database on the slave (Snapshop master). Move data from master to slave.
Mysql> stop slave;
Mysql>CHANGE MASTER TO
MASTER_HOST='server2',
MASTER_USER='repl',
MASTER_PASSWORD='password',
MASTER_LOG_FILE='xxxx',
MASTER_LOG_POS=xxx;
On the master:
Mysql> unlock tables;
On the slave:
Mysql> start slave;
Mysql> show slave status /G
My problem is: I forget answer command belows.
Mysql> show master status;
when I start the slave. The error is
236 | Got fatal error 1236 from mast er when reading data from binary log: 'Could not find first log file name in binary log index file' |
What does the error mean, and how can I solve it?