Use the awk tool in cygwin to view mysql binlog logs

Source: Internet
Author: User

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. for initial debugging, run the first command: The ls command. Check the current directory file and find that there are no files (check cd/and ls, which is 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 and find it is the third command:/cygdrive/c/Users/myhome. If you know the directory structure, you only need to find the file you want to open, see the following: more/cygdrive/c/Users/Desktop/binlog.20.33, and then the full screen is completely invisible. 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) So, you can use a variety of commands, although apt-get, su, yum and other commands are not available, however, other operations can be used ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.