我使用的是easyphp命令行 输入"\Program Files\EasyPHP 3.0\mysql\bin\mysql" -u root提示 error 1045 <28000> access for user root@localhost using password: yes官方解释为: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?

解决方案 »

  1.   

    您好,谢谢,但是我不知道密码是多少并且问题不是密码不对,是说我不是root user,并且我的主页是:http://127.0.0.1:8080/ 表明我不是root user 。
    官网说:If you enter "127.0.0.1" as hostname, everything is right and MySQL uses the TCP connection.但是我是在我自己的电脑上登录,为啥不是root user?
      

  2.   

    那是你没输入密码无法登录. mysql 默认的root 用户就是root.
    如果不知道密码是多少就直接空回车登录.你是不是装的什么集成安装包?
      

  3.   


    我装的是easyphp,是集成包
    空回车登录不了,出现了所描述的错误
      

  4.   

    那么你就看看easyphp的说明文档 看看默认的mysql 密码是什么.这个肯定有的
      

  5.   


    文档说是出现这种情况不是应该输入密码,而是因为我不是root user为啥?
      

  6.   

    你哪看的文档啊?easyphp?
      

  7.   

    修改 my.ini
    在[mysqld]这个条目下加入
    skip-grant-tablesmysql -u root -p登录后
    mysql> use mysql;
    Database changedmysql> update user set password=password(“新密码”) where user=”root”;修改my.ini 去掉刚添加的部分重启mysql 试看看
      

  8.   

    终于弄好了,感谢您,不过,问题的真实原因应该是我不是root user造成。但是我用自己的笔记本,怎么不是root user?