Create remote MySQL profile via SSH

This function uses SSH to create a profile to access a remote MySQL® server.

SecurityBasicAuth
Request
query Parameters
required
string or string

The MySQL server's IP address or hostname.

Example: host=192.168.0.1
name
required
string

The new profile's name.

Example: name=MyProfileSSH
port
required
integer [ 1 .. 65535 ]

The SSH server's port.

Example: port=22
user
required
string

The SSH username.

Example: user=SSHuser
cpcloud
integer
Default: 0

Whether the remote database profile is a cPanel Cloud deployment.

  • 1 — Is cPanel Cloud.
  • 0Not cPanel Cloud.
Example: cpcloud=1
password
string

The SSH username's password.

Warning:

You must specify either the password or the sshkey_name parameter.

Example: password=12345luggage
root_escalation_method
string

The escalation method to use to authenticate the account.

Warning:

This parameter is required if the user parameter's value is not root.

Enum: "sudo" "su"
Example: root_escalation_method=su
root_password
string

The MySQL server's root user's password.

Warning:

This parameter is required if the root_escalation_method parameter's value is su.

Example: root_password=username
sshkey_name
string

The name of the SSH key.

Warning:

You must specify either the password or the sshkey_name parameter.

Example: sshkey_name=VinzClortho
sshkey_passphrase
string

The SSH key's passphrase.

Warning:

This parameter is required if the sshkey_name value is password-protected.

Example: sshkey_passphrase=Gozer
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/remote_mysql_create_profile_via_ssh
Request samples
whmapi1 --output=jsonpretty \
  remote_mysql_create_profile_via_ssh \
  name='MyProfileSSH' \
  user='SSHuser' \
  host='192.168.0.1' \
  port='22'
Response samples
application/json
{
  • "data": {
    • "profile_details": {
      • "cpcloud": 0,
      • "mysql_host": "192.168.0.1",
      • "mysql_pass": "12345luggage",
      • "mysql_port": 3306,
      • "mysql_user": "username",
      • "setup_via": "Created via SSH"
      },
    • "profile_saved": "MyProfileSSH"
    },
  • "metadata": {
    • "command": "remote_mysql_create_profile_via_ssh",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}