I host at hostgator and have about 30 mysql databases (all different websites that sit on the same server). For the last year.. no problems and suddenly, the last 2 days, I’ve seen 5 – 10 of these databases marked as ‘crashed’ and they return no results… so my websites display no info. I have to run a “repair table mytable” to fix these and then they work great again.
Instead of logging in to go through the databases 1 by 1 every morning, is there a way I could setup a php page to connect to all 30 databases and run a simple select statement.. and if it works, return
“database db1 is working”
“database db2 is working”
and then when not working, return
“no reply from db3”
….or something similar?
Thanks!
There’s no reason you couldn’t have a script that lists all of your databasenames and login credentials, and try to connect in turn to each: