MySQL Got error 24 Too many open files
For ubuntu, see Ubuntu 18.04 MariaDB 10.2 Too many open files
On taking MySQL backup with mysqldump, i get following error
1 2 |
mysqldump: Got error: 1030: "Got error 24 "Too many open files" from storage engine MyISAM" when using LOCK TABLES mysqldump: Error: 'Out of resources when opening file '/tmp/#sql_f68_2.MAD' (Errcode: 24 "Too many open files")' when trying to dump tablespaces |
This is because open_files_limit limit in MySQL. To verify login to MySQL server and run
1 |
select @@open_files_limit; |
This will give you current value of open_files_limit.
To increase, edit /etc/my.cnf file, add
1 |
vi /etc/my.cnf |
Add under [mysqld] section
1 |
open_files_limit = 5000 |
Now restart MySQL server
1 |
systemctl restart mysql |