> Markdown version of https://tuna.am/en/docs/cli/mysql/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# tuna mysql

Start a MySQL tunnel.

Guide with examples: [MySQL](https://tuna.am/en/docs/tunnels/mysql.md).

Usage

```bash
tuna mysql [port] [flags]

```

Examples

```bash
tuna mysql
tuna mysql 3306
tuna mysql 10.0.0.1:3306
tuna mysql 3306 --port=mysql
tuna mysql 3306 --port=35000

```

| Flag                  | Description                                                                |
| --------------------- | -------------------------------------------------------------------------- |
| `--api-key string`    | Your tuna.am api key with the tunnels:connect scope (env `TUNA_API_KEY`).  |
| `--cidr-allow string` | Reject connections that do not match the given CIDRs. Can be repeated.     |
| `--cidr-deny string`  | Reject connections that match the given CIDRs. Can be repeated.            |
| `--inspect-port int`  | Inspector port, the tunnel fails if it is busy (also `TUNA_INSPECT_PORT`). |
| `-p, --port string`   | Port for incoming connections.                                             |
| `--qr`                | Generate and show QR code.                                                 |

[Global flags](https://tuna.am/en/docs/cli.md#global-flags) work too.
