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,

Have Questions? Post them here!
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.