From e880f4e9c43680ce694b21e1241e457da25a3ffe Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Tue, 28 Apr 2026 14:30:15 +0530 Subject: [PATCH] fix: create hades_user in dbinit for shared MySQL compatibility Shared MySQL (mysql-5-7) only has mysql_user. The hades app connects as hades_user which doesn't exist. dbinit runs as root, so it can create the user before migrations run. Co-Authored-By: Claude Opus 4.6 (1M context) --- hades/sql/000_create_db.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hades/sql/000_create_db.sql b/hades/sql/000_create_db.sql index a7f363f..42cbc2d 100644 --- a/hades/sql/000_create_db.sql +++ b/hades/sql/000_create_db.sql @@ -2,3 +2,8 @@ -- This file runs first to ensure proper migration ordering SELECT 'Database migration starting for hades_db' AS message; + +-- Create hades_user for app connections (shared MySQL only has mysql_user) +CREATE USER IF NOT EXISTS 'hades_user'@'%' IDENTIFIED BY 'local-hades-pass'; +GRANT ALL PRIVILEGES ON hades_db.* TO 'hades_user'@'%'; +FLUSH PRIVILEGES; -- 2.47.2