Windows下Mysql 5.7.19 開啟bin-log以及mysql配置

來源:互聯網
上載者:User

標籤:mysql 5.7 binlog

一、配置環境:

OS:Win10

Mysql:5.7.19


二、我的Mysql設定檔(my.ini)如下:

[client]port=3306default-character-set=utf8[mysqld] #Path to install software directory basedir=E:\mysql-5.7.19#Path to the database directorydatadir=G:\mysql_data#Port Numberport=3306#created  and no character set is definedcharacter_set_server=utf8#Set the SQL mode to strictsql_mode="NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES"explicit_defaults_for_timestamp=true# Binary Logginglog-bin=mysql-binbinlog-format=Row#The default storage engine that will be used when create new tables whendefault-storage-engine=INNODB#General and Slow logginglog-output=FILEgeneral-log=0general_log_file="yuri.log"slow-query-log=1slow_query_log_file="yuri-slow.log"long_query_time=10#Error Logginglog-error="yuri.err"#Server IDserver-id=201609

備忘:

   在MySQL 5.7.3 及以後版本,如果沒有設定server-id, 那麼設定binlog後無法開啟MySQL服務. (Bug #11763963, Bug #56739)


另外一種配置方式:

#log_bin=ON#log_bin_basename=G:\mysql_data\mysql-bin#log_bin_index=G:\mysql_data\mysql-bin.index

不過預設也是上面這樣的

三個參數含義:

第一個參數是開啟binlog日誌

第二個參數是binlog日誌的基本檔案名稱,後面會追加標識來表示每一個檔案

第三個參數指定的是binlog檔案的索引檔案,這個檔案管理了所有的binlog檔案的目錄


三、啟動mysql 測試並檢查是否看起成功,如可以看到啟動成功

650) this.width=650;" src="https://s2.51cto.com/wyfs02/M02/03/C6/wKiom1mf38KyBleuAABfrYgWKwg819.jpg-wh_500x0-wm_3-wmp_4-s_3322542542.jpg" title="binlog.jpg" alt="wKiom1mf38KyBleuAABfrYgWKwg819.jpg-wh_50" />

本文出自 “老白的部落格” 部落格,請務必保留此出處http://laobaiv1.blog.51cto.com/2893832/1959360

Windows下Mysql 5.7.19 開啟bin-log以及mysql配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.