Controller: MysqlDb

API Controller /siteworx/mysql/db
Required Permissions ["MYSQL"]
Required Options MySQL Databases
Action Description
add Add a mysql database.
delete Delete a mysql database.
list List MySQL databases. DEPRECATED in version 4.8.0-393
listMysqlDatabases List MySQL Databases.
listMysqlHost List the mysql host for this account (localhost, 22.33.44.55, etc).

Action: add

Add a mysql database.

Input Parameters

Name Type Notes Required?
name string Yes
create_user integer
Example Values
1
No
user string No
password string No
confirm_password string
Help Entry
Confirm the password field by providing it again. Must match the password provided.
No
perms struct (string)
Example Values
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE
Example Default Value
["SELECT","INSERT","UPDATE","DELETE","CREATE","DROP","REFERENCES","INDEX","ALTER","CREATE TEMPORARY TABLES","LOCK TABLES","CREATE VIEW","SHOW VIEW","CREATE ROUTINE","ALTER ROUTINE","EXECUTE"]
No
host string
Example Default Value
%
No

Action: delete

Delete a mysql database.

Input Parameters

Name Type Notes Required?
name struct (string)
Example Values
mydb
Yes
confirm_action struct (integer)
Example Values
1
No*
* indicates that it's actually required, but probably already has a valid default value

Action: list

This action has been deprecated as of version 4.8.0-393.

MESSAGE: 2010-12-03 use listDatabases

List MySQL databases.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    0 => 
    array (
      0 => 'mydb',
      1 => 'example_mydb',
    ),
  ),
)

Action: listMysqlDatabases (Added in version 4.8.0-393)

List MySQL Databases.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    0 => 
    array (
      'name' => 'mydb',
      'fqdn' => 'example_mydb',
      'host' => '208.69.122.234',
      'storage' => '0 KB',
    ),
  ),
)

Action: listMysqlHost

List the mysql host for this account (localhost, 22.33.44.55, etc).

Example Output

array (
  'status' => 0,
  'payload' => '208.69.122.234',
)