How to Enable Binary Logging for MySQL Server on Windows and Linux Machine - MySQL DBA Tutorial

MySQL Binary Logging in MySQL Server


The binary log contains a record of all changes ( CREATE, ALTER, INSERT, UPDATE and DELETE) to the databases, both data and structure.
It consists of a set of binary log files and an index file which contains name of binary log files. The data is saved in binary format.

Binary Log File in Windows:


If Binary logs are enabled without providing the location for binary log file, then by default location for the binary log will be "C:\ProgramData\MySQL\MySQL Server 8.0\Data" and file name will be "HostName-bin.00000x".

To make change for binary log file location and name , you can go to my.ini file on below path
"C:\ProgramData\MySQL\MySQL Server 8.0", Look for
# Binary Logging.
log-bin="ProvideBinaryLogFileName-bin"


Binary Log File in Linux:

The default location for Binary log file for MySQL installed on Linux is /var/lib/MySQL. If you need to make changes to default location and binary file name, you can go to /etc/my.cnf file and update it.

Read Binary Log File: 

To read binary log file in Windows, you need to go to bin folder where mysqlbinlog application exists and then use below command on cmd.

mysqlbinlog -v binary-log-filename.00000X


On Linux, you should be able to run the same command. mysqlbinlog is the program that is used to read the binary log file into more readable format.


MySQL Logging Tutorial - How to Enable Binary Logging in MySQL in Windows and Linux

14 comments:

  1. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! Forex Trading Signals

    ReplyDelete
  2. Likewise, don't get into Forex exchanging a clear record. You should go out and gain proficiency with as well as can be expected about Forex exchanging to give you a head start on the rest.Candlestick

    ReplyDelete
  3. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. pocket Option Forex

    ReplyDelete
  4. I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. wallstreet forex robot

    ReplyDelete
  5. It is a good site post without fail. Not too many people would actually, the way you just did. I am impressed that there is so much information about this subject that has been uncovered and you’ve defeated yourself this time, with so much quality. Good Works! Learn to Trade Forex

    ReplyDelete
  6. Your blog is too much amazing. I have found with ease what I was looking. Moreover, the content quality is awesome. Thanks for the nudge! Best Binary options Broker Reviewed

    ReplyDelete
  7. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Binary Options Trading on Autopilot

    ReplyDelete
  8. This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. Binary Options Strategy PDF

    ReplyDelete
  9. i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. Quotex Experience and Review

    ReplyDelete
  10. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. VFX Alerts Trading Signals

    ReplyDelete
  11. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks binary trading

    ReplyDelete
  12. I think that thanks for the valuabe information and insights you have so provided here. free options signals

    ReplyDelete