Mysql 尝试连接到不同的服务器地址

默认输入mysql时,会连接到本地服务器上,也就是服务器地址为localhost[code]C:\Documents and Settings\YUCHENGHU>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.67-community MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>[/code]你可以使用-h参数来连接到不同IP地址服务器的主机。

连接到地址为127.0.0.1的服务器[code]C:\Documents and Settings\YUCHENGHU>mysql -h 127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.67-community MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>[/code]