How to clear mysql screen console in windows?

前端 未结 23 2282

The title is my question. I googled and try something like

mysql> !\\ clear
mysql> !\\ cls
mysql> system cls
mysql> system clear 

blah blah ...
         


        
23条回答
  •  余生分开走
    2020-12-29 01:59

    Well, if you installed MySql Server e.g. Version 5.5. which has it's folder located in:

    C:\Program Files\MySQL\MySQL Server 5.5\bin

    The best way would be to include it in your paths.

    • First run sysdm.cpl applet from run i.e. WinKey + R

    • Navigate to Advanced -> Environment Variables

    • Select PATH and Click Edit.

    • Scroll to the end of the text, and add ";C:\Program Files\MySQL\MySQL Server 5.5\bin" without quotes (Notice the semicolon starting the text, this should only be added if it's not already there),

    Now you can just call:

    start /b /wait mysql -u root -p

    via command prompt.

    To clear the screen now, you can just exit in mysql & call cls

    Kinda trickish hack but does the job.

    If you're using WAMP or other tool, it's even easier!

    Open command prompt and type:

    C:\wamp\mysql\bin\mysql -u root -p

    Enter as normal, then whenever you want to clear screen, do:

    exit or quit

    And then clear using DOS:

    cls

    You can easily re-enter by pressing up twice to get your mysql call command

提交回复
热议问题