• mysql常用命令


    set env

    db_host=136.198.111.110
    db_password=db.3NIoTP7
    db_port=3081
    db_user=order
    db_name=order_from
    db_table=product
    

    备份表

    mysqldump -h${db_host} -u${db_user} -p${db_password} -P${db_port} ${db_name} ${db_table} > /tmp/${db_table}_`date +%F-%H-%M-%S`.sql
    create table ${db_table}.bak select id,modified,bid,status from ${db_table} limit 100;
    

    还原表

    mysql -h${db_host} -u${db_user} -p${db_password} -P${db_port} ${db_name} < /tmp/${db_table}.sql
    mysql -h${db_host} -u${db_user} -p${db_password} -P${db_port} ${db_name}; source /tmp/${db_table}.sql
    

    mysql.cnf

    # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; version 2 of the License.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
    
    #
    # The MySQL  Server configuration file.
    #
    # For explanations see
    # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
    
    [mysqld]
    pid-file	= /var/run/mysqld/mysqld.pid
    socket		= /var/run/mysqld/mysqld.sock
    datadir		= /var/lib/mysql
    #log-error	= /var/log/mysql/error.log
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    
    character-set-server=utf8
    
    
  • 相关阅读:
    学习jQuery必须知道的几种常用方法
    Jquery技巧总结
    代码测试
    NOIP2003 神经网络
    NOIP2003 传染病控制
    NOIP2003 加分二叉树
    NOIP2004 虫食算
    NOIP2004 合唱队列
    NOIP2004 合并石子
    NOIP2004 津津的储蓄计划
  • 原文地址:https://www.cnblogs.com/firewalld/p/14744608.html
Copyright © 2020-2023  润新知