grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;
grant all on ems.ems to uni@'%' identified by '777'; //百分号表示任何地址
赋予用户所有权限,但是却无法查看表,是因为匿名登录的原因,用mysql -u root -p 登录mysql,然后用select host,user from mysql.user;命令查看表中的匿名用户,user列下的空用户名即为匿名用户,用命令delete from mysql.user where user='';删除匿名用户,重启mysql服务,匿名用户即无法登录!