MySQL如何创建用户

# 创建用户
create user zhangsan identified by 'zhangsan';
# 赋数据库权限
grant all privileges on 数据库名字.* to zhangsan@'%' identified by 'zhangsan';

# 刷新权限
flush privileges;
# 显示权限
show grants for 'zhangsan';

# 改密码
update user set authentication_string = password('新密码') where user = 'zhangsan' and host = '%';
flush privileges;

# 删账户
drop user zhangsan@'%';
上一篇:解决navicat连接Linux mysql出现1045问题


下一篇:docker部署mysql 实现远程连接