latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Databases
Remote MySQL Databases

Create remote MySQL profile via SSH

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

get/remote_mysql_create_profile_via_ssh

Query parameters

string ipv4 required
OR
string hostname required

The MySQL server's IP address or hostname.

namestring required
Example:MyProfileSSH

The new profile's name.

portinteger required
Example:22

The SSH server's port.

userstring required
Example:SSHuser

The SSH username.

cpcloudinteger
Example:1

Whether the remote database profile is a cPanel Cloud deployment.

  • 1 — Is cPanel Cloud.
  • 0Not cPanel Cloud.
passwordstring
Example:12345luggage

The SSH username's password.

Warning:

You must specify either the password or the sshkey_name parameter.

root_escalation_method'sudo' | 'su'
Example:su

The escalation method to use to authenticate the account.

Warning:

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

root_passwordstring
Example:username

The MySQL server's root user's password.

Warning:

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

sshkey_namestring
Example:VinzClortho

The name of the SSH key.

Warning:

You must specify either the password or the sshkey_name parameter.

sshkey_passphrasestring
Example:Gozer

The SSH key's passphrase.

Warning:

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

Response

HTTP Request was successful.

Example response

{
  "data": {
    "profile_details": {
      "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
  }
}