不多说直接上代码

[root@demo /]# mysql -u root -p  #登录服务器数据库

Enter password:123xxx

#1.创建一个新用户 testuser 密码为 testuserpass
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testuserpass';
#2.创建数据库testDB create database testDB;
#3.执行命令为testuser用户添加使用testDB权限 grant all privileges on testDB.
* to testuser@localhost identified by 'testuserpass';
#4.执行命令,为testuser用户添加远程访问权限 GRANT ALL PRIVILEGES ON testDB.
* TO 'testuser'@'%' IDENTIFIED BY 'testuserpass' WITH GRANT OPTION;

#5.刷新权限表
flush privileges;

 

相关文章:

  • 2022-02-10
  • 2021-12-11
  • 2021-12-25
  • 2021-11-06
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-27
  • 2022-03-07
  • 2021-06-09
  • 2022-01-12
  • 2021-09-24
  • 2022-02-10
相关资源
相似解决方案