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)
  • 相关阅读:
    3D切割轮播图
    网站公共部分的复用
    Git的安装及布置
    完整轮播图
    百度检索例子
    第五章 pycharm编辑器安装和使用
    第四章 散列类型的方法
    第一章 认识爬虫以及环境安装
    主机访问Ubuntu虚拟机的jupyter
    12306购票的testerSunshine带源码刷票
  • 原文地址:https://www.cnblogs.com/blsnt/p/9884258.html
Copyright © 2011-2022 走看看