Got an error from unknown thread

Hi ,

We have following errors in MySQL log :
[ERROR] Can’t create thread to handle request (errno= 22)

[ERROR] C:/MySQL/Program Files/MySQL/MySQL Server 5.6/bin\mysqld: Incorrect key file for table ‘ndows\SERVIC~2\NETWOR~1\AppData\Local\Temp#sql7e4_11937d9_2.MYI’; try to repair it

[ERROR] Got an error from unknown thread, …\mysql-5.6.14\storage\myisam\mi_write.c:226

And following errors in PHP log:
Error in Piwik (tracker): SQLSTATE[HY000] [1135] Can’t create a new thread (errno 22); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug

Does anyone know the reason ? We have 50 GB free disk space .

We have Matomo/piwik 2.10 and MySQL 5.6



The error seems to be related to the database files.

There are many reasons: Maybe the database got corrupted or /tmp is to small (sql - MySQL, Error 126: Incorrect key file for table - Stack Overflow) or the partition where the database is stored is full (MySQL: #126 - Incorrect key file for table - Stack Overflow).

Thanks @Lukas

We have been using piwik more than 2 years and got these errors recently. As I mentioned we have 50GB free space and piwik running on IIS and database is still working fine after MySQL restart.

Have been tracking 7m rows since last month and recently got this error and previously rows count was 5.5-6.5m .

May be piwik is performing some sorting or grouping which uses MyISAM temp tables that grows very fast and you can see in error, table name is ambiguous i.e. sql7e4_11937d9_2.MYI, though still looking what could cause these error.

Thanks again