mysql版本MariaDB 10.0.29
查看版本 select version();
[root@db1 system]# cat /usr/lib/systemd/system/mariadb.service | grep exam -A 5
# For example, if you want to increase mariadb's open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/mariadb.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
重启mysql 提示
mariadb.service changed on disk. Run 'systemctl daemon-reload' to reload units
运行 systemctl daemon-reload
重启mysql
查看mysql>show global variables like '%open%';
完美搞定