i want to increate open_files_limit = 5000 in my.cnf to open_files_limit= 1048576. i have edited my.cnf file but it not take effect (Restarted mysql). still after that it shows the 5000.
mysql> show variables like ‘%open%files%’;
±------------------±------+
| Variable_name | Value |
±------------------±------+
| innodb_open_files | 2000 |
| open_files_limit | 5000 |
±------------------±------+
2 rows in set (0.00 sec)
cat /lib/systemd/system/mysql.service
MySQL systemd service file
[Unit]
Description=MySQL Community Server
After=network.target
i have tried /usr/lib/systemd/system/mysqld.service to edit LimitNOFILE parameter and restart the systemctl daemon-reload and mysql service but no luck still it shows old value.
Thanks for the update , also i have observed parameter updated in my.cnf file is not reflected even after restart the mysql. i have chnaged max_connections parameter but it still shows old value 4190.
while some parameter is shows properly like innodb_buffer_pool_size and innodb_buffer_pool_instances this parameter i have changed in same file and it shows proper after change. why max_connections parameter shows older value.
i have set max_connections=100000 and table_open_cache=2000 and restart the mysql but still it shows old value and execute mysqld --verbose --help it shows Changed limits: table_open_cache: 400 (requested 2000) , why it not reflecting?
mysql> show variables like ‘%max_connections%’;
±----------------±------+
| Variable_name | Value |
±----------------±------+
| max_connections | 4190 |
±----------------±------+
1 row in set (0.00 sec)
mysql> show variables like table_open_cache;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘table_open_cache’ at line 1
mysql> show variables like ‘%table_open_cache%’;
±---------------------------±------+
| Variable_name | Value |
±---------------------------±------+
| table_open_cache | 400 |
| table_open_cache_instances | 16 |
±---------------------------±------+
2 rows in set (0.00 sec)
mysql> exit
Bye
tungsten@vm-mysql2-prod-sa:/etc/mysql$ mysqld --verbose --help
2022-12-20T13:46:26.955286Z 0 [Warning] Changed limits: max_open_files: 65535 (requested 500000)
2022-12-20T13:46:26.955329Z 0 [Warning] Changed limits: max_connections: 64725 (requested 100000)
2022-12-20T13:46:26.955332Z 0 [Warning] Changed limits: table_open_cache: 400 (requested 2000)
mysqld Ver 5.7.39-0ubuntu0.18.04.2-log for Linux on x86_64 ((Ubuntu))
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Starts the MySQL database server.
Usage: mysqld [OPTIONS]
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
The following groups are read: mysqld server mysqld-5.7
The following options may be given as the first argument:
–print-defaults Print the program argument list and exit.
–no-defaults Don’t read default options from any option file,