现在的位置: 首页数据库应用>正文
mysql主从复制错误Got a packet bigger than ‘max_allowed_packet’ bytes
发表于7年前 数据库应用 暂无评论 ⁄ 被围观 1,117 次+

今天凌晨收到 Nagios发来的 mysql slave 报警,于是登录到 mysql slave(从服务器),看查看:

mysql> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.10.20
                  Master_User: slave_user
                  Master_Port: 3306
                  Connect_Retry: 60
                  Master_Log_File: mysql-bin.000285
                  Read_Master_Log_Pos: 34641799
                  Relay_Log_File: server121-relay-bin.000773
                  Relay_Log_Pos: 34641916
                  Relay_Master_Log_File: mysql-bin.000285
                  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: 34641771
                 Relay_Log_Space: 34642146
                 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: 1153
                Last_IO_Error: Got a packet bigger than 'max_allowed_packet' bytes
                Last_SQL_Errno: 0
                Last_SQL_Error:
1 row in set (0.00 sec)

ERROR:
No query specified
 

根据错误提示"Got a packet bigger than 'max_allowed_packet' bytes",将 slave的 max_allowed_packet值改成和 master的值一样,然后重启 mysql,搞定

给我留言

留言无头像?