# MySQL

Open-source relational database

- Category: Databases
- Runs in: the Phloem cloud

Lets you and Hamming query a MySQL database with SQL, with its tables listed in Trace.

## What Phloem reads
- Tables, columns and foreign keys of the database you name, listed in Trace for Hamming and SQL autocomplete
- Base tables only. Views are not listed, but you can still query them by name.

## What you need
- The server's host and port (default 3306), reachable from Phloem's cloud
- The database name
- A username and password. Best: a user with `SELECT` only on that database.

## Connect
1. In the console, open **Connectors**, choose **Add connector**, then **MySQL**.
2. Enter a **Display Name**, then **Host**, **Port**, **Database**, **Username** and **Password**.
3. Choose **Test Connection** (it shows the server version), then **Create Connection**.

## What Hamming can do
- Run SQL that you or Hamming write

## Notes
- Phloem runs any statement, not only `SELECT`, and each one commits as it runs. The user's privileges decide what a query can change.
- One connector reads one database. Add another connector for a second database.

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Host | Text | Yes |  |
| Port | Number | No |  |
| Database | Text | Yes |  |
| Username | Text | No |  |
| Password | Secret | No |  |
