How to clear mysql screen console in windows?

前端 未结 23 1958

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:56
    mysql> 
    root@xion:~# mysql -uroot -ppassword;
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 33291
    Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> \! clear
    
    0 讨论(0)
  • 2020-12-29 01:57

    On linux : you can use ctrl + L or type command system clear.

    0 讨论(0)
  • 2020-12-29 01:57

    The bug on Windows which most people are talking is probably fixed. Ctrl + L is works for clearing the screen on Windows 10 [Mysql 8]

    0 讨论(0)
  • 2020-12-29 01:58

    I had the same issue, and CTRL+L worked for me on Windows 10.

    0 讨论(0)
  • 2020-12-29 01:58

    Fixed in 8.0.19.

    Previously, the system (!) command for the mysql command-line client worked only for Unix and Unix-like systems. It now works on Windows as well. For example, system cls or ! cls may be used to clear the screen.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题