I have to check for the existence of several tables from a shell script, without accessing the MySQL daemon. Is the presence of .frm
files reliable to determine if the tables exist or not? Here's what I have been doing, but it doesn't seem to work all the time (there may be an error in another part of the system):
for table in $TABLES; do
if [ -f /data/mysql/${database}/${table}.frm ]; then
...
...
fi
done
Is this reliable? If not, is there another way to achieve this?