O
O
okkkman2020-01-24 04:40:31
MySQL
okkkman, 2020-01-24 04:40:31

How to rewrite database connection check under MySQL before migrations?

Hello everyone
I'm building docker-compose and found a good example with PostgreSQL, but I plan to use MySQL, so can you tell me what to replace this line with:

ssh -o StrictHostKeyChecking=no ${PRODUCTION_HOST} -p ${PRODUCTION_PORT} 'until docker-compose exec -T app-postgres pg_isready --timeout=0 --dbname=app ; do sleep 1 ; done'

pg_isready is a check for a connection to the database server, after which migrations are launched.
How to rewrite under MySQL?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-01-24
@okkkman

Something like
MYSQL_PWD=custom_password mysqladmin -u custom_user ping -h localhost
IMHO, it's better to use https://docs.docker.com/engine/reference/builder/#... for example
https://github.community/t5/ GitHub-Actions/Mysql-s...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question