MySQL
Connect a MySQL database to Credible
Credible connects to MySQL with a username and password.
Create a User
Create a read-only user for Credible, replacing the database name and password:
CREATE USER 'credible_readonly'@'%' IDENTIFIED BY '<strong password>';
GRANT SELECT, SHOW VIEW ON sales.* TO 'credible_readonly'@'%';Connection Fields
| Field | Example |
|---|---|
| Host | db.example.com |
| Port | 3306 |
| Database Name | sales |
| Username | credible_readonly |
| Password | your database password |
The form has no TLS setting.
Network Access
The host needs to be reachable from the public internet, and from Credible's egress addresses if it sits behind an allowlist. For a database with no public route, see Private Networking.
From the CLI
To add the connection with cred add connection, put an entry like this in the JSON file:
[
{
"name": "warehouse",
"type": "mysql",
"mysqlConnection": {
"host": "db.example.com",
"port": 3306,
"database": "sales",
"user": "credible_readonly",
"password": "..."
}
}
]Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
Access denied for user | Wrong password, or the user's host part does not match Credible's address | Check the password. Create the user with host '%', or with Credible's egress address |
connect ETIMEDOUT | The host is not reachable from Credible | Add Credible's egress addresses to the firewall or security group |
SELECT command denied to user | The user lacks read access | GRANT SELECT ON <database>.* TO ... |