HostingDatabaseAdd

This function can be used to assign a database to a customer’s web hosting subscription. The return value is the ID of the new data record. If an identical database already exists in the subscription, its ID is returned.

The database is only created if the create parameter is set to 1 - in this case the password field is mandatory. If create=0 (default), the database is only included in LiveConfig, but not created on the database server - this is required if the database accounts are / were created otherwise.

The password (if specified) can be up to 40 characters long. As an exception, a 41-character, pre-hashed MySQL password (starting with “*”) can be passed. If the password is exactly 22 characters long and begins with MYSQL:, this is interpreted as a MySQL 4.x password hash and is also adopted unchanged.

Request

Field

Type

RegExp

Null?

Description

auth

AuthData

no

Authentication data

subscription

string

^[a-z][a-z0-9_-]{1,63}$

no

Subscription name

name

string

^[\w_-]{1,64}$

no

Database name

login

string

^[\w_-]{1,16}$

no

Database login

comment

string

^.{0,255}$

yes

Description (optional)

extern

integer

^[012]$

yes

External database access allowed? (0 = no (default), 1 = yes, 2 = only with SSL)

create

integer

^[01]$

yes

Create database? (0 = no (default), 1 = yes)

password

string

^.{0,41}$

yes

Password (mandatory when create=1)

Response

Field

Type

Null?

Description

id

string

no

Data record ID

The data record ID is customer-specific encrypted.


Last updated on Apr 30, 2020.
next: HostingDatabaseDelete
previous: HostingDCVDelete