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)
  • 相关阅读:
    使用mybatis如果类属性名和数据库中的属性名不一样取值就会为null
    学习mybatis时出现了java.io.IOException: Could not find resource EmployeeMapper.xml
    配置mybatis-config.xml出现过很诡异的现象
    mybatis学习(一)
    报错cannot be cast to javassist.util.proxy.Proxy
    列车调度
    三角形
    土豪聪要请客(stol)
    Jams倒酒(pour)
    Data
  • 原文地址:https://www.cnblogs.com/blsnt/p/9884258.html
Copyright © 2011-2022 走看看