你用root身份可以连接吗?因为这里不知道你的admin到底是否真正有权限???摘自mysql帮助: If you get an error message where the hostname is not shown or where the hostname is an IP, even if you try to connect with a hostname: shell> mysqladmin -u root -pxxxx -h some-hostname ver Access denied for user: 'root' (Using password: YES)This means that MySQL got some error when trying to resolve the IP to a hostname. In this case you can execute mysqladmin flush-hosts to reset the internal DNS cache. See section How MySQL uses DNS. Some permanent solutions are: Try to find out what is wrong with your DNS server and fix this. Specify IPs instead of hostnames in the MySQL privilege tables. Start mysqld with --skip-name-resolve. Start mysqld with --skip-host-cache. Connect to localhost if you are running the server and the client on the same machine. Put the client machine names in /etc/hosts.
同一个名字,不同主机,是不同的用户'[email protected]' 和 '[email protected]' 是两个用户(除非你把 Host 设置成 "%")你得为 '[email protected]' 用户设置密码:mysql -u root mysql mysql> INSERT INTO user (Host,User,Password) VALUES('192.168.0.1','admin',password('1234')); mysql> FLUSH PRIVILEGES;或者 mysql -u root mysql mysql> INSERT INTO user (Host,User,Password) VALUES ('%','admin',password('1234')); mysql> FLUSH PRIVILEGES;
上面的密码必须用 password('1234'),不能直接用 '1234'(你的问题也可能是因为这个)另外,安装 MYSQL 后必须用 mysql_install_db 初始化权限设置
改成192.168.0.6就ok了要不他用的名还是localhost又是连其它机器当然不行.
用linux上的phpMyAdmin连时,我只设用户名为admin,但他自己会加上
admin@本机IP地址。但Win2000上校验用户时是校验admin@localhost,两台机子的IP地址不同,一个是[email protected] 一个是[email protected]
所以无法登录。问题就在这,怎么解决。急哪!!!!
$cfg['Servers'][$i]['host'] = '192.168.0.6'; // MySQL hostname
$cfg['Servers'][$i]['user'] = 'admin'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed2、还要注意MYSQL数据库的admin这个用户是否允许远程连接。
platinum(白金) 你的图片说明很有提示性,但是我现在连phpMyAdmin都连接不上MySql,根本无法设置MySql的参数,它对应的配置文件是哪一个?
改成
$cfgPmaAbsoluteUri = 'http://192.168.0.6/myadmin/';
-_-_-_-_-_-_只做参考-_-_-_-_-_-_
操作系统:Linux(Redhat 7.3)
IP地址: 192.168.0.1
Web服务:Apache2 v2.0.40
脚本服务:PHP4
数据库服务器配置:
操作系统:Windows 2000 AS
IP地址: 192.168.0.6
数据库服务:MySql v3.23.52为了管理MySql,在Web服务器上安装了phpMyAdmin 2.2.6
config.inc.php配置如下:$cfgPmaAbsoluteUri = 'http://192.168.0.1/phpMyAdmin/';
。
$cfgServers[$i]['host'] = '192.168.0.6'; // MySql服务器地址
$cfgServers[$i]['port'] = '3306'; //服务端口
$cfgServers[$i]['user'] = 'admin'; // 管理员用户
$cfgServers[$i]['password'] = '1234'; //密码了!数据库服务器MySql设定管理员和密码与上对应。
在其它计算机上访问:“http://192.168.0.1/phpMyAdmin/”
页面报错如下:
“
Error
MySQL said:
Access denied for user: '[email protected]' (Using password: YES)
”
为什么用户变成“[email protected]”而不直接是“admin”,MySql当然不识别这个带尾巴的用户。这是什么原因造成,是PHP的配置问题还是phpMyAdmin的配置问题,还是MySql配置的问题?或者说它们根本就不支持访问远端数据库?
请各位高手帮帮忙呀,先谢了!
If you get an error message where the hostname is not shown or where the hostname is an IP, even if you try to connect with a hostname:
shell> mysqladmin -u root -pxxxx -h some-hostname ver
Access denied for user: 'root' (Using password: YES)This means that MySQL got some error when trying to resolve the IP to a hostname. In this case you can execute mysqladmin flush-hosts to reset the internal DNS cache. See section How MySQL uses DNS. Some permanent solutions are:
Try to find out what is wrong with your DNS server and fix this.
Specify IPs instead of hostnames in the MySQL privilege tables.
Start mysqld with --skip-name-resolve.
Start mysqld with --skip-host-cache.
Connect to localhost if you are running the server and the client on the same machine.
Put the client machine names in /etc/hosts.
和
'[email protected]' 是两个用户(除非你把 Host 设置成 "%")你得为 '[email protected]' 用户设置密码:mysql -u root mysql
mysql> INSERT INTO user (Host,User,Password) VALUES('192.168.0.1','admin',password('1234'));
mysql> FLUSH PRIVILEGES;或者 mysql -u root mysql
mysql> INSERT INTO user (Host,User,Password) VALUES ('%','admin',password('1234'));
mysql> FLUSH PRIVILEGES;
你先在装mysql的服务器登陆mysql,
然后
mysql>INSERT INTO user VALUES ('', 'admin', PASSWORD('1234'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');然后再
mysql>FLUSH PRIVILEGES;就行了
http://www.csdn.net/Expert/TopicView1.asp?id=931436
哦,就是 nne998(上上下下左右左右BABA) 没给分呀,哈,我对你偏心了,你在我发的另一帖(同样问题,在mysql类中)中也热心回答了,我在那给分。
实际上只要看“mysql”数据库中的user数据表都明白了。
我是新手呀,不要见怪,不过说实话mysql真的不好用,先不管功能怎么样,单就这个用户分配的操作就烦死了。
我一出来就编程,但就从来没搞过数据库编程,但Oralce有玩过,DB2有玩过,Sql Server也玩过,这些数据库从功能上说,已渐渐拉近距离,就看这些厂商提供的一些特色功能服务了。不过用起来还是Sql Server操作简单方便,就是一目了然了。我可不喜欢用什么命令行,别以为操作一些什么命令很熟悉就是高手,说白了也是浪费时间呀。
但在UNIX与LINUX这之类的系统,如没有提供X Window Server服务,想用图形界面也难呀,哈,不过人真是太聪明了,想着法子方便与用户,这不,phpMyAdmin这之类的Web数据库管理程序出来了。
为了安全性,Web服务器总是要与数据库服务器分开,为了搞一个Web服务器我可是花了两天两夜的时间才搞定,不过我是Linux新手也是php新手,而且是apache2新手,Internet就是好,什么问题都通过Internet解决了,实际上这此软件的操作与安装说明都是很详细的,建议做什么之前还是先看本身软件自带的操作说明各一些执行命令的帮助是明智的。为了定制自己的Web服务,不得不下载源码,编译配置,编译安装。
不明白的人还以为要自己去修改源程序,呵,很恐怖吧,实际上也不需要修改源程序,只是要懂得编译配置,哪些模块要,哪些不要,但有时会有这样的情况某个模块执行总有问题,很急人呢,不要着急,先到它的官方网站,搜索一下,看人家有没有出现过类似的问题,呵呵,一般都有,看看他们是怎么解决的。哈,只要修改源程序中的一处,甚至只是简单地把NULL改为0,然后自个儿编译一下,一切都解决了。所以说源代码开放也很有好处呀,但看到那一大串的稀稀花花的程序配置字符就头疼。哎,感慨呀!
好了,祝大家好运了!