|
引自:(http://forum.java.sun.com/thread.jspa?threadID=670717&messageID=3921118)
localhost and 127.0.0.1 are not treated the same in MySQL. You need another GRANT statement for that user with "user@127.0.0.1" rather than "user@localhost" or "user@localhost.localdomain"
不知道大家遇见过没有,同一个用户和同一个数据库,在WinXP的PHP和Java下都可以使用,可是到了Linux(我只试过Debian)下,只有PHP能用,Java却不能用了。提示Access denied for user: 'root@localhost.localdomain',或者其它,看起来很古怪。
后来在Google,找到上面这个比较满意的答案,把问题解决了。
不过,我认为这应该与主机名的设置有关吧。不知道LinuxSir的高手有更满意的答案吗? |
|