MySQL Error after update: Changed limits: max_open_files after mysql_upgrade
Recently, /var/log/mysql/error.log was clogging up with huge numbers of this warning:
[Warning] Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade
So I ran mysql_upgrade, apparently successfully. I just want to check about two Warning messages in error.log when I restart mysql:
[Warning] Changed limits: max_open_files: 1024 (requested 5000)
[Warning] Changed limits: table_open_cache: 431 (requested 2000)
What is the cause of this/ What can I do to fix it?
It appears that certain values that handle these limits can be reset after running upgrades. The process here is basically increasing the open file limit to accommodate your configuration.
I found a few pages discussing this error that will also walk you through the resolution:
This will have you creating a configuration file and setting a new limit for it. For example, here are the instructions for Debian based distributions using systemd:
mkdir -p /lib/systemd/system/mysql.service.d/
Then make this .conf file
Add the following line:
Afterwards, reload daemons and restart mysql:
systemctl restart mysql
Hopefully this helps!