Looking at a MySQL error log showed some interesting new errors. Here is the log file:
2025-02-23T06:43:15.664775Z 0 [Warning] [MY-010140] [Server] Could not increase number of max_open_files to more than 10000 (request: 40000) 2025-02-23T06:43:15.785837Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead. 2025-02-23T06:43:15.785853Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.41) starting as process 3669 2025-02-23T06:43:15.811206Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=1073741824. Please use innodb_redo_log_capacity instead. 2025-02-23T06:43:15.813025Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-02-23T06:43:16.518270Z 1 [ERROR] [MY-013895] [InnoDB] Found redo log file ./#innodb_redo/#ib_redo126249 which has format (v0) and is stored inside #innodb_redo. 2025-02-23T06:43:16.518388Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-02-23T06:43:16.939279Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-02-23T06:43:16.939546Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-02-23T06:43:16.939600Z 0 [ERROR] [MY-010119] [Server] Aborting
This MySQL server actually crashed and never came back up again. In the end a full restore of over 100 databasis had to take place.
But for this article we’ll only focus on the error, “Could not increase number of max_open_files to more than 10000 (request: 40000)”.
First of all, this is a WHM server. By all accounts you have to at least check this setting:
WHM > Tweak settings > Allow cPanel & WHM to determine the best value for your database service’s open_files_limit configuration?
cPanel & WHM will use your total number of tables to adjust the open_files_limit value during each database server restart.
But since this is already a default, why this error? As mentioned, this server was crashing.
The next place to look at the open files allowed limit is `/usr/lib/systemd/system/mysql.service`. This is the systemd configuration for the service. Here you see my attempt to increase the limit:
[Service] User=mysql Group=mysql Type=notify ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre ExecStart=/usr/sbin/mysqld TimeoutSec=0 # name_surname date - attempt to increase file limits #LimitNOFILE = 10000 LimitNOFILE = 40000 Restart=on-failure RestartPreventExitStatus=1
It didn’t work. In the end, this was the solution:
cat /etc/security/limits.conf ... mysql soft nofile 40000 mysql hard nofile 50000