当前位置:Gxlcms > 数据库问题 > mysql允许远程IP访问

mysql允许远程IP访问

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

默认情况下Linux内的mysql数据库mysql,user表内的用户权限只是对localhost即本机才能登陆。需要更改权限:

mysql> Grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘password‘ with grant option;(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)

mysql> flush privileges;  (运行为句才生效,或者重启MySQL)

Query OK, 0 rows affected (0.03 sec)

查看用户的权限情况:

mysql>use mysql;

mysql> select host,user from user; 

| %                 | root   |(表面root可外部IP访问)

Thanks: http://blog.csdn.net/shunzi19860518/article/details/5057657

mysql允许远程IP访问

标签:

人气教程排行