Linux login MySQL server is generally the command line to manually enter the link information
[Email protected] ~]# mysql-hlocalhost-uroot-p11111
In the case of MySQL 5.6, there will be security prompts when you log in.
Warning:using a password on the command line interface can be insecure
In order to avoid this hint, and in order not to enter the user name, password every time, you can use a more secure and simple method
Simply configure the MY.CNF client section to write the user name and password information to the client section
# The following options would be passed to all MySQL clients[Client]host = "localhost"
user = "Root"
Password = "11111"
Port = 3306Socket =/tmp/mysql.sock
or write to a separate file, such as/ETC/MYSQL.PWD.CNF, content:
[MySQL]
host = "localhost"
user = "Root"
Password = "11111"
Port = 3306Socket =/tmp/mysql.sock
When logging in, specify this file to log in
[[email protected] ~]# MySQL--DEFAULTS-FILE=/ETC/MYSQL.PWD.CNF
or specify a library login:
[[email protected] ~]# MySQL--DEFAULTS-FILE=/ETC/MYSQL.PWD.CNF library name
Linux login MySQL server does not need to enter the account password information