1

Why aren't all command that are entered in the MySQL command line saved in the command history?

For example, entering the commands

DROP DATABASE mydb;
CREATE DATABASE mydb DEFAULT CHARACTER SET utf8;
GRANT ALL ON mydb.* TO username@host IDENTIFIED BY 'password';

and then trying to go through the history by pressing さんかく I only see the first two commands.


I'm running MySQL Ver 14.14 Distrib 5.7.17, for osx10.12 (x86_64) installed with Homebrew

asked Feb 16, 2017 at 18:09
1
  • 2
    I suppose is to keep safe admin information, like usernames and passwords. Commented Feb 16, 2017 at 18:15

1 Answer 1

4

There is an option to prevent some commands that contain specific words from being logged. One common practice is not to log commands that has the word password.

This option is called histignore

More info:

https://dev.mysql.com/doc/refman/5.7/en/mysql-command-options.html#option_mysql_histignore https://dev.mysql.com/doc/refman/5.7/en/mysql-logging.html

answered Feb 16, 2017 at 19:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.