进入控制台,登录mysql:mysql -u root -q  ,输入密码后,进入mysql命令行

创建数据库:create database abc; //以创建abc为例

创建用户:create user user01@'localhost' identified by 'password';    // 本地访问

                  create user user02@'%' identified by 'password';   // 远程访问
授权,给user02用户 赋予 abc 库所有操作DML  DDL:grant all privileges on abc.* to user02;

如果只开通所有库 查询权限,命令为: grant select on *.* to 'user02'@'%' identified by 'anotherpassword';

 

相关文章:

  • 2021-09-07
  • 2021-10-04
  • 2021-06-29
  • 2021-05-19
  • 2021-11-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-02
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案