Environment: MySQL Sever 5.1 + MySQL command line tool
Problem: MySQL command line login
Solve:
command-line logon syntax:
Mysql–u username [–h host name or IP address]–p password
Description: User name is the user you login, host name or IP address is optional, if it is a local connection is not required, remote connection needs to fill in, the password is the corresponding user's password.
Attention:
1. The command is executed under the Windows Command Line window, not the MySQL command line;
2. Input-P can be directly followed by the password, you can also press the return, will prompt you to enter the password, both are the same effect;
3.–p password option is not necessarily to be at the end;
4.–u,-H,-p after no space.
Example:
--Local connection
mysql–uroot-p
--Remote connection
mysql–uwgb–hxxx.xxx.xxx.xxx–p
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/