創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),廣元企業(yè)網(wǎng)站建設(shè),廣元品牌網(wǎng)站建設(shè),網(wǎng)站定制,廣元網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,廣元網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
下文主要給大家?guī)?lái)mac如何開啟MySQL bin-log方法,希望這些文字能夠帶給大家實(shí)際用處,這也是我編輯mac如何開啟mysql bin-log方法這篇文章的主要目的。好了,廢話不多說(shuō),大家直接看下文吧。
添加以下配置
expire_logs_days = 5 定期清理 log-bin = /usr/local/var/mysql/mysql_bin_log/mysql-bin #開啟binlog,指定文件聞之 server_id = 1 #配置mysql replication需要定義,不能和canal的slaveId重復(fù) binlog_format=MIXEDD
mysql.server restart // 重啟mysql
show variables like '%log_bin% 查看是否開啟
show master status; 查看日志狀態(tài)
flush logs; 刷新日志,刷新之后會(huì)新建一個(gè)新的Binlog日志
reset master 清空目錄下所有日志文件
查看日志文件:mysqlbinlog --base64-output=DECODE-ROWS -v mysql-bin.000001
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #200423 16:43:25 server id 1 end_log_pos 123 CRC32 0xb303c132 Start: binlog v 4, server v 5.7.29-log created 200423 16:43:25 at startup # Warning: this binlog is either in use or was not closed properly. ROLLBACK/*!*/; # at 123 #200423 16:43:25 server id 1 end_log_pos 154 CRC32 0x21d20383 Previous-GTIDs # [empty] # at 154 #200423 16:45:11 server id 1 end_log_pos 219 CRC32 0xfb334efd Anonymous_GTID last_committed=0 sequence_number=1 rbr_only=no SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/; # at 219 #200423 16:45:11 server id 1 end_log_pos 295 CRC32 0xb8e6b396 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1587631511/*!*/; SET @@session.pseudo_thread_id=4/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=1436549152/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; # at 295 #200423 16:45:11 server id 1 end_log_pos 626 CRC32 0xa15900c0 Query thread_id=4 exec_time=0 error_code=0 use `chunyu`/*!*/; SET TIMESTAMP=1587631511/*!*/; UPDATE `article_article` SET `created_time` = '2020-04-23 08:17:20.953805', `last_modified` = '2020-04-23 08:45:11.324532', `user_id` = 1, `title` = '1', `content` = '999999', `status` = 1, `comment_count` = 0, `star_count` = 0 WHERE `article_article`.`id` = 2 /*!*/; # at 626 #200423 16:45:11 server id 1 end_log_pos 657 CRC32 0xeb7a6863 Xid = 14 COMMIT/*!*/; SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/; DELIMITER ; # End of log file /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
對(duì)于以上關(guān)于mac如何開啟mysql bin-log方法,大家是不是覺(jué)得非常有幫助。如果需要了解更多內(nèi)容,請(qǐng)繼續(xù)關(guān)注我們的行業(yè)資訊,相信你會(huì)喜歡上這些內(nèi)容的。