叶金荣(yejr)早年曾混迹于linuxforum、linuxsir、chinaunix等社区。
2006年建本站至今,是国内最早的一批MySQL技术博客之一。
从事过LAMP开发,后成为专职MySQL DBA,擅长MySQL优化、数据库架构设计及对比基准压测。
2012年被提名成为ORACLE MySQL ACE。
2015年创办靠谱、优质的在线培训品牌知数堂专注培养优秀互联网从业人才以及企业服务。
2018年发起「3306π」社区
微信公众号:老叶茶馆(imysql_wx)
微博:@叶金荣
QQ群: 579036588
邮箱:yejr@qq.com
神器: 自动生成my.cnf
搜索引擎中的我:谷歌Google、360搜索、百度、搜狗。
买茶找我: 自家茶叶店
【老叶茶馆】微信公众号二维码
M/S的主从复制,现在的问题是,执行查询SQL后,数据库报:ERROR 2013 (HY000): Lost connection to MySQL server during query的错误
此时查看从库的状态: show slave status\G;
Slave_IO_Running: No Slave_SQL_Running: Yes
请问这是什么原因?该如何解决?
游客 (未验证)
周二, 2010/04/06 - 17:48
Permalink
看看错误日志中有什么 有可能是复制账号权限的问题
itppl
周三, 2010/04/07 - 08:54
应该不是复制帐号的权限问题,复制帐号rep的权限现在已经给到了除了Grant之外的所有,以下是从库数据库的错误日志,我截取了一部分,请各位帮忙看一下 顺便说一句,为了排除网络或者防火墙的原因,主从机器上的防火墙全部关掉了,网络也正常 ********************************************** 100406 15:26:24 [Note] Slave I/O thread killed during or after a reconnect done to recover from failed read 100406 15:26:24 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000114', position 240457997 100406 15:26:24 [Note] Error reading relay log event: slave SQL thread was killed 100406 15:26:38 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000115' at position 106, relay log './13 test-server1-relay-bin.000001' position: 4 100406 15:26:38 [Note] Slave I/O thread: connected to master 'rep@192.168.160.144:3306',replication started in log 'mysql-bin.000115 ' at position 106 100406 15:52:24 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013) 100406 15:52:24 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000115' at postion 23512696 7 100406 15:52:24 [ERROR] Slave I/O: error reconnecting to master 'rep@192.168.160.144:3306' - retry-time: 60 retries: 86400, Error_c ode: 2013 100406 15:53:24 [Note] Slave: connected to master 'rep@192.168.160.144:3306',replication resumed in log 'mysql-bin.000115' at positi on 235126967 100406 15:53:25 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013) 100406 15:53:25 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000116' at postion 106 100406 15:53:25 [ERROR] Slave I/O: error reconnecting to master 'rep@192.168.160.144:3306' - retry-time: 60 retries: 86400, Error_c ode: 2013 100406 15:54:23 [Note] Slave I/O thread killed during or after a reconnect done to recover from failed read 100406 15:54:23 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000116', position 106 100406 15:54:23 [Note] Error reading relay log event: slave SQL thread was killed 100406 15:54:32 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000120' at position 106, relay log './13 test-server1-relay-bin.000001' position: 4 100406 15:54:32 [Note] Slave I/O thread: connected to master 'rep@192.168.160.144:3306',replication started in log 'mysql-bin.000120 ' at position 106 100406 15:55:23 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013) 100406 15:55:23 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000120' at postion 298 100406 15:55:23 [ERROR] Slave I/O: error reconnecting to master 'rep@192.168.160.144:3306' - retry-time: 60 retries: 86400, Error_c ode: 2013 100406 15:56:23 [Note] Slave: connected to master 'rep@192.168.160.144:3306',replication resumed in log 'mysql-bin.000120' at positi on 298 100406 15:56:33 [Note] Slave I/O thread killed while reading event 100406 15:56:33 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000122', position 297 100406 15:56:33 [Note] Error reading relay log event: slave SQL thread was killed
yejr
周三, 2010/04/07 - 10:50
看起来像网络连接问题,可以考虑把相关几个timeout值加大点
鸡鸡哥
周三, 2011/04/13 - 16:10
我回头验证一下再来说,timeout值
xndd
周二, 2011/04/19 - 10:04
mysql无法连接的一种特殊情况
遇到一个mysql无法连接的情况:
windows2003服务器, 客户端
两台计算机互ping正常,客户端telnet 服务器的mysql端口正常 mysql帐号密码没有错误 客户端使用代码就是连接不上服务器,用mysql.exe都不行
发现另一台客户端可以连接,mysql.exe也可以,
发现是客户端启用了workstation服务(windows默认启动,但是服务器因为安全原因屏蔽了) 现在是两台服务器互访(web 服务器访问 db服务器),结果两台服务器的workstation服务都必须关闭,就造成无法访问的情况
说了这么多不知道大家明白了没有T_T (哭了) 求助各位大大管理员同志救命!!!!!
周三, 2010/04/07 - 23:15
是不是有掉包啊,怎么感觉网络很差的说
游客 (未验证)
周二, 2010/04/06 - 17:48
Permalink
看看错误日志中有什
看看错误日志中有什么
有可能是复制账号权限的问题
itppl
周三, 2010/04/07 - 08:54
Permalink
应该不是复制帐号的
应该不是复制帐号的权限问题,复制帐号rep的权限现在已经给到了除了Grant之外的所有,以下是从库数据库的错误日志,我截取了一部分,请各位帮忙看一下
顺便说一句,为了排除网络或者防火墙的原因,主从机器上的防火墙全部关掉了,网络也正常
**********************************************
100406 15:26:24 [Note] Slave I/O thread killed during or after a reconnect done to recover from failed read
100406 15:26:24 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000114', position 240457997
100406 15:26:24 [Note] Error reading relay log event: slave SQL thread was killed
100406 15:26:38 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000115' at position 106, relay log './13
test-server1-relay-bin.000001' position: 4
100406 15:26:38 [Note] Slave I/O thread: connected to master 'rep@192.168.160.144:3306',replication started in log 'mysql-bin.000115
' at position 106
100406 15:52:24 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
100406 15:52:24 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000115' at postion 23512696
7
100406 15:52:24 [ERROR] Slave I/O: error reconnecting to master 'rep@192.168.160.144:3306' - retry-time: 60 retries: 86400, Error_c
ode: 2013
100406 15:53:24 [Note] Slave: connected to master 'rep@192.168.160.144:3306',replication resumed in log 'mysql-bin.000115' at positi
on 235126967
100406 15:53:25 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
100406 15:53:25 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000116' at postion 106
100406 15:53:25 [ERROR] Slave I/O: error reconnecting to master 'rep@192.168.160.144:3306' - retry-time: 60 retries: 86400, Error_c
ode: 2013
100406 15:54:23 [Note] Slave I/O thread killed during or after a reconnect done to recover from failed read
100406 15:54:23 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000116', position 106
100406 15:54:23 [Note] Error reading relay log event: slave SQL thread was killed
100406 15:54:32 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000120' at position 106, relay log './13
test-server1-relay-bin.000001' position: 4
100406 15:54:32 [Note] Slave I/O thread: connected to master 'rep@192.168.160.144:3306',replication started in log 'mysql-bin.000120
' at position 106
100406 15:55:23 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
100406 15:55:23 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000120' at postion 298
100406 15:55:23 [ERROR] Slave I/O: error reconnecting to master 'rep@192.168.160.144:3306' - retry-time: 60 retries: 86400, Error_c
ode: 2013
100406 15:56:23 [Note] Slave: connected to master 'rep@192.168.160.144:3306',replication resumed in log 'mysql-bin.000120' at positi
on 298
100406 15:56:33 [Note] Slave I/O thread killed while reading event
100406 15:56:33 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000122', position 297
100406 15:56:33 [Note] Error reading relay log event: slave SQL thread was killed
yejr
周三, 2010/04/07 - 10:50
Permalink
看起来像网络连接问
看起来像网络连接问题,可以考虑把相关几个timeout值加大点
鸡鸡哥
周三, 2011/04/13 - 16:10
Permalink
我回头验证一下再来
我回头验证一下再来说,timeout值
xndd
周二, 2011/04/19 - 10:04
Permalink
mysql无法连接的一种特
mysql无法连接的一种特殊情况
遇到一个mysql无法连接的情况:
windows2003服务器, 客户端
两台计算机互ping正常,客户端telnet 服务器的mysql端口正常
mysql帐号密码没有错误
客户端使用代码就是连接不上服务器,用mysql.exe都不行
发现另一台客户端可以连接,mysql.exe也可以,
发现是客户端启用了workstation服务(windows默认启动,但是服务器因为安全原因屏蔽了)
现在是两台服务器互访(web 服务器访问 db服务器),结果两台服务器的workstation服务都必须关闭,就造成无法访问的情况
说了这么多不知道大家明白了没有T_T (哭了) 求助各位大大管理员同志救命!!!!!
游客 (未验证)
周三, 2010/04/07 - 23:15
Permalink
是不是有掉包啊,怎么
是不是有掉包啊,怎么感觉网络很差的说