Single Instance login MySQL:
Mysql/mysql-uroot suitable for just after installation no password mysql-uroot-p Standard login method mysql-uroot-p ' password ' password plaintext will reveal the password, generally used in scripts, script permissions root 700
Multi-instance login MySQL:
Mysql-s/data/3307/mysql.sock Suitable for no password mysql–uroot–p111–s/data/3306/mysql.sockmysql–uroot–p–h 127.0.0.1–p3306 suitable for FAR Cheng Login
How to modify the MySQL prompt:
Mysql>prompt \[email protected] \r:\m:\s->my.cnf configuration file [mysqld] module add prompt=\\[email protected] \\r:\\m:\\s->
Prevent history from leaking passwords:
History-c Clear All command history history-d [command number] Clearly specify the line number of the command with password information histcontrol=ignorespace the command with a password before adding a space, it will not be recorded in the history
Launch MySQL:
Quitexit
MySQL Login exit