zoukankan      html  css  js  c++  java
  • 单实例MySQL的/etc/my.cnf配置文件

    [root@localhost ~]# vim /etc/my.cnf

    [mysqld]

    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    以上是初始值,可以自己写在/etc下面。

    下面是手动编辑增加:

    binlog_format=mixed  //设置mysql记录二进制的格式是mixed

    binlog_do_db=***  // 表示需要复制的数据库,多个数据库要分开写,全备份可以不写

    binlog_ignore_db=***  // 表示不需要复制的数据库

    default-character-set=utf8

    [mysqld_safe]
    log-error=/var/log/mysql/mysql-error.log  //设置错误日志

    举例:

    [danny@ay-wifi-hz-01 ~]$ cat /etc/my.cnf
    [mysqld]
    #datadir=/var/lib/mysql
    datadir=/opt/rh/mysql55/root/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1

    # Disabling symbolic-links is recommended to prevent assorted security risks;
    # to do so, uncomment this line:
    # symbolic-links=0

    server-id = 50225
    expire_logs_day = 30

    log-bin = /mnt/mysql-binlogs/mysql-bin
    binlog_format = MIXED


    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

  • 相关阅读:
    Common ThreadView
    经典代码IOCP的C#实现(转)
    Common.UdpLib
    Common.TcpLibTcpServerWIOCP
    Common.TcpLibTcpServerY
    sql中将分隔字符串转为临时表的方法
    病毒及流氓软件自我复制的简单实现
    一句sql搞定个人所得税计算
    财务月度的创建及生成
    box2d 教程
  • 原文地址:https://www.cnblogs.com/chromebook/p/4007041.html
Copyright © 2011-2022 走看看