How to Connect

Database services on MariaDB SkySQL are:

  • Live and able to receive connections when they have a "Healthy" status.

  • Compatible with most clients, but some clients may require additional configuration to access MariaDB SkySQL database services.

  • Accessible through a Fully Qualified Domain Name (FQDN) and non-standard ports.

  • Protected by a firewall with a whitelist.

  • Require TLS encryption for all connections.

Just need the basics? See Connect to MariaDB SkySQL.

Connecting to a Service

To connect to a MariaDB SkySQL Service:

  1. Log in to the SkySQL Portal.

  2. Click on "Your Services" in the SkySQL main menu.

  3. In the "Services" view, select the database service you want to connect to.

  4. In the Service Details view, take note of the following connection information:

    Field

    Description

    Fully Qualified Domain Name (FQDN)

    This value is the host to connect to. For MariaDB Client, this would be provided as the --host argument.

    Read-Write Port

    This value is the port to connect to. For MariaDB Client, this would be provided as the --port argument.

    Read-Only Port (Primary/Replica topology only)

    This value is the port to connect to for read-only connections. For MariaDB Client, this would be provided as the --port argument.

  5. Click on the "Show Credentials" button.

  6. In the Service Credentials view, take note of the following connection information:

    Field

    Description

    Username

    This is the name of the user account to connect with. For MariaDB Client, this would be provided as the --user argument.

    Default password

    This is the password of the user account to connect with. For MariaDB Client, this would be provided at the prompt by using the --password argument.

    Certificate authority chain

    Click the "Download" link to download skysql_chain.pem. This file is used to enable TLS. For MariaDB Client, this would be provided as the --ssl-ca argument.

  7. Click on "Close" to go back to the Service Details view.

  8. Add your IP address to the service's whitelist:

    1. Click on the name of the database.

    2. Click on the pencil icon to the right of the "Whitelisted IP Addresses" heading.

    3. Enter an IPv4 address or netblock to be whitelisted, and click on the "Add" button.

      • Addresses must be valid IPv4 addresses.

      • Whitelisting of 0.0.0.0/0 is not allowed.

      For example, 192.0.2.1/32 or 198.51.100.0/24.

    4. Once you have entered the desired addresses and netblocks, click on the "Submit" button. The interface will reflect the new whitelist settings immediately, but changes may take a few minutes to propagate to your server.

  9. Cut and paste the given command from the Connection Details view into a terminal window to connect to the MariaDB client, or use the connection information to connect with your chosen client. For MariaDB Client 10.4, the command would look like this:

    $ mariadb --host ${FQDN} \
       --port ${PORT} \
       --user ${USER} \
       --password \
       --ssl-ca ~/Downloads/skysql_chain.pem \
       --ssl-verify-server-cert
    

    Substitute ${FQDN}, ${PORT}, and ${USER} with the corresponding values that you gathered in the previous steps.

  10. When prompted, enter the password from the Connection Details view.

  11. Once you have connected to your database service, update the password with the SET PASSWORD statement.

Need details for your client? See Client Instructions.

Need details about user accounts? See Accounts.