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

  • 相关阅读:
    智能大数据分析平台用例
    Mapreduce实例——去重
    Mapreduce实例——求平均值
    智能大数据分析平台数据流图
    .net程序设计文件操作
    2021.11.17 Guns框架基本应用
    Guns框架基本知识
    2021.11.16 .net——Windows应用程序开发
    1129每日博客
    1126每日博客
  • 原文地址:https://www.cnblogs.com/chromebook/p/4007041.html
Copyright © 2011-2022 走看看