In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-10-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Check whether the binary log function is enabled: show variables like'% bin%';. If log-bin shows that off is not open, then add log-bin=mysql-bin under [mysqld] in / etc/my.cnf (where mysql-bin is the beginning name of the log file and can be customized).
Mysql mistakenly deleted data files
The first method: this method requires that the binary file is very complete. If there is no table statement in the binary file, you will not be able to recover the table in drop.
Check which binary is being used: show master status; sees mysql-bin.000002
Backup: mysqlbinlog mysql-bin.000002 > test1.sql
Modify sensitive data: for example, drop database xx
Restore: mysql < test1.sql
The second method:
The first step is to see what the name of the binary log file currently in use is: show master status
Check how many binary log files are currently available and their size: show master logs
Second: the command to look at the log file, mainly depends on what sql statements are in the log file, and find out the time point to perform the following recovery operation: / usr/local/mysql/bin/mysqlbinlog mysql-bin.000091 | less
There are two ways to recover from binary log files: one is by time: / usr/local/mysql/bin/mysqlbinlog-- start-datetime '2017-02-140 stop-datetime' 2017-02-140 stop-datetime 12 stop-datetime 59'- 14 013 stop-datetime 31' mysql-bin.000091 | mysql- uroot-time depends on the time
The start time of create table c2 in the image above is 2017-02-14 0:12:59 and the stop time is 2017-02-14 0:13:31
The at xxx,xxx in the second image above is the size. Look at the size: / usr/local/mysql/bin/mysqlbinlog-- start-position=361-- stop-position=574 mysql-bin.000091 | mysql- uroot-proot
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.