MySQL
This page covers MySQL as a source database, the database LakeXpress exports data from. To use MySQL as the LakeXpress DB, see MySQL as LakeXpress DB.
Connection Parameters
| Parameter | Required | Description |
|---|---|---|
ds_type | Yes | Must be "mysql" |
auth_mode | Yes | Must be "classic" |
server | No | Hostname or IP (default: localhost) |
port | No | Port (default: 3306) |
database | No | Default database/schema to connect to. If omitted, LakeXpress connects without selecting a default database (useful when discovery is scoped by job configuration instead) |
username | Yes | MySQL username |
password | Yes | MySQL password |
Required Permissions
LakeXpress only needs read access to the databases it exports:
GRANT SELECT ON your_database.* TO 'lakexpress_user'@'%';
INFORMATION_SCHEMA access is granted by default.
Example: Source Database
{
"source_mysql": {
"ds_type": "mysql",
"auth_mode": "classic",
"info": {
"server": "localhost",
"port": 3306,
"database": "your-database",
"username": "$env{LX_MYSQL_USER}",
"password": "$env{LX_MYSQL_PASSWORD}"
}
}
}
Troubleshooting
Access denied for user:
Verify credentials, check host access: SELECT user, host FROM mysql.user WHERE user='your_user';, grant if needed: GRANT ALL PRIVILEGES ON database.* TO 'user'@'%';
Unknown database:
Verify name: SHOW DATABASES;, create if needed: CREATE DATABASE your_database;
Connection refused:
Check MySQL is running (systemctl status mysql), verify port (netstat -tlnp | grep 3306), check bind-address allows remote connections, check firewall (sudo ufw allow 3306/tcp).
See Also
- Database Connections Overview - Credentials file format, security best practices