diff --git a/lib/mysql-common.sh b/lib/mysql-common.sh index 8048b45..15e9d90 100755 --- a/lib/mysql-common.sh +++ b/lib/mysql-common.sh @@ -310,8 +310,8 @@ check_mysql_health() { log_info "Current user: ${current_user}" log_info "Grants: ${grants}" - # Try to create test table with error capture - if ! error_output=$(mysql_retry -e 'CREATE TABLE IF NOT EXISTS mysql.role_check (id INT); DROP TABLE mysql.role_check;' 2>&1); then + # Try to create test table with error capture using root user + if ! error_output=$(mysql_retry_auth root "${MYSQL_ROOT_PASSWORD}" -e 'CREATE TABLE IF NOT EXISTS mysql.role_check (id INT); DROP TABLE mysql.role_check;' 2>&1); then status_details+=("write:failed") log_error "MySQL cannot execute DDL" log_error "Error output: ${error_output}"