1 grant select,insert,update,delete on db_name.table_name to user_name@'%';
/*rds*/
drop user user_name; create user user_name; grant select on db_name.table_name to user_name @'%'; grant select,insert,update,delete on db_name.table_name to username @'%' identified by 'new_password'; flush privileges; show grants for user_name;
/**/
select user ,`Password` from `user`; SET PASSWORD FOR root=PASSWORD('sxh-=0911.'); DROP user shengxianghui FROM `user`; create user shengxianghui IDENTIFIED BY ''; create user shengxianghui_1 IDENTIFIED BY '032794'; create user shengxianghui_2 AND PASSWORD is '032794'; RENAME user shengxianghui TO lipan; UPDATE user shengxianghui IDENTIFIED BY '032794'; UPDATE user lipan IDENTIFIED BY '032794'; REVOKE user shengxianghui_1; DROP user mysql.`user` ON shengxiangui_1@'%'; show GRANTS FOR shengxianghui_1; REVOKE SELECT ON mysql.* to shengxianghui; GRANT select on mysql.* to shengxianghui_1; DROP user shengxianghui,lipan; CREATE user shengxianghui,lipan,caisiheng; set PASSWORD FOR shengxianghui = PASSWORD('0327') GRANT select , UPDATE on mysql.* TO shengxianghui; REVOKE USER shengxianghui; SHOW GRANTS FOR shengxianghui; SELECT * FROM `t_user`; INSERT INTO t_user(username,password,age,phone,email) SELECT username,password,age,phone,email FROM t_user; ANALYZE TABLE t_user; CHECK TABLE t_user; show status; show VARIABLES; show PROCESSLIST;