【MySQL】创建一个新用户并授权指定数据库完整权限
# 连接数据库
mysql -uroot -p'密码'
# 新建数据库
create database if not exists数据库名;
# 新建用户
create user '用户名'@'localhost' identified by '密码'
# 授予权限
grant all on 数据库名.* to '用户名'@'localhost'; 版权申明
本文系作者 @张安金 原创发布在张安金博客站点。未经许可,禁止转载。
评论