美文网首页
配置文件

配置文件

作者: xilongtao | 来源:发表于2017-02-27 09:30 被阅读0次

    位置

    On Unix and Unix-like systems, MySQL programs read startup options from the files shown in the following table, in the specified order (top files are read first, files read later take precedence).
    翻译:
    在unix和类unix系统中,mysql程序从以下表格列出的配置文件中按顺序读取启动配置项(在上面的先读取,后面的后读取拥有优先生效的权利)

    File Name Purpose
    /etc/my.cnf Global options
    /etc/mysql/my.cnf Global options
    SYSCONFDIR/my.cnf Global options
    $MYSQL_HOME/my.cnf Server-specific options (server only)
    defaults-extra-file The file specified with, if any
    ~/.my.cnf User-specific options
    ~/.mylogin.cnf User-specific login path options (clients only)

    使用

    • comment或者;comment代表注释
    • [group]代表分组,生效于某个命令,例如[client][mysqld]
    • opt_name,没有前导两个横岗,代表选项
    • opt_name=value,没有前导两个横岗,代表选项与值
    • 示例
    [client]
    port=3306
    socket=/tmp/mysql.sock
    
    [mysqld]
    port=3306
    socket=/tmp/mysql.sock
    key_buffer_size=16M
    max_allowed_packet=8M
    
    [mysqldump]
    quick
    
    • 可以使用!include或者!includedir来包含.cnf后缀的其它配置文件
    • 数字值的选项可以使用K,M,G(不区分大小写)作为后缀来代表1024以及它的2次方,3次方

    相关文章

      网友评论

          本文标题:配置文件

          本文链接:https://www.haomeiwen.com/subject/enwbwttx.html