Featured image of post MySQL Error [ERR] 3 – Error writing file 'WindowsSERVIC~1' (OS errno 28 – No space left on device) [ERR] Solution

MySQL Error [ERR] 3 – Error writing file 'WindowsSERVIC~1' (OS errno 28 – No space left on device) [ERR] Solution

Issue encountered: When running MySQL for an extended period or during SQL imports, you may encounter the following error: This is typically caused by MySQL...

Issue Encountered:

When running MySQL for an extended period or performing SQL imports, you might see the following error:

1
mysql [ERR] 3 - Error writing file 'C:\Windows\SERVIC~1\NETWOR~1\AppData\Local\Temp\MLvz91ct7q310wy84q' (OS errno 28 - No space left on device) [ERR]

This error is generally caused by the disk where MySQL’s temporary directory is located being full.

Solution:

Method 1: Free up disk space on the drive where the temporary directory is located by deleting unnecessary files to create space.

Method 2: Change MySQL’s temporary directory to a drive with more available space. Here’s how to do it:

  1. Stop the MySQL server. On Windows, execute net stop mysql80 in the command line (the service name may vary depending on the MySQL version). On Linux, run systemctl stop mysql.

  2. Modify the MySQL configuration file. For Windows, the default path is C:\\ProgramData\\MySQL\\MySQL Server 8.0\\my.ini. For Linux, it is /etc/my.cnf. Add the following line:

1
tmpdir="e:/bigmysql/tmpdir"

After making these changes, restart the MySQL server to apply them.

This resolves the issue.

Licensed under CC BY-NC-SA 4.0