A recent Docker update seems to have caused (just some) InnoDB tables in a MariaDB to not be accessible. I get:
#1932 - Table 'dbname.SomeTableName' doesn't exist in engine
when trying to access them (they do SHOW up in a table list). I've updated Docker (and the image) in the past with no problem. The db files and permissions look fine.
I could recreate just the "missing" tables (4 out of ~35) from a backup, but when I try to delete them I get:
#1347 - 'dbname.SomeTableName' is not VIEW
I'm using Docker image mariadb:10.2
(MariaDB-10.2.12+maria~jessie) with a bind-mount for persistent data storage as part of a local Docker-for-Mac dev environment. The docker-compose.yml file looks like:
mysql:
image: mariadb:10.2
volumes:
- ./data/mysql:/var/lib/mysql
I've never had this error before and cannot dump or export the unaccessible tables. Is there a way to restore or repair (or delete) them? I would rather not have to recreate the entire database.
Using this command to start your MySQL container will create a new Docker volume called mysql . It'll be mounted into the container at /var/lib/mysql , where MySQL stores its data files. Any data written to this directory will now be transparently stored in the Docker-managed volume on your host.
I was able to solve this by using a custom mysql config for my local and adding:
[mysqld]
lower_case_table_names=1
You can do this without changing your default config by mounting a file containing the text above into the mysql conf.d directory like:
volumes:
- ./mysql_local.cnf:/etc/mysql/conf.d/mysql_local.cnf:ro
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With