diff options
author | waja <waja@users.noreply.github.com> | 2023-06-28 16:37:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 16:37:55 +0200 |
commit | c22c277b3df4884719c833daaffca59167abd14a (patch) | |
tree | 47b040d77e8be01b5672dab88da270bde1f438cc /plugins/check_mysql.c | |
parent | 1bce93b28a889edcaed10a920c931a6232940ad8 (diff) | |
parent | b24eb7f46ac8667324efd818c01d68d5a1376c89 (diff) | |
download | monitoring-plugins-c22c277b3df4884719c833daaffca59167abd14a.tar.gz |
Merge branch 'master' into check_swap_scanf_expressions
Diffstat (limited to 'plugins/check_mysql.c')
-rw-r--r-- | plugins/check_mysql.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index 6cfa70ed..91e150fb 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
@@ -138,7 +138,10 @@ main (int argc, char **argv) | |||
138 | mysql_ssl_set(&mysql,key,cert,ca_cert,ca_dir,ciphers); | 138 | mysql_ssl_set(&mysql,key,cert,ca_cert,ca_dir,ciphers); |
139 | /* establish a connection to the server and error checking */ | 139 | /* establish a connection to the server and error checking */ |
140 | if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) { | 140 | if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) { |
141 | if (ignore_auth && mysql_errno (&mysql) == ER_ACCESS_DENIED_ERROR) | 141 | /* Depending on internally-selected auth plugin MySQL might return */ |
142 | /* ER_ACCESS_DENIED_NO_PASSWORD_ERROR or ER_ACCESS_DENIED_ERROR. */ | ||
143 | /* Semantically these errors are the same. */ | ||
144 | if (ignore_auth && (mysql_errno (&mysql) == ER_ACCESS_DENIED_ERROR || mysql_errno (&mysql) == ER_ACCESS_DENIED_NO_PASSWORD_ERROR)) | ||
142 | { | 145 | { |
143 | printf("MySQL OK - Version: %s (protocol %d)\n", | 146 | printf("MySQL OK - Version: %s (protocol %d)\n", |
144 | mysql_get_server_info(&mysql), | 147 | mysql_get_server_info(&mysql), |