The add operation is used to add a database server of the specified type to Plesk. Before adding the database server, make sure the database server type is supported by Plesk. For more information, refer to the Managing Database Server section.
A request XML packet adding a database server includes the add operation node:
<packet>
<db_server>
<add>
...
</add>
</db_server>
</packet>
The add node is presented by type DatabaseServerAddParam (plesk_db.xsd
), and its graphical representation is as follows:
Remarks
You can add multiple database servers in a single packet. Add as many add operations as the number of database servers you want to add.
<db_server>
<add>
...
</add>
...
<add>
...
</add>
</db_server>
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The add node of the output XML packet is structured as follows:
database_output.xsd
).This request packet adds the local MySQL database server.
<packet>
<db_server>
<add>
<host>localhost</host>
<port>3306</port>
<type>mysql</type>
<admin>senior</admin>
<password>senior</password>
</add>
</db_server>
</packet>
Response:
<packet>
<db_server>
<add>
<result>
<status>ok</status>
<id>15</id>
</result>
</add>
</db_server>
</packet>
If the type of database server is not supported by Plesk, the response looks as follows:
<packet>
<db_server>
<add>
<result>
<status>error</status>
<errcode>14008</errcode>
<errtext>Wrong database server type</errtext>
</result>
</add>
</db_server>
</packet>
If the local MySQL database server already exists in Plesk, the response looks as follows:
<packet>
<db_server>
<add>
<result>
<status>error</status>
<errcode>1023</errcode>
<errtext>Operation failed</errtext>
</result>
</add>
</db_server>
</packet>