---
title: Connection Details
url: https://docs.vultr.com/products/storage/databases/mysql/management/connection/connection-details
description: How to view and manage connection credentials for accessing your Vultr Managed MySQL databases
publish_date: 2024-09-23T20:21:34.638225Z
last_updated: 2026-05-26T20:35:49.337074Z
---

# How to Manage Connection Details for Vultr Managed Databases for MySQL

Managed database connection details consist of host, port, username, password, default database, connection strings, and SSL certificates. These credentials allow you to connect to the managed databases from your favorite database client or modern programming language libraries. These include MySQL command line client (`mysql`), MySQL Connector/Python (`mysql-connector-python`), Go MySQL Driver (`go-sql-driver/mysql`), and PHP Data Objects (`PDO`).

Follow this guide to manage connection details for Vultr Managed Databases for MySQL using the Vultr Console, API, CLI, or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and select **Databases**.
    1. Click the target database instance.
    1. Navigate to **Connection Details** under **Overview**.
    1. Click **Copy Connection String**.
    1. Click **Copy MySQL URL**.
    1. Click **Download Signed Certificate** and save the certificate.

=== "Vultr API"

    1. List all the database instances by sending a `GET` request to the [**List Managed Databases** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/list-databases) and note the database ID. For example, `43b4c774-5dff-4ac0-a01f-78a23c2205b5`.

        ```console
        $ curl "https://api.vultr.com/v2/databases" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `GET` request to the [**Get Managed Database** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/get-database) and specify a database ID.

        ```console
        $ curl "https://api.vultr.com/v2/databases/database_id" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

        Visit the [**Get Managed Database** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/get-database) to view additional attributes to add to your request.

    1. Copy the `host`, `port`, `user`, `password`, `dbname` values and use them to connect to the database from your favorite client.

=== "Vultr CLI"

    1. List all database instances and note the database ID. For instance, `d6ac2a3c-92ea-43ef-8185-71a23e58ad8c`.

        ```console
        $ vultr-cli database list --summarize
        ```

    1. Retrieve connection details by specifying the database ID and copy the credentials.

        ```console
        $ vultr-cli database get database_id
        ```
    
        Run `vultr-cli database get --help` to view all options.

=== "Terraform"

    1. If you manage the database with Terraform, you can output connection details from the resource.

        ```terraform
        # Assuming a managed database resource exists
        resource "vultr_database" "mysql" {
            database_engine         = "mysql"
            database_engine_version = "8"
            region                  = "ewr"
            plan                    = "vultr-dbaas-startup-cc-1-55-2"
            label                   = "mysql-cluster-1"
        }

        output "mysql_host"    { value = vultr_database.mysql.host }
        output "mysql_port"    { value = vultr_database.mysql.port }
        output "mysql_user"    { value = vultr_database.mysql.user }
        output "mysql_dbname"  { value = vultr_database.mysql.dbname }
        # output "mysql_password" { value = vultr_database.mysql.password  sensitive = true }
        ```

    1. Apply the configuration and view the outputs with `terraform output`.
