zoukankan      html  css  js  c++  java
  • Mysqldump备份问题

    1.1 Mysqldump文件数打开过多

    mysql> mysqldump -uroot -p131400 --all-databases >/backup/mysql.sql
    mysqldump:Goterror:1105:File’./db/data_20070901.MYD’notfound(Errcode:24)whenusingLOCKTABLES

    解决方法:

    登陆数据库查看最大文件打开数为多少

    mysql> show variables like '%open%';
    +----------------------------+----------+
    | Variable_name              | Value    |
    +----------------------------+----------+
    | have_openssl               | DISABLED |
    | innodb_open_files          | 2000     |      
    | open_files_limit           | 5000     |        这个为5000
    | table_open_cache           | 2000     |
    | table_open_cache_instances | 1        |
    +----------------------------+----------+
    5 rows in set (0.00 sec)

    mysql配置文件中/etc/my.cnf中添加open_files_limit = 65535重启数据库,如果还不生效,那就修改数据库的启动脚本

    vim /etc/systemd/system/mysql.service
    在mysql.service中添加
    [Service]
    User=mysq
    Group=mysql
    LimitNOFILE=65535  #新加入的内容 添加在最后一行

    重启服务,修改了mysql.server有可能需要

    systemctl daemon-reload

    修改系统配置文件/etc/security/limits.conf  

    * soft nofile 65535
    * hard nofile 65535

    登陆数据库查看

    mysql> show variables like '%open%';
    +-------------------+----------+
    | Variable_name     | Value    |
    +-------------------+----------+
    | have_openssl      | DISABLED |
    | innodb_open_files | 300      |
    | open_files_limit  | 65535    |   已经变为65535
    | table_open_cache  | 512      |
    +-------------------+----------+
    4 rows in set (0.00 sec)
  • 相关阅读:
    轮廓 | outline (Basic User Interface)
    转换 | CSS Transitions (Animations & Transitions)
    越线 | line-break (Text)
    贴士和技巧 | CSS Animations: Tips (Animations & Transitions)
    负 | @counter-style.negative (Counter Styles)
    调整 | resize (Basic User Interface)
    再见乱码:5分钟读懂MySQL字符集设置
    git
    Python 内存&函数调用关系图
    Python 笔记
  • 原文地址:https://www.cnblogs.com/blsnt/p/9884258.html
Copyright © 2011-2022 走看看