提示给的很清楚呀,
你登录时匹配的是   asdf@localhost
而你建立的用户     asdf@???????????
                   ?? 部分一定不是 localhost ,是用的IP??如果是用的IP,你试试这样
mysql -h 192.168.0.1 -u asdf -p

解决方案 »

  1.   

    我是照着书如下建立的:mysql>grant all
        ->on *
        ->to asdf identified by 'asdf'
        ->with grant option;是不是第三行应该改为
         to asdf@localhost identified by 'asdf'???
      

  2.   

    select  host,user,password 
    from mysql.user后我看到host        user    password
    %         | asdf  | 20d8d1f067d4b572 host一栏是%,是不是代表可以从任意主机访问?还有,我刚才试了以下新建了一个用户,to rrrr@localhost identified by 'rrrr',之后用mysql -u rrrr -p 登陆确实就成功了,但我不明白为什么用户名后一定要加@localhost???
    要怎样改动才可以不加@localhost   
      

  3.   

    localhost表示只能在本机登录,客户端登录命令语法为:mysql -uusername -p%表示可以从任何主机登陆,但此时必须指定mysql服务器ip地址mysql -hipaddress -uusername -p