【SQL】mysql语句整理(一)

来源:互联网 发布:asp淘宝客源码 编辑:程序博客网 时间:2024/05/17 10:56

创建用户

insert intomysql.user(Host,User,Password)values('localhost','test',password("123"))

解释:localhost(Host)表示只能在本机登陆(使用区域),test为用户名,password内为密码

授予权限

grant all privileges on bos.* totest@localhost identified by '123'; 

解释:bos为数据库名

部分权限

grant select,delete,update,create,drop on*.* to test@"%" identified by "123"; 

刷新系统权限表

flush privileges;

显示数据库

showdatabases;

取消权限

revoke all on *.* from test@localhost ;