Deploying on OCI with the starter kit – part 4 (connecting to the database)

Let’s now see how we can connect to our MySQL HeatWave DB System, which was deployed with the OCI Hackathon Starter Kit in part 1.

We have multiple possibilities to connect to the DB System, and we will use three of them:

  1. using MySQL Shell in the command line via the compute instance
  2. using MySQL Shell for Visual Studio Code on your development machine
  3. using Cloud Shell

MySQL Shell in the command line

MySQL Shell is already installed on the Compute Instance. Sometimes, if it’s not installed automatically, it’s because the selected compute shape is too small. This was the case with the always-free
VM.Standard.E2.1.Micro shape. This is fixed in the last version of the stack.

From the deployed compute instance, when SSH-connected, you can launch MySQL Shell and connect to the MySQL HeatWave DBSystem using its private IP.

Let’s see all this in video:

MySQL Shell for Visual Studio Code

If we configure the OCI config on our machine, we can use MySQL for Visual Studio Code to connect to the MySQL HeatWave DBSystem via a bastion host.

We need to create or update our ~/.oci/config file to use a new API Key for our user.

OCI Console’s Cloud Shell

You can also use the Cloud Shell from the OCI Console to connect to your MySQL HeatWave DBSystem.

You need first to use an “Ephemeral private network” that uses your VCN and your private subnet:

Then you connect using the DBSystem’s private IP, like in the video:

Conclusion

We saw how to connect to the MySQL HeatWave Database instance using MySQL Shell. Now we can create databases, tables, and more.

In the following article, we will see how to connect from our programming language.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply

Your email address will not be published. Required fields are marked *

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.