use mysql;

CREATE USER 'hero'@'%' IDENTIFIED BY '3f33233ec786';

'%' - 所有情况都能访问
‘localhost’ - 本机才能访问
’111.222.33.44‘ - 指定 ip 才能访问

update mysql.user set password=password('新密码') where user='hero';

 

grant all privileges on 想授权的数据库.* to 'user1'@'%';

all 可以替换为 select,delete,update,create,drop

 

刷新权限

FLUSH PRIVILEGES;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-05-25
猜你喜欢
  • 2022-01-31
  • 2022-12-23
  • 2021-06-29
  • 2021-12-18
相关资源
相似解决方案