mysqldump: Got error: 1016: Can't open file: 'some_file' (errno: 24 - Too many open files) when using LOCK TABLES
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.7 (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
This is a report and also the fix. Please patch this so I don't have to any more.
Error:
During run of automysqlbackup I get the following email:
mysqldump: Got error: 1016: Can't open file: 'some_file.frm' (errno: 24 - Too many open files) when using LOCK TABLES
mysqldump: Got error: 1016: Can't open file: 'some_file.frm' (errno: 24 - Too many open files) when using LOCK TABLES
mysqldump: Couldn't execute 'show events': Out of resources when opening file './mysql/event.MYD' (Errcode: 24 - Too many open files) (23)
Solution:
There is an error in the maximum number of open files. The source is not in the kernel configuration!
This solves this problem:
Error: mysql: too much open files error
Changing /lib/systemd/
[Service]
... ... ...
LimitNOFILE=
LimitMEMLOCK=
After that:
systemctl daemon-reload
service mysql restart
Problem goes away (at least until I run an apt update again :-) )
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: mysql-server 5.7.22-
ProcVersionSign
Uname: Linux 4.4.0-119-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
Date: Wed Jun 13 10:06:48 2018
InstallationDate: Installed on 2012-07-01 (2172 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
Logs.var.
MySQLConf.
MySQLConf.
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
MySQLConf.
[mysqld_safe]
syslog
MySQLVarLibDirL
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=nl_NL.UTF-8
SHELL=/bin/bash
SourcePackage: mysql-5.7
UpgradeStatus: Upgraded to xenial on 2016-09-24 (627 days ago)
Thank you for taking the time to report this bug and helping to make Ubuntu better.
We'll look into whether it's appropriate to make this change by default for all users.
> Problem goes away (at least until I run an apt update again
Rather than edit /lib/systemd/ system/ mysql.service, you should override behaviour by creating a /etc/systemd/ system/ mysql.service with the directives you want to override. This is the provided mechanism to make changes to your system that won't get overwritten by future updates.