MySQL 创建用户与修改密码
创建用户的 3 方法:
1 、create user userName identifed by 'yourPassword';
2、 grant select on *.* to userName@'host' identified by 'yourpassword';
3、 insert into mysql.user(Host,User,Password) values('%','A',password('yourPassword'));
修改用户的密码:
set password for userName@'host' = password('yourPassword');
删除用户:
drop user userName;
授权:
grant priv_type on object_type to user;
回收用户权限:
1、revoke priv_type on object_type from user
2、revoke all ,grant option from user //这样可以一次性回收用户的所有权限。
查看用户权限:
show grants for userName;