mysql -h localhost -u root 
这样登录试一试

解决方案 »

  1.   

    我试了mysql -h localhost -u root登陆,问题依旧
      

  2.   

    不是吧,那你在你的系统配置文件 my.cnf 或 my.ini 文件中的 [mysqld] 节加入下面一行skip-grant-tables然后重启 MySQL服务,修改你的超级用户密码再将写入的这一行删除,重启服务
      

  3.   

    我试了,不过我在系统里没有找到,my.ini或my.cnf,到是找到了
    my-huge.cnf,my-large.cnf,my-medium.cnf和my-small.cnf四个文件,而且这4个文件里都有
    [mysqld]这一段。所以我就在这4个文件里分别加了这一行。不过,在重起后用mysqladmin修改密码
    的时候,依然提示:unable to change password;error:'access denied for user:'@localhost' to 
    database 'mysql'
      

  4.   

    你的是什么系统??
    如果是 WIN 系统,在系统目录下建立一个 my.ini 文件,如果是 Linux 系统,就需要在 etc 目录下建立一个 my.cnf 文件文件内容就是我上面所述的!
      

  5.   

    哦,谢谢了,我的是linux
    我去试试,就加一段
    [mysqld]
    skip-grant-tables
    是吗?
      

  6.   

    哈哈,果然是高手,能建立数据库了。不过用mysqladmin还是改不了密码,出现权限问题的提示:
    unable to change password;you must have privileges to update tables in the mysql database
    to be able to  change passwords for others。
    use mysql;时也会出现:
    reading table information for completion of table and column names.you can turn off this feature
    to get a quicker startup with -A(不知道这是不是正常现象)