我想增加个用户tanwei,但是这用户只能访问这特定数据库test02   我是如下操作的,可是错了,哪位帮我看看,谢谢了。
  
   mysql>grant select,update,insert,delete on test02.* to [email protected] identified by "1234567";
   mysql>update user set host = '%' where user = 'tanwei';//将host字段的值改为%,可在任何客户端机器上能以tanwei用户登录到mysql服务器
如上,建立用户tanwei,增加了他的权限   # mysql -u tanwei -p
   //输入密码
   # show databases;
  可是并没有显示test02,现在这用户还是访问不了test02数据库。现在用这tanwei用户登陆进去,里面连mysql这系统表也不能访问。  哪位高手指点我下,谢谢了  
  谢谢!~~~~

解决方案 »

  1.   

    create user tanwei;
    grant all privileges on *.* to tanwei@'%' identified by '1234567' with grant option;
    update user set password=old_password('1234567') where user='tanwei';
      

  2.   

    create user tanwei;
    grant all privileges on test2.* to tanwei@'%' identified by '1234567' with grant option;
    update user set password=old_password('1234567') where user='tanwei';还是跟之前的效果一样,还是不能访问数据库test2,是什么原因呢???谢谢  
    谢谢!
      

  3.   

    新建的用户只能访问两个数据库 一个是 information-schema 一个是test test是我自己建的