Use the AWK tool in Cygwin to view mysql binlog logs
Linux tools are really powerful. However, as a person who does not have the right to use Linux machines or who does not use Linux for development, it is really inconvenient to use some commands, a unix-like simulation environment running on windows platform is a free software developed by cygnus solutions, which brings a lot of convenience to the use of some commands.
The first requirement is: binlog logs exported by others, 100 + Mb. It is very slow to open using a windows text editor, and it is almost too slow to be viewed, so I want to select the relevant lines and save them as another small file for easy viewing!
1. The installation of cygwinis detailed. The installation procedure is as follows: run the Installation File setup.exe again.
2. Preliminary debugging and use
The first command is the ls command. Check the current directory file and find that there are no files (check the cd/and ls commands. Is it similar to Linux );
The second command: view the current directory pwd and find/home/myhome; (in windows, you can easily add environment variables, and then quickly open cygwin: Run> minitty, then list the current directory: pwd. The directory is/cygdrive/c/Users/myhome)
The third command: knowing the directory structure, you only need to find the file you want to open, as shown below: more/cygdrive/c/Users/Desktop/binlog.20.33, then, the screen is fully blurred.
Fourth command: since Linux is used, awk must be used as a powerful text processing tool, as shown below: more/cygdrive/c/Users/Desktop/binlog.20.33 | awk-F' @ ''/tab_user [^ _]/{print NR," ==> ", $0} '> filtered-binlog.txt; in this case, the internal volume output to filtered-binlog.txt, it looks much easier. Use other useful commands. Note that the characters in the awk must use double quotation marks, which can be escaped, for example :\".
3. Click setup.exe to install the tool. (No apt-get, no yum, be sure not to conflict with windows)
In this way, you can use a variety of commands. Although apt-get, su, yum, and other commands cannot be used, other operations can be used ~
Install Python MySQLdb in Cygwin
MySQL Data Recovery-binlog
Clear binlog logs in MySQL
How to safely delete binlog logs under MySQL
MySQL -- binlog log data recovery
How does MySQL Delete binlog and restore Data?
Introduction and Analysis of Three MySQL binlog formats
MySQL uses binlog Incremental backup + restore instance
MySQL deletes binlog logs and restores data.
This article permanently updates the link address: