Compute Instance (original) (raw)

You cannot connect directly from a remote IP to the endpoint of a DB system. Use SSH or RDP to connect to a compute instance, and from the compute instance use MySQL Shell, MySQL Client or MySQL Workbench to connect to the DB system.

Connecting to a Compute Instance

Use SSH or RDP, depending on the platform, to connect to a compute instance.

Using the CLI

Use the command-line interface to connect to a compute instance.

This task requires the following:

  1. Set the file permissions so that only you can read the file:
chmod 400 <PrivateKeyFile>  

: Specify the full path and name of the file that contains the private key associated with the instance you want to access. 2. SSH into the compute instance from your local machine using the public IP address of the compute instance.

ssh -i <PrivateKeyFile> <Username>@<ComputePublicIpAddress>  

You are now connected to the compute instance.

Connecting to a DB System

Using MySQL Shell

Use MySQL Shell on a compute instance to connect to the endpoint of the DB system.

This task requires the following:

Do the following to connect to the DB system:

  1. Install MySQL Shell on the compute instance using the following command:
  2. Start MySQL Shell and connect to the endpoint of the DB system using the following command:
mysqlsh <Username>@<DBSystemEndpointIPAddress>  
  1. Enter your password when you get the following response:
Please provide the password for <DBSystemEndpointIPAddress>:  

This command starts a global session. By default, MySQL Shell attempts to connect to port 33060, and if the port is not available, it connects to port 3306.

Using MySQL Client

Use MySQL Client on a compute instance to connect to the endpoint of the DB system.

This task requires the following:

Do the following to connect to the DB system:

  1. Install the MySQL Client on the compute instance using the following command:
  2. Connect to your DB system using the MySQL Client.
mysql --host <DBSystemEndpointIPAddress> -u <Username> -p  
  1. Enter your password when you get the following response:

Using MySQL Workbench

Use MySQL Workbench on a compute instance to connect to the endpoint of the DB system.

This task requires the following:

Do the following to connect to the endpoint of the DB system:

  1. Launch MySQL Workbench.
  2. On the home page, click the + sign besides MySQL Connections.
  3. In the Setup New Connection dialog box, provide the following details:
    • Connection Name: Specify a name of the connection.
    • Connection Method: Select Standard TCP/IP over SSH.
  4. In the Parameters tab, provide the following details:
    • SSH Hostname: Specify the public IP address of the compute instance.
    • SSH Username: Specify opc.
    • SSH Key File: Specify the path to your SSH private key.
    • MySQL Hostname: Specify the IP address of the endpoint of your DB system.
    • MySQL Server Port: Specify the port the MySQL endpoint is listening on.
    • Username: Specify the username you defined when creating the DB system.
    • Password: Specify the password you defined when creating the DB system.
  5. Click Test Connection to confirm that the connection details are valid.
  6. Click OK.