MySQL Error after update: Changed limits: max_open_files after mysql_upgrade
Hello,
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?
1 Reply
Hello!
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:
https://www.vswsystems.com/mysql-buffered-warning-changed-limits-max_connections-214-requested-800/
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:
First, create
mkdir -p /lib/systemd/system/mysql.service.d/
Then make this .conf file
vi /lib/systemd/system/mysql.service.d/limit_nofile.conf
Add the following line:
[Service] LimitNOFILE=4096
Afterwards, reload daemons and restart mysql:
systemctl daemon-reload
systemctl restart mysql
Hopefully this helps!
-Matt