> ## Documentation Index
> Fetch the complete documentation index at: https://docs.instapods.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL

> Install and use MySQL 8.0 in your pod.

MySQL 8.0 is available as an on-demand service for your pods.

## Install

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    instapods services add my-app -s mysql -w
    ```
  </Tab>

  <Tab title="Dashboard">
    Go to your pod's **Services** tab and click **Install** next to MySQL.
  </Tab>
</Tabs>

Installation takes approximately 8–15 seconds.

## Credentials

```bash theme={null}
instapods services creds my-app -s mysql
```

| Field    | Value            |
| -------- | ---------------- |
| Host     | `localhost`      |
| Port     | `3306`           |
| Username | `instapod`       |
| Password | (auto-generated) |
| Database | `instapod`       |

## Connecting from Your Application

### PHP

```php theme={null}
$pdo = new PDO(
    'mysql:host=localhost;port=3306;dbname=instapod',
    'instapod',
    'YOUR_PASSWORD'
);
```

### Node.js

```javascript theme={null}
const mysql = require('mysql2/promise');

const connection = await mysql.createConnection({
  host: 'localhost',
  port: 3306,
  user: 'instapod',
  password: 'YOUR_PASSWORD',
  database: 'instapod'
});
```

### Python

```python theme={null}
import mysql.connector

conn = mysql.connector.connect(
    host='localhost',
    port=3306,
    user='instapod',
    password='YOUR_PASSWORD',
    database='instapod'
)
```

## Command Line Access

SSH into your pod and use the `mysql` client:

```bash theme={null}
instapods ssh my-app
mysql -u instapod -p instapod
```

## Configuration

MySQL runs with secure defaults suitable for development:

* Listens on `localhost:3306` only (not accessible from outside the pod)
* Default charset: `utf8mb4`
* InnoDB storage engine
