Enabling the Root User on Cloud Databases

Enabling the root user for a Cloud Databases instance can cause unpredictable behavior. Changes that you make as a root user might cause detrimental effects to the database instance and unpredictable behavior for API operations.

🚧

Enabling the root user may limit Rackspace's ability to support your database instance. While we will make a best effort to assist, we cannot guarantee support if core MySQL® settings are modified, such as disabling binary logs (binlogs) or removing Rackspace-managed users. Once enabled, the root user cannot be disabled.

Use the cURL commands in the following steps to enable the root user for a Cloud Databases instance. Be sure that you modify the cURL commands to replace placeholders with your actual values in the following sample code.

${REGION} = The region your image exists in. (dfw, hkg, iad, etc)

${USERNAME} = The user you log into your account with.

${APIKEY} = Your user's API Key.

${ACCOUNTID} = Your account number.

${INSTANCEID} = Your Cloud Database's ID.

${TOKEN} = Your Token obtained from Step 1.

1) Authenticate to obtain an authentication token:

curl -s https://identity.api.rackspacecloud.com/v2.0/tokens \
  -X POST \
  -d '{"auth":{"RAX-KSKEY:apiKeyCredentials":{"username":"$USERNAME
","apiKey":"$APIKEY"}}}' \
  -H "Content-type: application/json" | grep -o '"token":{[^}]*}' | grep -o '"id":"[^"]*' | cut -d'"' -f4

2) List databases to obtain your ID:

curl -i \
-H 'X-Auth-Token: $TOKEN' \
-H 'Content-Type: application/json' \
'https://$REGION.databases.api.rackspacecloud.com/v1.0/$ACCOUNTID/instances'

The output provides a list of all your Cloud Databases. Note the ID reference related to the Cloud Databases instance for which you want to enable the root user.

3) Enable the root user:

curl -X POST -i \
-H 'X-Auth-Token: YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
'https://$REGION.databases.api.rackspacecloud.com/v1.0/$ACCOUNTID/instances/$INSTANCEID/root'

The root password is provided in the response and looks similar to the following example:

{
    "user": {
       "name": "root", 
       "password": "984641c8-bd4b-4Qda-9f95-89bcf2c995b9"
    }
}

4) Confirm that the root user is enabled:

curl -i \
-H 'X-Auth-Token: $TOKEN' \
-H 'Content-Type: application/json' \
'https://$REGION.databases.api.rackspacecloud.com/v1.0/$ACCOUNTID/instances/$INSTANCEID/root'

If the root user is enabled, you see the following output:

{
    "rootEnabled": true
}
📘

The primary difference between step 3 and 4 is that enabling the root user is done with a POST request and confirmation is done with a GET request.

The final step of this process is to connect to your Cloud Databases instance with the root credentials and then to set the max-connections value of your choosing. Keep in mind that this setting does not carry forward when you restart your Cloud Databases instance.


Did this page help you?