MySql用户操作:创建、删除、赋权

更多内容

相关sql


-- 创建 允许外网访问的账号
create user 'fungli'@'%' identified by '123456';

-- 删除 指定账号
delete from mysql.user where User = 'fungli' and Host = '127.0.0.1'

-- 创建账户并授权给指定租户
grant select privileges on `mycommunity_config_local`.* to 'fungli'@'%' identified by '123456';

-- 给账户授权
grant select on `mycommunity_config_local`.* to 'fungli'@'%';
flush privileges; 

-- 收回账户的权限
revoke select on `mycommunity_config_local`.* from 'fungli'@'%';
flush privileges;  

-- 查看用户权限
select * from information_schema.USER_PRIVILEGES where GRANTEE like '%fungli%'


权限说明

权限说明
all
alter
alter routine使用alter procedure 和drop procedure
create
create routine使用create procedure
create temporary tables使用create temporary table
create user
create view
delete
drop
execute使用call和存储过程
file使用select into outfile 和load data infile
grant option可以使用grant和revoke
index可以使用create index 和drop index
insert
lock tables锁表
process使用show full processlist
reload使用flush
replication client服务器位置访问
replocation slave由复制从属使用
select
show databases
show view
shutdown使用mysqladmin shutdown 来关闭mysql
super
update
usage无访问权限
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值