Here's the basic syntax:
# while ! (command here); do while ! mysql -uroot; do sleep 1 done
The example above performs the
operation (which will fail until
is up) every second. Keep in mind the poll operation you run should be as simple as possible, just enough to know that what you want to use is available!