Maybe this is helpful:
Our daily mysqldump failed when we moved to Ubuntu LTS 16: Got error: 23: Out of resources when opening file './jamfsoftware...
What we learned:
Ubuntu 16 does not use limits in /etc/security/limits.conf for system services. These limits now apply only to user sessions.
The limits for the MySQL service are defined in the Systemd configuration file, which should be copied from its default location into /etc/systemd
sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/
sudo vim /etc/systemd/system/mysql.service (or your editor of choice)
We added to the bottom of the file:
(since 5000 was requested)
Reloading the Systemd configuration is necessary: sudo systemctl daemon-reload