+ -
当前位置:首页 → 问答吧 → access for user root@localhost using password: yes

access for user root@localhost using password: yes

时间:2011-11-15

来源:互联网

怎么回事? 命令行 输入"\Program Files\EasyPHP 3.0\mysql\bin\mysql" -u root

提示 error 1045 <28000> access for user root@localhost using password: yes

我该如何输入密码?

这样输入错误还是一样:"\Program Files\EasyPHP 3.0\mysql\bin\mysql" -u root YES 


谢谢

作者: superwavelet   发布时间: 2011-11-15

官方解释为:

Only the root user (without password) has the rights to connect to the database. Either modify your scripts to use it, or add the user you need (phpMyAdmin/users and privileges: See phpMyAdmin's documentation for more information).

When you are using a port on your localhost, which you redirect via port-forwarding to another host, MySQL is not resolving the localhost as expected.
Erik Wasser explains: The solution is: if your host is "localhost" MySQL (the command line tool mysql as well) always tries to use the socket connection for speeding up things. And that doesn't work in this configuration with port forwarding.
If you enter "127.0.0.1" as hostname, everything is right and MySQL uses the TCP connection.


我的主页是:http://127.0.0.1:8080/

我难道不是root user?

作者: superwavelet   发布时间: 2011-11-16