How to clear MySQL Console Screen


Working with MySQL on Terminal (Command Line or another console) is one of the ways many developers prefer to access the Database servers, at times one might want to flush the screen and then run the SQL statement, cls or clear commands won't work, let's see how to do it,

mysql> mysql> select *
    -> from my_table
    -> where name='abc';


mysql> \! clear

You can make use of the command "\! clear", backslash and exclamation is can be used in terminal to clear system shell commands.

Clear mySQL Console Screen

There is another way, if you want to just clear one command executed at a time, you can make use of Command + L on macOS, Control + L on Linux devices like Ubuntu,

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap