All pages
Powered by GitBook
1 of 1

Loading...

COM_CHANGE_USER

This command allows a connected client to re-authenticate as a different user without closing and reopening the connection.

COM_CHANGE_USER resets the connection and re-authenticates with the given credentials. The packet is identical to the authentication packet in the connection handshake.

Fields

  • int<1> 0x11 : COM_CHANGE_USER header.

  • username.

  • If (server_capabilities & CLIENT_SECURE_CONNECTION):

    • length of authentication response.

    • string authentication response.

  • Else:

    • authentication response.

  • default schema name.

  • client character collation.

  • If (server_capabilities & CLIENT_PLUGIN_AUTH):

    • authentication plugin name.

  • If (server_capabilities & CLIENT_CONNECT_ATTRS):

    • size of connection attributes.

    • Loop:

Response

Server response is like :

  • An OK packet in case of success .

  • An error packet in case of error .

  • Authentication switch:

    • If the client or server doesn't have PLUGIN_AUTH

If the authentication fails more than three times, all future COM_CHANGE_USER commands on the connection will return the #08S01 Unknown command error. This is an anti-brute-force mechanism designed to prevent rapid guessing of passwords.

This page is licensed: CC BY-SA / Gnu FDL

string key.
  • string value.

  • capability:
    • Server sends 0xFE byte.

    • Client sends old_password.

  • Else:

    • Server sends Authentication switch request.

    • Client may have many exchanges with the server according to the Plugin.

  • Authentication switch ends with server sending either OK_Packet or ERR_Packet.

  • string
    int<1>
    string
    string
    int<2>
    string
    int
    connection authentication
    OK_Packet
    ERR_Packet