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
-
2I suppose is to keep safe admin information, like usernames and passwords.McNets– McNets2017年02月16日 18:15:41 +00:00Commented Feb 16, 2017 at 18:15
1 Answer 1
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