看到这里http://dev.mysql.com/doc/refman/5.0/en/connecting.html
mysql -u USERNAME -pPASSWORD -h HOSTNAMEORIP DATAbaseNAME
上面的选项表示:
-u: username-p: password (**no space between -p and the password text**)-h: hostlast one is name of the database that you wanted to connect.
查看链接,那里有详细的链接!
如Rick所述,您可以通过不这样传递密码来避免将密码作为命令的一部分传递:
mysql -u USERNAME -h HOSTNAMEORIP DATAbaseNAME -p
编辑此答案的人:请不要在
-p和之间添加空格
PASSWORD



