I'm running mariadb in a docker container. I want to backup and restore using a sql dump.
I created the database for use with wordpress, and created just one test page. I installed phpmyadmin to the same database.
I created a backup like this:
mysqldump \
--all-databases \
--add-drop-database --add-drop-table \
--user=root --password=password \
> seed.sql
Then I mounted the seed.sql
dump in docker-compose.yml
like this:
volumes:
- mariadb_data:/var/lib/mysql/
- ./seed_data/:/docker-entrypoint-initdb.d/:ro
Then I deleted the mariadb_data
volume and container, and restarted the container. The database read the seed script, and seemed to restore the database.
But, the logs show this:
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/seed.sql
[ERROR] InnoDB: Table
mysql
.innodb_table_stats
not found.
I got the same error with a mysql container. What did I do wrong? Did I create the backup correctly?
UPDATE
I just discovered that this only occurs when I use the database for wordpress. When I don't install wordpress into the database, and backup and restore it, I don't get the error.