fix: add database name to MySQL connection test in health check
The MySQL connection test was failing because it didn't specify the database name. MySQL requires a database to be selected when using the -e flag with SELECT queries. Changed: mysql -u"$MYSQL_USER" -e 'SELECT 1' To: mysql -u"$MYSQL_USER" "$MYSQL_DATABASE" -e 'SELECT 1' This fixes the "Impossible de se connecter à MySQL" error in production even when MySQL is working correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -138,7 +138,7 @@ if docker-compose exec -T db mysqladmin ping -h localhost --silent 2>/dev/null;
|
|||||||
source .env
|
source .env
|
||||||
set +a
|
set +a
|
||||||
|
|
||||||
if docker-compose exec -T db sh -c "MYSQL_PWD=\"\$MYSQL_PASSWORD\" mysql -u\"\$MYSQL_USER\" -e 'SELECT 1' >/dev/null 2>&1"; then
|
if docker-compose exec -T db sh -c "MYSQL_PWD=\"\$MYSQL_PASSWORD\" mysql -u\"\$MYSQL_USER\" \"\$MYSQL_DATABASE\" -e 'SELECT 1' >/dev/null 2>&1"; then
|
||||||
check_ok "Connexion MySQL fonctionnelle"
|
check_ok "Connexion MySQL fonctionnelle"
|
||||||
else
|
else
|
||||||
check_fail "Impossible de se connecter à MySQL"
|
check_fail "Impossible de se connecter à MySQL"
|
||||||
|
|||||||
Reference in New Issue
Block a user