MySQL——MySQL8创建用户及分配权限

创建数据库

CREATE DATABASE IF NOT EXISTS mini_shopdefault charset utf8 COLLATE utf8_general_ci;


创建用户

create user ‘xlsf‘@‘%‘ identified by ‘xlsf‘;


修改用户

update mysql.user set host = "%" where user = "xlsf";


分配用户权限

grant all privileges on mini_shop.* to "xlsf"@‘%‘ ;