MySQL as LakeXpress DB
1. Create the database
Run as a MySQL administrator (for example root):
CREATE DATABASE lakexpress_log CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'lakexpress_admin'@'%' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON lakexpress_log.* TO 'lakexpress_admin'@'%';
'%' allows connections from any host. Replace it with the host LakeXpress runs on to restrict access.
2. Add it to the credentials file
{
"lxdb_mysql": {
"ds_type": "mysql",
"auth_mode": "classic",
"info": {
"username": "$env{LX_LXDB_USER}",
"password": "$env{LX_LXDB_PASSWORD}",
"server": "mysql.company.com",
"port": 3306,
"database": "lakexpress_log"
}
}
}
See MySQL connection parameters for the full list.
3. Create the LakeXpress tables
./LakeXpress lxdb init -a credentials.json --lxdb_auth_id lxdb_mysql
Troubleshooting
Access denied for user 'lakexpress_admin'@'%' to database 'lakexpress_log' (error 1044):
The database does not exist, database in the credentials file has a different name, or the GRANT was not run. Check with SHOW DATABASES; and SHOW GRANTS FOR 'lakexpress_admin'@'%';.
Connection refused or other connection errors: See the MySQL troubleshooting section.