Skip to content

Commit

Permalink
fix: Modify MySQL health check to use root user for write test
Browse files Browse the repository at this point in the history
  • Loading branch information
pcfreak30 committed Dec 18, 2024
1 parent 5fa5da5 commit 12fa16d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mysql-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 12fa16d

Please sign in to comment.