A
A
Andrey Belyaev2021-12-31 19:06:24
bash
Andrey Belyaev, 2021-12-31 19:06:24

Waiting for mysql to start?

The question is how to make mysql start waiting, if it gets up, then the launch of the following script

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2021-12-31
@andrewky_dev

Yes, it's trite, you make a loop in which you execute a simple sql query every few seconds, and if it was successful, you exit the loop.
You can add a timeout to the loop by which to complete the script with an error.
ps In general, more details are needed. If you need autostart at system startup, then you can specify the dependency through systemd.

V
Viktor Taran, 2022-01-03
@shambler81

команда && вторая команда
&& - if labor is over
|| -if the command ended in a crash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question