標籤: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配置