mysql 1594_MySQL-Last_Errno: 1594

故障现象  :MySQL slave所在机器自动重启,启动MySQL后,查看主从信息如下:

Error_code: 1594

copycode.gifmysql> show slave status \G*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 172.21.101.10

Master_User: repl

Master_Port: 3307

Connect_Retry: 60

Master_Log_File: mysql-bin.039177

Read_Master_Log_Pos: 116425042

Relay_Log_File: relay-bin.002356

Relay_Log_Pos: 86299739

Relay_Master_Log_File: mysql-bin.039175

Slave_IO_Running: Yes

Slave_SQL_Running: No

Replicate_Do_DB:

Replicate_Ignore_DB: mysql.%,information_schema.%

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 1594

Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.

Skip_Counter: 0

Exec_Master_Log_Pos: 86299576

Relay_Log_Space: 384592256

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: NULLMaster_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 1594

Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.

Replicate_Ignore_Server_Ids:

Master_Server_Id: 1380

Master_UUID: 5a25a829-f343-11e4-89f3-984be105150c

Master_Info_File: /mysqlData/up24/data/master.info

SQL_Delay: 0

SQL_Remaining_Delay: NULL

Slave_SQL_Running_State:

Master_Retry_Count: 86400

Master_Bind:

Last_IO_Error_Timestamp:

Last_SQL_Error_Timestamp: 170328 07:45:56

Master_SSL_Crl:

Master_SSL_Crlpath:

Retrieved_Gtid_Set:

Executed_Gtid_Set:

Auto_Position: 0

copycode.gif

查看Error log :

2017-03-28 07:29:24 30851 [Note] Slave I/O thread: connected to master 'repl@172.21.101.10:3307',replication started in log 'mysql-bin.039175' at position 87578145

2017-03-28 07:29:24 30851 [Warning] Slave SQL: If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0

2017-03-28 07:29:24 30851 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.039175' at position 45009340, relay log './relay-bin.002356' position: 45009503

2017-03-28 07:29:47 30851 [ERROR] Error in Log_event::read_log_event(): 'read error', data_len: 8174, event_type: 32

2017-03-28 07:29:47 30851 [ERROR] Error reading relay log event: slave SQL thread aborted because of I/O error

2017-03-28 07:29:47 30851 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594

2017-03-28 07:29:47 30851 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.039175' position 86299576

解决方法:

根据errorlog的提示,重新设置主从

stop slave ;

change master to master_host='172.21.101.10',master_port=3307,master_user='repl',master_password='repl',master_log_file='mysql-bin.039175', master_log_pos=86299576;

start slave;

show slave status\G 查看状态:恢复正常

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: last_io_errno: 1236是指在最后一次输入/输出操作中出现了错误代码1236。 错误代码1236代表数据库服务器连接超时。这意味着数据库服务器在规定的时间内未响应客户端的请求,可能因为网络问题或服务器负载过高。 当客户端与数据库服务器建立连接后,它会发送查询请求或执行其他操作。服务器必须在一定的时间内响应这些请求。如果服务器在规定时间内未能响应请求,就会发生超时错误。 造成连接超时的原因有很多,如网络延迟、服务器资源不足、数据库负载过高等。解决超时错误的方法包括: 1. 检查网络连接和服务器状况:确保网络连接稳定,并检查服务器的负载和可用资源是否充足,确保数据库服务器能够正常运行。 2. 调整连接超时时间:根据实际情况,适当延长连接超时时间,以便服务器有足够的时间来响应请求。这可以在数据库连接参数中进行相关设置。 3. 优化数据库查询:通过优化查询语句、创建索引和适当调整数据库设计等方式,提高数据库的查询性能,减少响应时间。 4. 分散负载:如果数据库服务器负载过高,可以考虑分散负载到多个服务器上,以提高整体性能。 5. 更新数据库和服务器软件版本:确保数据库和服务器软件版本是最新的,因为软件更新通常会修复一些性能和稳定性问题。 总之,last_io_errno: 1236是连接超时错误的错误代码,通过检查网络连接、服务器负载情况和优化数据库查询等措施,可以解决这个问题。 ### 回答2: last_io_errno: 1236 是MySQL数据库的一个错误代码。该错误代码表示与主从复制相关的问题,具体是指主从数据库之间的连接出现错误。 在MySQL主从复制中,主数据库负责处理所有的写操作,并将这些写操作的日志记录发送到从数据库进行执行,以保持主从数据库的数据一致性。当从数据库无法连接到主数据库时,就会出现last_io_errno: 1236 错误。 造成last_io_errno: 1236 错误的原因可能有多种,其中包括网络问题、主数据库宕机或者设置的错误等。 解决这个错误的方法可以包括以下几步: 1. 检查网络连接是否正常,确保主数据库和从数据库之间的通信没有问题。 2. 检查主数据库是否正常运行,确保它没有宕机或者出现其他故障。 3. 检查MySQL主从复制的设置是否正确,包括主数据库的binlog配置和从数据库的replication配置是否正确。 4. 尝试重新启动从数据库,以确保它能够重新连接主数据库并进行同步。 如果上述方法无法解决问题,可能需要进一步排查错误的具体原因并根据具体情况采取不同的解决方法。可以通过查看MySQL的错误日志或者运行相应的诊断命令来获取更多的错误信息,以便进行进一步的故障排除。 ### 回答3: last_io_errno: 1236是指最近一次I/O(输入/输出)操作发生的错误代码是1236。 错误代码1236是MySQL数据库中的一个错误代码,表示一个问题出现在处理复制操作时。具体来说,它指示从服务器无法连接到主服务器来获取或处理复制日志事件。 这个错误可能发生在主从复制设置中,当从服务器无法与主服务器建立连接时。可能的原因包括网络问题、访问权限问题或主服务器宕机等。如果无法建立连接,从服务器将无法获取主服务器上的更新日志,并无法进行数据复制。 为了解决这个问题,可以通过以下几个步骤来进行排查: 1. 确保网络连接正常:检查网络连接是否稳定,并确保从服务器能够与主服务器进行通信。 2. 检查访问权限:确保从服务器具有足够的权限来连接和复制主服务器上的数据。检查相关的用户权限和授权设置。 3. 检查主服务器状态:验证主服务器是否处于运行状态,确保没有出现宕机或其他故障。 4. 检查错误日志:查看MySQL错误日志文件,了解更多关于错误的详细信息。错误日志通常位于MySQL安装目录的日志文件夹中。 5. 重新启动从服务器:有时,重新启动从服务器可以解决临时的连接问题。 如果以上步骤都无法解决问题,可以考虑联系数据库管理员或MySQL技术支持人员,以获取更进一步的帮助和支持。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值