> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.squarecloud.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# HeidiSQL: how to connect to MySQL (SSL)

# HeidiSQL: How to Connect to MySQL

HeidiSQL is a lightweight and powerful tool for managing MySQL databases. To ensure your data's security on Square Cloud, the connection requires using SSL certificates, guaranteeing that the information transferred between your machine and the server is encrypted.

---

## 1. Gathering Connection Data

Before starting the configuration in HeidiSQL, locate the connection URL in your Square Cloud dashboard. You will need to extract the following fields:

| Field | Value/Format |
| ---- |
| **Host (Hostname/IP)** | `square-cloud-db-id.squareweb.app` (`id` is your instance ID, already included in the copied URL) |
| **Port** | The number available in your URL (e.g., 3306) |
| **User** | `squarecloud` |
| **Password** | The password generated at the time of instance creation |

---

## 2. Session Configuration

1. Open HeidiSQL and click on **New** to create a new session.
2. In the Network type dropdown, select **MariaDB or MySQL (TCP/IP)**.
3. In the **Settings** tab, fill in the Host, User, Password, and Port with the data collected above.

---

## 3. Configuring SSL (Mandatory)

MySQL on Square Cloud does not accept unencrypted connections. To configure the certificate:

1. Access the **SSL** tab in the session configuration window.
2. Check the **Use SSL** box.
3. You will need to point to your `.pem` file (downloaded from the Square Cloud dashboard) in all available fields within the HeidiSQL interface:
    * **SSL CA certificate**
    * **SSL client certificate**
    * **SSL client key**

> **Note:** Although HeidiSQL displays separate fields, the `.pem` file provided by Square Cloud contains all the necessary information to validate both the authority and the connection key simultaneously.

---

## 4. Testing and Troubleshooting

After filling in all the information, click **Open** or **Save**.

* **"Access Denied" Error:** Check if the provided password matches exactly what is listed in your connection URL.
* **Invalid Certificate:** Verify that the `.pem` file was downloaded correctly and is not corrupted.
```