一般是没有给用户访问权限

给用户test_user授权,让他可以从外部登陆和本地登陆
注意:@左边是用户名,右边是域名、IP和%,表示可以访问mysql的域名和IP,%表示外部任何地址都能访问。

 
mysql> grant all privileges on *.* to 'test_user'@'localhost' identified by 'test_user';  
Query OK, 0 rows affected (0.00 sec)  
mysql> grant all privileges on *.* to 'test_user'@'%' identified by 'test_user';  
Query OK, 0 rows affected (0.00 sec)  
mysql> select user,host,password from mysql.user;  

相关文章:

  • 2022-01-20
  • 2021-11-08
  • 2022-12-23
  • 2022-01-26
  • 2021-08-30
  • 2022-12-23
  • 2021-06-16
猜你喜欢
  • 2021-09-13
  • 2022-01-11
  • 2021-07-27
  • 2021-08-28
  • 2022-12-23
  • 2021-10-24
  • 2021-12-15
相关资源
相似解决方案