1、改表法 


mysql>use mysql; 

mysql>update user set host = '%' where user = 'root'; 


2、授权法 

例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。 

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 

如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码 

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 

刷新


FLUSH PRIVILEGES 

相关文章:

  • 2021-11-25
  • 2021-06-25
  • 2021-07-14
  • 2021-06-13
  • 2021-12-26
  • 2021-12-29
  • 2022-01-08
猜你喜欢
  • 2021-12-21
  • 2021-03-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-07-06
相关资源
相似解决方案