mysql 我把root的select关了。怎么在打开啊。请教一下 
点那个管理使用者会出现1142 - select command denied to user 'root'@'localhost' from table 'user'
谢谢

解决方案 »

  1.   


    grant all privileges on *.* to root@'%' identified by "Passwd" 
      

  2.   

    Garnt select on *.* to root@'%' ;
    Garnt select on *.* to root@'localhost' 
      

  3.   

    Grant select on *.* to root@'%' ;
    Grant select on *.* to root@'localhost' 
      

  4.   

    如果你只有ROOT用户有GRANT权限,那么用其他用户登录进去,是不能够做GRANT操作的。用ROOT登录,修改权限也不行,因为你的查询权限已经没有了。
    可以看看http://blog.chinaunix.net/u3/116107/showart.php?id=2275557如果有其他的用户有GRANT权限,那么用有权限的用户登录,再执行GRANT SELECT ....的操作。
      

  5.   

    重新GRANT一下
    grant all  on *.* to 'root'@'localhost'
      

  6.   

    mysql> grant all on *.* to 'root'@'localhost'    -> 
        -> Grant select on *.* to root@'%' ;
    Grant select on *.* to root@'localhost' 
    ERROR 2013 : Lost connection to MySQL server during query
        -> 
        -> Grant all on *.* to 'root'@'localhost'
        -> 
        -> Grant all on *.* to 'root'@'localhost';
    ERROR 2013 : Lost connection to MySQL server during query
    mysql> 
    出这个东西
      

  7.   

    我不小心把select 和create 关掉了。别的没动过。怎么恢复啊
      

  8.   

    grant all on *.* to 'root'@'localhost';grant all on *.* to 'root'@'%'
    或则
    grant Create,Select on *.* to 'root'@'localhost';
    grant Create,Select on *.* to 'root'@'%'
      

  9.   

    1:
    grant Create,Select on *.* to 'root'@'localhost';2:
    grant Create,Select on *.* to 'root'@'%';----------------------------------
    3:
    grant all on *.* to 'root'@'localhost';
    4:
    grant all on *.* to 'root'@'%';
    1,2一种方法。3,4一种方法。
      

  10.   

    mysql> grant Create,Select on *.* to 'root'@'localhost';
    ERROR 2013 : Lost connection to MySQL server during query
    mysql> grant Create,Select on *.* to 'root'@'%';
    ERROR 2013 : Lost connection to MySQL server during query
    mysql> grant Create,Select on *.* to 'root'@'%'
        -> ;
    ERROR 1045 : Access denied for user 'root'@'localhost' (using password: YES)
    mysql> grant Create,Select on *.* to 'root'@'localhost';ERROR 1045 : Access denied for user 'root'@'localhost' (using password: YES)
    mysql> grant Create,Select on *.* to 'root'@'%';ERROR 1045 : Access denied for user 'root'@'localhost' (using password: YES)
    mysql> grant all on *.* to 'root'@'localhost';ERROR 1045 : Access denied for user 'root'@'localhost' (using password: YES)
    mysql> grant all on *.* to 'root'@'%';ERROR 1045 : Access denied for user 'root'@'localhost' (using password: YES)
    mysql> 
    你说的我试过了啊。不行呀。是哪里的问题呀
      

  11.   

    grant all on *.* to root@'localhost' identified by '密码';
    grant all on *.* to root@'%' identified by '密码';用上面这2条把密码重置下,看看
      

  12.   

    执行失败 Access denied for user 'root'@'localhost' (using password: YES)出这个东西
      

  13.   

    这样:
    1:用root 登入mysql 创建一个帐号:
    grant all on *.* to new_user@localhost identified by '密码' with grant option;
    2:用new_user这个帐号登入:
    drop user root@'localhost';
    flush privileges;
    grant all on *.* to root@localhost identified by '123456' with grant option;
    3:用root登入:
    drop user new_user@'localhost';
    flush privileges;-----试下看看