连接mysql后
GRANT ALL ON *.* TO admin@‘%‘ IDENTIFIED BY ‘admin‘ WITH GRANT OPTION #远程连接,所有权限
grant select, insert, update, delete on test.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option; # 增、删、改权限
revoke all on *.* from dba@localhost; #收回权限
ps: 最后需要刷新权限
flush privileges;
其他常用权限
create/alter/drop 创建/更改表结构、删除表权限
create temporary tables 创建临时表
index 操作索引