-- 创建用户
create user 'zhangsan'@'%' identified by '123456';
flush privileges;
-- 创建数据库
create database xxplatdb DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
-- 给用户在指定数据库上的全部权限
grant all privileges on `xxplatdb`.* to 'zhangsan'@'%' identified by '123456';
flush privileges;
如果觉得《创建mysql用户并在单个数据库上赋权》对你有帮助,请点赞、收藏,并留下你的观点哦!