MySQL
MySQL can be used as a source database (the database LakeXpress extracts data from) and as the LakeXpress DB (the internal database LakeXpress uses for configuration, sync tracking, and pipeline logging). Both roles use the same connection parameter format.
Connection Parameters
| Parameter | Required | Description |
|---|---|---|
ds_type | Yes | Must be "mysql" |
auth_mode | Yes | Must be "classic" |
server | Yes | Hostname or IP |
port | Yes | Port (default: 3306) |
database | Yes | Database name |
username | Yes | MySQL username |
password | Yes | MySQL password |
Required Permissions
-- Source database user:
GRANT SELECT ON your_database.* TO 'lakexpress_user'@'%';
-- LakeXpress DB user:
GRANT ALL PRIVILEGES ON lakexpress_log.* 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}"
}
}
}
Example: LakeXpress DB
{
"lxdb_mysql": {
"ds_type": "mysql",
"auth_mode": "classic",
"info": {
"server": "localhost",
"port": 3306,
"database": "lakexpress_log",
"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 - Auth file format, security best practices