How do I know when my docker mysql container is up and mysql is ready for taking queries?

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)