当前位置:Gxlcms > 数据库问题 > 解决不能访问远程mysql的问题

解决不能访问远程mysql的问题

时间:2021-07-01 10:21:17 帮助过:2人阅读

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

给用户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;  

解决不能访问远程mysql的问题

标签:

人气教程排行