https://github.com/sea-boat/mysql-protocol
The mysql client can use the ping command to check the status of the server. Normally, an ok packet will be returned.
Type | Name | Description |
---|---|---|
int<3> | payload length | Stored according to the least significant byte first, 3-byte payload and 1-byte sequence number combination Into the message header |
int<1> | sequence number | |
payload | Message body, the length is the previously specified payload length |
Payload
1 [0e] COM_PING
/** * * @author seaboat * @date 2016-09-25 * @version 1.0 * <pre class="brush:php;toolbar:false"><b>email: </b>849586227@qq.com*
<b>blog: </b>//m.sbmmt.com/;/pre> * <p>ping command packet.</p> */public class PingPacket extends MySQLPacket { // payload length is 1,packet id is 0,payload is 0e public static final byte[] PING = new byte[] { 1, 0, 0, 0, 14 }; @Override public int calcPacketSize() { return 1; } @Override protected String getPacketInfo() { return "MySQL Ping Packet"; } }