zoukankan      html  css  js  c++  java
  • Mysql 报错 [Server] Error in accept: Too many open files

    查看Mysql日志/var/log/mysqld.log,有如下报错:

    2019-05-28T15:08:16.325376Z 0 [ERROR] [MY-010283] [Server] Error in accept: Too many open files

    Mysql版本:

    # mysql -V 
    mysql Ver 8.0.15 for Linux on x86_64 (MySQL Community Server - GPL)

    CentOS Linux 7 (Core)

    解决方法:

    查看当前Mysql数据库设置的open_files_limit值:
    mysql> show variables like '%open%';

    查看当前Mysql运行状态下的Open_files值:
    mysql> show status like '%opene%';

    1.  Change system open file limit on the fly(dynamically). 先修改服务器,修改open files限制为65535.
    # ulimit -n 65535
    # ulimit -Hn
    65535
    # ulimit -Sn
    65535
    # ulimit -n
    65535
    # ulimit -a

    2. Change Mysql open file limit
    vi /usr/lib/systemd/system/mysqld.service
    LimitNOFILE=65535
    LimitNPROC=65535

    vi /usr/lib/systemd/system/mysqld.service
    # Sets open_files_limit
    LimitNOFILE = 65535

    vi /etc/security/limits.conf
    mysql hard nofile 65535
    mysql soft nofile 65535

    # vi /etc/systemd/system/multi-user.target.wants/mysqld.service
    # Sets open_files_limit
    LimitNOFILE = 65535

    4.  Reload and Restart Mysqld to take effect.
    systemctl daemon-reload && systemctl restart mysqld

    重启后确认设置生效
    mysql> show variables like '%open%';

  • 相关阅读:
    pam_cracklib module
    转:ubuntu svn
    fw: subversion+apache config
    转:jenkins 简介
    fw:java 10大必知技术
    FW: Linux 搭建 csvn 服务器。
    转:修改svn 端口号
    转:Ubuntu搭建jenkins
    转:vmware workstation的三种网络连接方式。
    图像处理之直方图均衡
  • 原文地址:https://www.cnblogs.com/rusking/p/13303485.html
Copyright © 2011-2022 走看看