The default database user is used by Plesk for accessing a database if no other user is specified. The default database user, like any other database user, can manage the database either in the database management tool (such as phpMyAdmin) or by connecting directly to the database server. You can set any database user account as default. If you create a database, the first user created in the database will be the default database user.
Request Packet Structure
A request XML packet assigning a default database user includes the set-default-user operation node:
The set-default-user node is presented by type DatabaseSetDBInputType (
database_input.xsd), and its graphical representation is as follows:
- The db-id node is required. Specifies the database that will be accessed by the default database user. Data type: integer.
- The default-user-id node is optional. Specifying the default database user for managing a database. Data type: integer.
You can set default users for multiple databases by using a single packet. Add as many set-default-user operations as the number of database default user's accounts you want to set.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The set-default-user node of the output XML packet is presented by type DatabaseSetDBOutputType (
database_output.xsd) and structured as follows:
- The result node is required. It wraps the response retrieved from the server. Data type: resultType (
- The status node is required. It specifies the execution status of the set-default-user operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. Is returns the error code if the set-default-user operation fails. Data type: integer.
- The errtext node is optional. It returns the error message if the set-default-user operation fails. Data type: string.
Assigning a Default Database User
This request packet sets the user with ID 35 as default for the database with ID 132.
The negative response from the server looks as one of the follows:
- The database with ID=132 was not found on the server.
The user with ID=35 was not found in the database with ID=132.