故障截圖
解決辦法
vim /usr/lib/systemd/system/mariadb.service
#在[service]下面加
[Service]
LimitNOFILE=infinity
驗證
systemctl daemon-reload
systemctl restart mariadb
systemctl status mariadb
拓展
MySQL報錯 “Could not increase number of max_open_files to more than 1024“
修改內核參數
vim /etc/security/limits.conf * soft nofile 8192 * hard nofile 8192
重啟系統或臨時修改內核參數
# ulimit -n 8192 systemctl restart mysqld