MySQL8创建用户,授权

下面是创建用户user123,数据库名user123,密码工23456为例:

create database user123 default charset utf8 collate utf8_general_ci;  #先建立一个库
create user 'user23'@'%' identified by 'a123456';  #创建用户,密码
grant all privileges on user123.* to 'user123'@'%' with grant option;   #授权某个库给用户

grant all privileges on *.* to 'tone'@'%' with grant option;   #授权全部库给该用户
flush privileges;

发表评论

您的邮箱地址不会被公开。