zoukankan      html  css  js  c++  java
  • MySQL刷新事务日志级别设置

    标签(linux): mysql

    笔者Q:972581034 交流群:605799367。有任何疑问可与笔者或加群交流
    # if set to 1 , InnoDB will flush (fsync) the transaction logs to the
    # disk at each commit, which offers full ACID behavior. if you are willing to compromise this safety,
    # and you are running small transactions , you may set this to 0 or 2 to reduce disk I/O to the logs,
    # Value 0 means that the log is only written to the log file and the log file flushed to disk approximately once per second. 
    # Value 2 means the log is written to the log file at each commit , but the log file is only flushed to disk approximately once per second
    innodb_flush_log_at_trx_commit =1
    

    如果设置为1,InnoDB将刷新(fsync)事务日志
    每个提交的磁盘,它提供了完全的ACID行为。如果你愿意在安全问题上妥协,
    你运行的是小的事务,你可以把它设置为0或2来减少日志的磁盘输入,
    值0意味着日志只写到日志文件,日志文件被刷新到磁盘,大约每秒一次。
    值2意味着将日志写入每个提交的日志文件中,但是日志文件只被刷新到磁盘,大约每秒一次。
    innodb_flush_log_at_trx_commit = 1

    mysql修改命令行提示符的方法

    命令行生效
    mysql> prompt u@db01 
    :m:s->
    PROMPT set to 'u@db01 
    :m:s->'
    root@db01 12:35:54->
    root@db01 12:35:55->
    root@db01 12:35:55->
    
    永久生效

    加放/etc/my.cnf [mysql]模块中,注意不是mysqld

    root@db01 12:41:03 mysql->quit
    Bye
    [root@db01 ~]# head /etc/my.cnf 
    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
    # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
    # *** default location during install, and will be replaced if you
    # *** upgrade to a newer version of MySQL.
    
    [mysql]
    prompt=\u@db01 \r:\m:\s mysql->
    
  • 相关阅读:
    SQL
    HTTP协议
    工具命令
    安全策略
    日志与审核
    python视频教程免费下载,百度云网盘资源,全套!
    《Python基础教程(第3版)》PDF电子版百度云网盘免费下载
    老男孩Python全栈开发视频教程全套完整版!免费分享!
    Pycharm激活码分享,2020最新Pycharm永久激活码~
    老男孩Python视频教程全套完整版!无偿分享~
  • 原文地址:https://www.cnblogs.com/Csir/p/7487695.html
Copyright © 2011-2022 走看看