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

# MySQL

> Connect a MySQL database to Cobi

## Best Practices

### Create a Read-Only User

We strongly recommend creating a dedicated database user with read-only permissions:

```sql theme={null}
CREATE USER 'cobi_reader'@'%' IDENTIFIED BY 'secure_password';
GRANT SELECT ON your_database.* TO 'cobi_reader'@'%';
FLUSH PRIVILEGES;
```

### Limit Table Access

If you only want Cobi to access specific tables, grant permissions selectively:

```sql theme={null}
-- Grant access to specific tables only
GRANT SELECT ON your_database.customers TO 'cobi_reader'@'%';
GRANT SELECT ON your_database.transactions TO 'cobi_reader'@'%';
FLUSH PRIVILEGES;
```

## Troubleshooting

See the [Troubleshooting](/platform/data-connectors/troubleshooting) page for help with connection issues.
