MySQL command line logon example: mysql command line Logon
Environment: MySQL Sever 5.1 + MySQL command line tool
Problem: MySQL command line Logon
Solution:
Command Line logon Syntax:
Mysql-u user name [-h host name or IP address]-p Password
Note: The user name is the user you log on to. The host name or IP address is optional. If you are using a local connection, you do not need it. You need to enter the remote connection. The password is the password of the user.
Note:
1. This command is executed in the Windows command line window, rather than the MySQL command line;
2. Enter-p to keep up with the password, or press enter to prompt you to enter the password, both of which have the same effect;
3. The-p password option is not always at the end;
4. There is no space after-u,-h, and-p.
Example:
-- Connect to mysql locally-uroot-p -- remotely connect to mysql-uwgb-hXXX. XXX-p