DCL数据控制语言
查询用户
#用户信息保存在数据库mysql的user表中
use mysql;
select * from user;
创建用户
create user '用户名'@'主机名' identified by '密码';
在主机localhost创建一个新用户
create user 'hikari39'@'localhost' identified by '123456';
创建一个新用户, 可以在任意主机上访问数据库
# %可以匹配任意主机
create user 'hikaru44'@'%' identified by '123456';
修改用户密码
alter user '用户名'@'主机名' identified with mysql_native_password by '新密码';
修改用户的密码为12345
alter user 'hikari39'@'localhost' identified with mysql_native_password by '12345';
删除用户
drop user '用户名'@'主机名';
删除
drop user 'hikari39'@'localhost';
标签:DCL,12,mysql,identified,用户,user,MYSQL,主机名,localhost
From: https://www.cnblogs.com/HIK4RU44/p/18062029