mysql远程连接 Host * is not allowed to connect to this MySQL server(第一次配置好lnmp环境)

Posted yangzailu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql远程连接 Host * is not allowed to connect to this MySQL server(第一次配置好lnmp环境)相关的知识,希望对你有一定的参考价值。

1.第一次在linux上搭建好mysql,本机windows远程链接报错Host * is not allowed to connect to this MySQL server

2.原因:mysql服务器出于安全考虑,默认只允许本地登录数据库服务器。

问题解决:登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%",然后重启mysql这样就允许所有的远程机器进行访问了。

步骤1:修改mysql表

mysql -u root -pvmware
mysql>use mysql;
mysql>update user set host = \'%\' where user = \'root\';
mysql>flush privileges;
mysql>select host, user from user;

mysql>quit

 

成功!!!!

 

 

以上是关于mysql远程连接 Host * is not allowed to connect to this MySQL server(第一次配置好lnmp环境)的主要内容,如果未能解决你的问题,请参考以下文章

远程连接MySQL提示“Host is not allowed to connected to this MySQL server”

转:mysql远程连接 Host * is not allowed to connect to this MySQL server

解决远程连接数据库:Host is not allowed to connect to this MySQL server

远程连接mysql报错:1130 - Host XXX is not allowed to connect to this MySQL server

mysql远程连接:ERROR 1130 (HY000): Host ‘*.*.*.*‘ is not allowed to connect to this MySQL server

mysql远程连接:ERROR 1130 (HY000): Host ‘*.*.*.*‘ is not allowed to connect to this MySQL server