Fixing MySQL 'The table is full' error using the official MySQL Docker image

Recently I had to test importing some very large databases with lots of giant log tables (e.g. 5+ GB tables), and when I tried doing an import into a local docker MySQL container instance, I got ERROR 1114: The table is full. Here are the commands I used:

# Run a MySQL container locally to test a large file import.
$ docker run --name mysql-import-test -p 3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=database_name -d mysql:latest

# Import a database .sql file and monitor progress with pv.
$ pv ~/database.sql | mysql -u root -proot -h --port 32774 database_name
ERROR 1114 (HY000) at line 93898: The table 'xyz' is full

I found that—likely due to some Docker filesystem defaults—the MySQL import would fail every time when there was a database table containing more than 1GB of data. Now, this could be related to the way the database was exported, and I also found some issues where people were using memory tables that got exported and wouldn't import cleanly.

But in my particular case, to overcome this problem I just mounted a local directory into the container at /var/lib/mysql, and that seems to have cleared up the problem:

$ docker run --name mysql-import -v `(pwd)`/mysql:/var/lib/mysql:rw,delegated -p 3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=magento -d mysql:latest

So, if you ever see "The table 'x' is full", check into whether the filesystem supports file sizes at least as large as your largest MySQL database table. There are likely other ways you can work around this issue, but this fix worked for me, so I thought I'd post it here in case anyone else ever ran into the same issue.


Again me finding your answers. :)
If anyone is using Docker for Windows and uses WSL to manage the containers, you might have some issue.
I was having issues when bringing up a MySQL container as it was only creating with 7.8G of space for /var/lib/mysql and the mysql folder wasn't being created in the local folder. I was running from ~/Sites/ericc/repo/
That's because Docker on Windows can't really access the folder to WSL folder, but if you run docker-compose up -d (or docker run) from Windows Powershell the folder is created and now you have the space.

I also tried to start the container from a Windows location (/mnt/e/Sites/ericc/repo/) and still it didn't work. I might have some misconfiguration, but I am fine using Powershell to start the containers for now.

Interesting; there are definitely a few quirks still when using Windows executables under the WSL, and it sounds like you’ve run into one particularly strange one! Luckily the workaround doesn’t sound too bad. I’m surprised working inside the /mnt folder in WSL didn’t help, but I’ve seen stranger things!

I had the same problem in Docker for Windows. According to MySQL manual reference it says, it is not a problem with MySQL, but limits with SO, in this case with docker. I had a Docker compose and I ran my project several times, without delete resources, It resulted I had a lot of volumes and networks without any use. So, I deleted all of them and then I just ran the 12GB sql backup file from MySQL container and it worked.

Just an update. With the latest Windows updates and WSL updates, this hasn't been an issue anymore.