Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to avoid the pit of Mysql's mysql-bin file

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to avoid the pit of Mysql mysql-bin file, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

The mysql-bin of mysql is the operation log of the database.

For example, UPDATE a table, or DELETE some data, even if the statement does not have matching data, this command will be stored in the log file, including the execution time of each statement, will also be recorded. This is done for the following two main purposes: 1: data recovery if there is something wrong with your database and you have a backup before, you can look at the log file to find out which command caused your database to go wrong and find a way to recover the loss. 2: synchronizing data between master and slave servers all the operations on the master server are in the log, and the slave server can carry out according to the log to ensure the two synchronization. For example: when a single mysql server service is used, you can comment out the corresponding log-bin=/program/mysql/mysql-bin item, add the "#" sign, and then restart the mysql service. 3: if the mysql-bin file fills up the disk, causing the database service not to start normally, and log-bin=/program/mysql/mysql-bin this option is configured in the my.cnf file, but the single database is used, then the process mysql program is still there, but prompts "Can't connect to local MySQL server through socket'/ var/lib/mysql/mysql.sock'(2)" "go to the / program/mysql/ directory and compress all the files with mysql-bin zip. Then delete the original file and start the mysql service. On how to avoid Mysql's mysql-bin file pit to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report