This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-13. For the latest, interactive version please visit https://mariadb.com/kb/.

COM_CHANGE_USER

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
  • string<NUL> username
  • if (server_capabilities & CLIENT_SECURE_CONNECTION)
    • int<1> length of authentication response
    • string authentication response
  • else
  • string<NUL> default schema name
  • int<2> client character collation
  • if (server_capabilities & CLIENT_PLUGIN_AUTH)
  • if (server_capabilities & CLIENT_CONNECT_ATTRS)

Response

Server response is like connection authentication :

  • An OK packet in case of success OK_Packet.
  • An error packet in case of error ERR_Packet.
  • Authentication switch
    • If the client or server doesn't have PLUGIN_AUTH capability:
      • Server sends 0xFE byte .
      • Client sends old_password.
    • else
    • Authentication switch ends with server sending either OK_Packet or ERR_Packet.
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.