mysql 普通用户与权限
1、创建用户
mysql> create user 'myself'@'%' identified by 'Myself'; Query OK, 0 rows affected mysql>
2、赋予权限
mysql> grant select,update,insert,update on scms.* to 'myself'@'%'; Query OK, 0 rows affected mysql>
3、查询权限
mysql> show grants for 'myself'@'%'; +----------------------------------------------------------+ | Grants for myself@% | +----------------------------------------------------------+ | GRANT USAGE ON *.* TO 'myself'@'%' | | GRANT SELECT, INSERT, UPDATE ON `soms`.* TO 'myself'@'%' | | GRANT SELECT, INSERT, UPDATE ON `scms`.* TO 'myself'@'%' | +----------------------------------------------------------+ 3 rows in set mysql>
4、收回权限
mysql> revoke select,update,insert,update on scms.* from 'myself'@'%'; Query OK, 0 rows affected mysql>
5、修改用户
mysql> rename user 'myself'@'%' to 'myself-test'@'%'; Query OK, 0 rows affected mysql>
6、删除用户
mysql> drop user 'myself-test'@'%'; Query OK, 0 rows affected mysql>
缘于生活,而归于工作。本人所书,而意于分享。
如有转载,请注明出处!
--活出自己范儿