mysql> grant all on *.* to yushan@"%" identified by "123" ;
mysql>flush privileges; (刷新系统权限表)
(执行完会在MySQL.user表插入一条记录,all表示所有权限(包括增 删 改 查等权限), *.* 表示所有数据库,yushan为添加的用户名,123为密码,%为匹配的所有主机,上面的信息都可以指定如grant select,update on db.* to yushan@localhost identified by '123";)
查看mysql下所用用户
select user,host,password from mysql.user;
查看某个用户的权限
show grants for ‘yanyue’@'%'
删除某个用户的权限
drop user ‘yanyue’@'%'
转载地址:http://blog.csdn.net/lerdor/article/details/12957109