Mysql Error Solved : [Warning] Changed limits: max_open_files: 1024
If you have a Server that has huge Database load, then you might have faced these Mysql errors. The easy solution to this problem is to upgrade the default Mysql Server Configuration File values and apply them.
Usually this error Arises when People Upgrade Mysql server from old version. “open_file_limit” and “Max_connections” are very important features that needs update as well. Applying changes to these values won’t take affect, if we don’t make changes into the system variables as well. In this article we will learn how to apply these changes on Ubuntu 18.04.
From Ubuntu 15 onwards everything shifted from Upstart to Systemd, due to that all the values in /etc/security/limits.conf doesn’t work. All the Mysql limits are defined in Systemd Configuration file.
[Warning] Changed limits: max_open_files: 1024 (requested 5000) [Warning] Changed limits: table_open_cache: 431 (requested 2000)
If you got the above mentioned error in the Mysql Server Log file then you need to apply the following changes. Execute the following command on the terminal.
mkdir /etc/systemd/system/mysqld.service.d
Now in this location add another file “limit.conf” . In this file add the following values.
[Service] LimitNOFILE = 65535
After this reload then systemd and mysql for the new values.
systemctl daemon-reload systemctl restart mysql
Done, now to verify if the new changes are available in the system, we need to login into the MySQL server and execute the following command.
mysql> show variables like '%file%';
the output of this command should be our newly implemented value.
mysql> show variables like '%file%'; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | open_files_limit | 65535 | +------------------+--------+
The changes have been successfully implemented on the server and your Mysql Error Solved.
I hope this tutorial has helped you to fix the Mysql Update issues on the server. If you have any questions then add them on comments section.
Do Checkout our Latest LAMP stack Setup on Ubuntu 20.04 Tutorial.
https://www.myserverfix.com/how-to-setup-lamp-stack-apache-mysql-php-on-ubuntu-20-04-server/