注册 登录
编程论坛 MySQL论坛

[求助]MySQL登录求教

亲亲爱民 发布于 2007-04-29 10:16, 1474 次点击
%mysql -h hostname -u username -ppassword databasename
这条命令怎么用?hostname\username 是怎么定义的,怎么得到的?提示符前的路径是怎么样的?

谢谢,这个问题困扰了我很长时间,一直不知所以然。
3 回复
#2
lmhllr2007-04-29 13:22

你是在命令符下的吗?

比如:

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>cd ../

C:\Documents and Settings>cd ../

C:\>cd WebServer

C:\WebServer>cd mysql

C:\WebServer\mysql>cd bin

C:\WebServer\mysql\bin>mysql -h localhost -u root -p
Enter password: ***
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.16-nt

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

mysql>

#3
亲亲爱民2007-04-29 14:24
谢谢,明白了,那从别的机器上远程操作另一台机器上的数据库,那hostname\username又是什么呢?
#4
lmhllr2007-04-30 00:58
首先,远程登陆必须有权限

如果有权限了,host就是那机器的IP或者MYSQL数据库域名,一般用IP就可以了
1