mysql Master和Slave不同步。
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.2.92
Master_User: rep
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: binlog.000002
Read_Master_Log_Pos: 248
Relay_Log_File: Slave-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: binlog.000002
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 248
Relay_Log_Space: 107
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
下面是Master my.cnf:
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /opt/data/mysql/data
character-set-server = utf8
skip-external-locking
log-slow-queries = /opt/data/mysql/slow_logs
long_query_time = 5
log-queries-not-using-indexes
expire_logs_days=7
key_buffer_size = 16M
max_allowed_packet = 10M
max_connections = 1000
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=/opt/data/mysql/bin_log/mysql-bin
binlog_format=mixed
server-id = 1
innodb_file_per_table=1
[mysqldump]
quick
max_allowed_packet = 100M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
下面是Slave my.cnf:
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /opt/data/mysql/data
character-set-server = utf8
skip-external-locking
log-slow-queries = /opt/data/mysql/slow_logs
long_query_time = 5
log-queries-not-using-indexes
expire_logs_days=7
key_buffer_size = 16M
max_allowed_packet = 10M
max_connections = 1000
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=/opt/data/mysql/bin_log/mysql-bin
binlog_format=mixed
server-id = 3
innodb_file_per_table=1
[mysqldump]
quick
max_allowed_packet = 100M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
主人:
显示主人身份\ G; 授予复制奴隶在。到'beifen'@'%'由'123'标识;
On Slave:
将master更改为master_host ='192.168.2.92',master_user ='beifen',master_password ='123',master_log_file ='binlog.000008',master_log_pos = 107; 启动奴隶;
但是:显示奴隶状态\ G; 从二进制日志读取数据时,来自master的致命错误1236:'无法在二进制日志索引文件中找到第一个日志文件名'
我尝试重置slave,刷新slave上的日志,但问题仍然存在。 如何解决它?