You can install mysql-client package and use mysqladmin to ping target server. Useful when working with multiple docker container. Combine with sleep and create a simple wait-loop:
while ! mysqladmin ping -h"$DB_HOST" --silent; do
sleep 1
done
More Related Contents:
- Suppress warning messages using mysql from within Terminal, but password written in bash script
- MySQL treats password in script as database
- Setting up MySQL and importing dump within Dockerfile
- How can I initialize a MySQL database with schema in a Docker container?
- Connect to mysql in a docker container from the host
- Using the RUN instruction in a Dockerfile with ‘source’ does not work
- How to connect mysql workbench to running mysql inside docker?
- Docker-compose check if mysql connection is ready
- How to execute a MySQL command from a shell script?
- Install MySQL on Ubuntu without a password prompt
- Docker (Apple Silicon/M1 Preview) MySQL “no matching manifest for linux/arm64/v8 in the manifest list entries”
- MYSQL_ROOT_PASSWORD is set but getting “Access denied for user ‘root’@’localhost’ (using password: YES)” in docker container
- How to pass arguments to Shell Script through docker run
- Bash script to insert values in MySQL
- How to get number of rows affected, while executing MySQL query from bash?
- Commit data in a mysql container
- Docker: How to use bash with an Alpine based docker image?
- Access mysql remote database from command line
- Communications link failure , Spring Boot + MySql +Docker + Hibernate
- Connect to Docker MySQL container from localhost?
- Node.js connect to MySQL Docker container ECONNREFUSED
- How to connect locally hosted MySQL database with the docker container
- Access to mysql container from other container
- connecting to a docker-compose mysql container denies access but docker running same image does not
- Linux shell script for database backup
- How to initialize mysql container when created on Kubernetes?
- django cannot connect mysql in docker-compose
- MySQL scripts in docker-entrypoint-initdb are not executed
- docker entrypoint running bash script gets “permission denied”
- How to set uid and gid in Docker Compose?