Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
---
title: "MySQL accounts"
sidebarTitle: "MySQL"
description: "Give people and agents access to a MySQL database without sharing its credentials."
---
A MySQL [account](/documentation/platform/pam/accounts/overview) stores the credentials for one MySQL database user. Members connect to the database in the browser or through the Infisical CLI, and Infisical records every query they run.
## Prerequisites
- The Admin [role](/documentation/platform/pam/concepts/access-control) on the [folder](/documentation/platform/pam/folders/overview) you'll add the account to
- A [gateway](/documentation/platform/gateways/overview) that can reach the database
- A MySQL [account template](/documentation/platform/pam/templates/overview)
## Create the account
<Steps>
<Step>
Go to **Privileged Access Management** > **Accounts** and select **Add Account**.
</Step>
<Step>
Select the **Folder** and a MySQL **Account Template**, then select **Next**.
</Step>
<Step>
Enter a **Name** and the connection details:
| Field | Description |
| --- | --- |
| **Host** | The database's hostname or IP address |
| **Port** | The database's port (defaults to `3306`) |
| **Database** | The database that sessions connect to |
| **SSL Enabled** | Whether to connect over TLS |
| **Reject Unauthorized** | Whether to reject a server certificate that can't be verified (shown when **SSL Enabled** is on) |
| **SSL Certificate** | The CA certificate that signed the server's certificate (shown when **SSL Enabled** is on) |
</Step>
<Step>
Enter the **Username** and **Password** of the MySQL user, then select **Create**.
</Step>
</Steps>
## Connect
To open a session, follow [Connect to an account](/documentation/platform/pam/accounts/connect).
<Tabs>
<Tab title="Browser">
The browser session has a table browser, where you can view, filter, edit, and export rows, and a SQL editor for running queries.
</Tab>
<Tab title="CLI">
Start the local proxy:
```bash
infisical pam access backend-team/orders-db
```
The proxy keeps running in that terminal and prints its port. In a second terminal, connect your MySQL client to that port:
```bash
mysql -h 127.0.0.1 -P <port> orders
```
The proxy signs in for you, so the client doesn't need a password.
</Tab>
</Tabs>
## Next steps
<CardGroup cols={2}>
<Card title="MySQL credential rotation" icon="refresh-cw" href="/documentation/platform/pam/credential-rotation/mysql">
Rotate the passwords of MySQL accounts.
</Card>
<Card title="Sessions" icon="monitor" href="/documentation/platform/pam/sessions/overview">
Review and end the connections that people and agents make to your accounts.
</Card>
</CardGroup>