mysql的用户管理,用户权限管理
mysql的用户信息存储在mysql自带的mysql数据库的user表中,可以通过user表对mysql的用户进行管理,
用户管理
create user 'root'@'localhost' identified by 'password';
use mysql;
select * from user;
drop user root@localhost
set password for 'root'@'localhost'=password(‘xxxxxxxxxxxxx');
权限管理
授予权限(列权限/表权限/数据库权限/用户权限)
授予表权限grant select on tablexxx to root@localhost;
l授予列权限grant update(name,id) on tablexx to root@localhost;
授予数据库权限grant select on databasexx.* to root@localhost(授予数据库databasexx下的所有表给用户root)
授予用户权限grant create user on *.* to root@localhost;授予用户root创建新用户的权力
回收权限revoke all privileges from root@localhost;
revoke select on tablexx from root@localhost;