引用其它:
Edit /etc/security/limits.conf and add the following lines
mysql soft nofile 65535
mysql hard nofile 65535
then reboot.
Then edit /usr/lib/systemd/system/mysqld.service or /usr/lib/systemd/system/mariadb.service and add
LimitNOFILE=infinity
LimitMEMLOCK=infinity
Then restart the db service:
systemctl reload mariadb.service
注:open-files-limit, 改在 [mysqld_safe]内
/etc/my.cnf
[mysqld_safe]
open-files-limit = 65535
修改了mysql.server有可能需要systemctl daemon-reload