1

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.

1 Answer 1

0

Do not dump tables in mysql, information_schema, performance_schema -- they are system tables.

2
  • Thanks. All the official examples use mysqldump --all-databases - are you saying that is incorrect? What do I do instead? Commented Nov 2, 2019 at 6:09
  • @lonix - Look in the dump file to see what was dumped. Commented Nov 3, 2019 at 6:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.