Option 1) Adding this to /etc/security/limits.conf

mysql           soft    nofile          65535
mysql           hard    nofile          65535


Option 2)Modifying systemd configuration file

# vim /etc/systemd/system/mysql.service

And you will need to add following lines

LimitNOFILE=infinity
LimitMEMLOCK=infinity

For your information, you can put correct numbers instead of infinity



https://stackoverflow.com/questions/30901041/can-not-increase-max-open-files-for-mysql-max-connections-in-ubuntu-15/30918749