Compute Instance
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.
- A running VCN with internet connectivity. See Creating a Virtual Cloud Network.
- A running MySQL DB system attached to the VCN. Note the IP address of the MySQL endpoint in the DB system, and the administrator username and password. To find the IP Address, see Resource: Endpoints.
- A running compute instance (Oracle Linux is used in the task) attached to a public subnet on the same VCN as the MySQL DB system. Note the public IP address of the compute instance. The SSH port, 22, is added to the public subnet by default. It is recommended you add an ingress rule for port 33060, which is the default port for MySQL Shell. If that port is not available, MySQL Shell connects to port 3306. If you have configured alternative ports, include the port number in your connection string. See Overview of Networking.
Related Topics
Connecting to a DB System
Use MySQL Shell, MySQL Client, or MySQL Workbench from a compute instance to connect to a DB system.
Using MySQL Shell
Use MySQL Shell on a compute instance to connect to the endpoint of the DB system.
- A running VCN with internet connectivity. See Creating a Virtual Cloud Network.
- A running MySQL DB system attached to the VCN. Note the IP address of the MySQL endpoint in the DB system, and the administrator username and password. To find the IP Address, see Resource: Endpoints.
- A running and connected compute instance (Oracle Linux is used in the task) attached to a public subnet on the same VCN as the MySQL DB system. Note the public IP address of the compute instance. The SSH port, 22, is added to the public subnet by default. It is recommended you add an ingress rule for port 33060, which is the default port for MySQL Shell. If that port is not available, MySQL Shell connects to port 3306. If you have configured alternative ports, include the port number in your connection string. See Overview of Networking.
Using MySQL Client
Use MySQL Client on a compute instance to connect to the endpoint of the DB system.
- A running VCN with internet connectivity. See Creating a Virtual Cloud Network.
- A running MySQL DB system attached to the VCN. Note the IP address of the MySQL endpoint in the DB system, and the administrator username and password. To find the IP Address, see Resource: Endpoints.
- A running and connected compute instance (Oracle Linux is used in the task) attached to a public subnet on the same VCN as the MySQL DB system. Note the public IP address of the compute instance. The SSH port, 22, is added to the public subnet by default. See Overview of Networking.
Using MySQL Workbench
Use MySQL Workbench on a compute instance to connect to the endpoint of the DB system.
- A running VCN with internet connectivity. See Creating a Virtual Cloud Network.
- A running compute instance (Oracle Linux is used in the task) attached to a public subnet on the same VCN as the MySQL DB system. Note the public IP address of the compute instance. See Overview of Networking.
- A SSH key-pair.
Note
MySQL Workbench does not support PuTTY-generated keys. If you use PuTTYgen to generate your SSH key pair, convert your private key to the OpenSSH format using the Conversion utility of PuTTYgen.
- Launch MySQL Workbench.
- On the home page, click the + sign besides MySQL Connections.
- 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.
- 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.
- Click Test Connection to confirm that the connection details are valid.
- Click OK.