MySQL administration functions

getList

Description:

The method returns a list of MySQL databases with their accesses.

Call example:
https://api.beget.com/api/mysql/getList?login=userlogin&passwd=password&output_format=json
Response example:
[
   {
      "name":"user_mydb",
      "size":"1",
      "accesses":[
         {
            "name":"localhost"
         }
      ]
   },
   {
      "name":"user_wp",
      "size":"44",
      "accesses":[
         {
            "name":"localhost"
         },
         {
            "name":"192.168.1.5"
         }
      ]
   }
]

addDb

Description:

The method adds a job to the queue for creating a new MySql database with the specified suffix and creates access for localhost with the specified password. The database creation process can take several minutes.

Additional parameters
  • suffix - the suffix part of the database name. When passing this parameter, keep in mind that the final login of the form "login_suffix" should be no longer than 16 characters;
  • password - password for the new database. It must contain at least 6 characters.
Call example:
// input_data is not encoded for clarity
https://api.beget.com/api/mysql/addDb?login=userlogin&passwd=password&input_format=json&output_format=json&input_data={"suffix":"newdb","password":"password"}

// valid call example, input_data is urlencode encoded
https://api.beget.com/api/mysql/addDb?login=userlogin&passwd=password&input_format=json&output_format=json&input_data=%7B%22suffix%22%3A%22newdb%22%2C%22password%22%3A%22password%22%7D
Response example:
 true

An indication of success or failure is returned.

addAccess

Description:

The method adds the specified access to the specified MySql database.

Additional parameters
  • suffix - the suffix part of the login. When passing this parameter, keep in mind that the final login of the form "login_suffix" should be no longer than 16 characters;
  • access - access name - this can be: domain, IP, * or localhost;
  • password - password for new access to the database. It must contain at least 6 characters.
Call example:
// input_data is not encoded for clarity
https://api.beget.com/api/mysql/addAccess?login=userlogin&passwd=password&input_format=json&output_format=json&input_data={"suffix":"newdb","access":"192.168.100.100","password":"newpassword"}

// valid call example, input_data is urlencode encoded
https://api.beget.com/api/mysql/addAccess?login=userlogin&passwd=password&input_format=json&output_format=json&input_data=%7B%22suffix%22%3A%22newdb%22%2C%22access%22%3A%22192.168.100.100%22%2C%22password%22%3A%22newpassword%22%7D
Response example:
 true

An indication of success or failure is returned.

dropDb

Description:

The method removes the specified database and all accesses to it.

Additional parameters
  • suffix - the suffix part of the database name.
Call example:
// input_data is not encoded for clarity
https://api.beget.com/api/mysql/dropDb?login=userlogin&passwd=password&input_format=json&output_format=json&input_data={"suffix":"newdb"}

// valid call example, input_data is urlencode encoded
https://api.beget.com/api/mysql/dropDb?login=userlogin&passwd=password&input_format=json&output_format=json&input_data=%7B%22suffix%22%3A%22newdb%22%7D
Response example:
 true

An indication of success or failure is returned.

dropAccess

Description:

The method removes the specified access from the database.

Additional parameters
  • suffix - the suffix part of the database name;
  • access - access name - this can be: domain, IP, * or localhost.
Call example:
// input_data is not encoded for clarity
https://api.beget.com/api/mysql/dropAccess?login=userlogin&passwd=password&input_format=json&output_format=json&input_data={"suffix":"newdb","access":"localhost"}

// valid call example, input_data is urlencode encoded
https://api.beget.com/api/mysql/dropAccess?login=userlogin&passwd=password&input_format=json&output_format=json&input_data=%7B%22suffix%22%3A%22newdb%22%2C%22access%22%3A%22localhost%22%7D
Response example:
 true

An indication of success or failure is returned.

changeAccessPassword

Description:

The method changes the password on the specified access.

Additional parameters
  • suffix - the suffix part of the database name;
  • access - access name - this can be: domain, IP, * or localhost;
  • password - password for new access to the database. It must contain at least 6 characters.
Call example:
// input_data is not encoded for clarity
https://api.beget.com/api/mysql/changeAccessPassword?login=userlogin&passwd=password&input_format=json&output_format=json&input_data={"suffix":"newdb","access":"localhost","password":"newpassword"}https://api.beget.com/api/mysql/changeAccessPassword?login=userlogin&passwd=password&input_format=json&output_format=json&input_data=%7B%22suffix%22%3A%22newdb%22%2C%22access%22%3A%22localhost%22%2C%22password%22%3A%22newpassword%22%7D%0A

// valid call example, input_data is urlencode encoded
https://api.beget.com/api/mysql/dropAccess?login=userlogin&passwd=password&input_format=json&output_format=json&input_data=%7B%22suffix%22%3A%22newdb%22%2C%22access%22%3A%22localhost%22%7D
Response example:
 true

An indication of success or failure is returned.