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)
  • 相关阅读:
    在线程中进行读取并写入文件和wenjia
    Java里的IO流里的FileInputStream 的读取并在前打印行数!
    C++基础知识(前言)
    linux shell 笔记
    AngularJS图片上传功能的实现
    jQuery中事件绑定
    项目实践中--Git服务器的搭建与使用指南
    javascript跨浏览器事件对象类库
    完美运动框架(js)
    浅谈js中继承的理解和实现
  • 原文地址:https://www.cnblogs.com/blsnt/p/9884258.html
Copyright © 2011-2022 走看看