Delete MySQL History in MySQL Command Line Interface

Do you notice that when you execute any query command in MySQL command line interface, the history can be trace by “Up” key. It might be a security expose when you created a new user via CLI, especially when you server is compromised or some other user sharing the same login trying to look through the historical command you have issued before.

We have a habit of creating user via command line interface, i.e issue the command below;

The command you have issued in the mysql CLI is usually store at user’s directory, i.e

Opps.. You found all the history command? It’s time to clean it up and stop mysql collecting the command you have issued before. There are 2 methods you can do with it;

1. Delete the command issued before

2. Stop collecting the history by redirecting the input into null.

By implementing the second method, it will permanently disable mysql collecting the command you have issued on command line interface.