To create a connection to a MySQL DB system

Open a command prompt and run oci dbtools connection create-mysql-database to create a new Database Tools connection within the specified compartment:

oci dbtools connection create-mysql-database -c <target_compartment_ocid> --user-name <database_user> --user-password-secret-id <vault_secret_ocid> --connection-string <connection_string> --private-endpoint-id <private_endpoint_ocid> --display-name <connection_name>
Note

This example assumes a private endpoint and the required secret in a vault already exist.

For example:

oci dbtools connection create-mysql-database -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-name "example-user" --user-password-secret-id ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya --connection-string "mysql://10.0.0.42:3306/exampledatabase" --private-endpoint-id cid1.databasetoolsprivateendpoint.oc1.phx.exampleendpoint25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabcdefg --display-name example-connection