1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost

报错:1130-host ... is not allowed to connect to this MySql server

解决方法:

1。 改表法。

可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

mysql -u root -pvmwaremysql>use mysql;

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

mysql>select host, user from user;

2. 授权法。

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

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

FLUSH   PRIVILEGES;

如果你想允许用户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;

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

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

FLUSH   PRIVILEGES;

我用的第一个方法,刚开始发现不行,在网上查了一下,少执行一个语句 mysql>FLUSH RIVILEGES 使修改生效.就可以了

另外一种方法,不过我没有亲自试过的,在csdn.net上找的,可以看一下.

在安装mysql的机器上运行:

1、d:\mysql\bin\>mysql   -h   localhost   -u   root //这样应该可以进入MySQL服务器

2、mysql>GRANT   ALL   PRIVILEGES   ON   *.*   TO   ‘root‘@‘%‘   WITH   GRANT   OPTION //赋予任何主机访问数据的权限

3、mysql>FLUSH   PRIVILEGES //修改生效

4、mysql>EXIT //退出MySQL服务器

这样就可以在其它任何的主机上以root身份登录啦!

时间: 2024-07-28 17:48:40

1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost的相关文章

ERROR 1130: Host ’...′ is not allowed to connect to this MySQL server

/******************************************************************** * ERROR 1130: Host ’...′ is not allowed to connect to this MySQL server * 说明: * 使用远程登录mysql,结果无法登录,记录一下解决方法. * * 2016-9-22 深圳 南山平山村 曾剑锋 ********************************************

MYSQL ERROR 1130: Host is not allowed to connect to this MySQL server

今天安装MYSQL遇到MYSQL ERROR 1130: Host is not allowed to connect to this MySQL server, 试了很多办法都不行 skip-grant-tables 放在my.ini [mysqld] 1.更改任意主机登陆 mysql> use mysql; mysql> update user set host = '%' where user = 'root' and host='localhost'; 2.更新权限 mysql>

解决ERROR 1130: Host '*.*.*.*' is not allowed to connect to this MySQL server 方法

简单点将阿里云ecs服务器内安装的mysql数据库里面的user表里面的Host为localhost的数据 将localhost改为% 如下图 上面那种方法 非常简单是我安装了phpmyadmin的方法 也可以用命令行 #用命令访问mysqlmysql -u root -p #使用mysql数据库use mysql; #查询当前用户情况,显示有2条记录,127.0.0.1:localhost:select host, user from user; #把localhost这条记录的host改为

ERROR 1130: Host '' is not allowed to connect to thisMySQL server

今天1网友求助,说自己PHPmyadmin可以正常连接数据库,使用sqlyog报错: ERROR 1130: Host '172.27.214.1' is not allowed to connect to thisMySQL server root case:MySQL默认所有帐号不允许从远程登陆,只能在localhost 解决方法: 1,修改user表 mysql -u root -p mysql>use mysql; mysql>update user set host = '172.2

Mysql-报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost

报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u roo

报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost

标题转的, 别介 1. 删除 mysql 进程 2. mysqld-nt --skip-grant-tables (这条命令没有执行成功) 但是神奇就神奇在这里,   重新远程数据库可以连接

IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决

安装完MySQL后,远程连接数据库的时候,出现 ERROR 1130 (HY000): Host '192.168.0.1' is not allowed to connect to this MySQL server提示信息,不能远程连接数据库.考虑可能是因为系统数据库mysql中user表中的host是localhost的原因,于是,我尝试把这个值改为自己服务器的ip,果然就好用了,不过用 mysql -u root -p命令就连不上数据库了,需要用mysql -h 服务器ip -u roo

解决ERROR 1130: Host 'x.x.x.x' is not allowed to connect to this MariaDB server 方法

问题描述 在使用SQLyog操作Linux上的MariaDB时候,会出现如下错误: 解决方法 改表法 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" 具体操作为: 连接mysql服务器:mysql -u root -p 看当前所

虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发. 局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题: Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql 1.解决Lost connection to MySQL server