# Check the DB of WordPress
Check using the number of tables.
```shell
#/bin/bash
while [ true ]
do
# Number of actual tables in the database.
TABLES_QTY=$(wp db tables --allow-root 2>/dev/null | wc -l)
# Expected number of tables.
EXPECTED_QTY=12
if [ $TABLES_QTY == $EXPECTED_QTY ]; then
break
fi
done
echo 'DB is ready.'
```
Check the status of the DB.
```shell
#/bin/bash
while [ true ]
do
DB_STATUS=$(wp db check --allow-root 2>&1| grep "Success: Database checked." | wc -l)
if [ $DB_STATUS == 1 ]; then
break
fi
echo 'DB is ready.'
done
```