MySQL Check

MySQL Check

MySQL Check validates connectivity to a MySQL database and optionally checks for specific database availability.

Usage with Binary

./wait4it -type=mysql -h=127.0.0.1 -p=3306 -t=60 -u=root -P=secret -n=app

Usage with Docker

docker run ph4r5h4d/wait4it -type=mysql -h=127.0.0.1 -p=3306 -t=60 -u=root -P=secret -n=app

Environment Variables

VariableDescriptionDefault
W4IT_TYPEThe type of check (set to mysql for MySQL check).-
W4IT_TIMEOUTTimeout in seconds.30
W4IT_HOSTThe host to check.127.0.0.1
W4IT_PORTThe port to check on the MySQL host.3306
W4IT_USERNAMEThe username for MySQL authentication.-
W4IT_PASSWORDThe password for MySQL authentication.-
W4IT_DBNAMEThe name of the database to check.-

Command-Line Arguments

ArgumentDescriptionDefault
-typeThe type of check (set to mysql).-
-tTimeout in seconds.30
-hThe host to check.127.0.0.1
-pThe port to check on the MySQL host.3306
-uThe username for MySQL authentication.-
-PThe password for MySQL authentication.-
-nThe name of the database to check.-

Notes

ℹ️
  • Environment variables override command-line arguments.
  • Ensure that the specified MySQL database and username/password are correct for the connection to succeed.

Exit Codes

CodeMeaning
0Connection successful.
1Timed out.
2Validation error or incorrect input.