首页 > 数据库 > mysql > 正文

MySQL8创建用户,授权
2019-03-16 14:31:37 点击:

下面是创建用户user123,数据库名user123,密码工23456为例:create databaseuser123 default charset utf8 collate utf8_general_ci;
下面是创建用户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;



相关热词搜索:

上一篇:mySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题
下一篇:mysql8 Authentication plugin 'caching_sha2_password' cannot be loaded