56,803
社区成员




mysql>mysql -uroot -p
mysql>insert into mysql.user(Host,User,Password) values("localhost","myname",password("mypassword"));
mysql>flush privileges ;
mysql> Ctrl-C -- exit!
mysql -umyname -pmypassword -h localhost
mysql> show grants;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 10521064
Current database: *** NONE ***
ERROR 1184 (08S01): Aborted connection 10521064 to db: 'unconnected' user: 'myname' host: 'localhost' (init_connect command failed)
mysql>grant all privilegess on *.* to myname@'%' identified by 'mypassword' with grant option;
mysql>flush privileges ;
赋予所有的权限(上面的sql),是可行的,我的疑问是只赋予查询的远程权限怎么弄?
mysql>grant select on *.* to myname@'%' identified by 'mypassword' with grant option;
mysql>flush privileges ;
结果还是不行的。