Terminal (command line) connected MySQL

mysql -h hostname (ip) -u user name -p -P port

-h:  Host name represents the host name of the database you want to connect or IP

-u:  username, connection to the database user name

-P:  (uppercase) port is a port to connect to a database, the default is 3306, you can not write, but if the port is not the default port, you must specify the port number

-p:  password in the database you want to connect, behind -p can directly enter the password, but this is less secure password is in plain text, it is recommended that you enter -p carriage return, line password

Mentioned above through the command line to connect to MySQL standard mode, the port if you installed MySQL on its own native and is the default port 3306, then the line connecting MySQL native command do not explicitly specify the host name and port number, more simple and direct manner using the following

Guess you like

Origin www.cnblogs.com/xtmp/p/12597788.html