ERROR 1130: Host ’192.168.1.3′ is not allowed to connect to this MySQL server这是告诉你没有权限连接指定IP的主机,下面我们来看看解决办法。

处理方法有二个

1、(如何解决客户端与服务器端的连接(mysql) :xxx.xxx.xxx.xxx is not allowed to connect to this mysql serv 

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

 代码如下 复制代码
GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@'%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;

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

 代码如下 复制代码
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’192.168.1.3′ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’10.10.40.54′ IDENTIFIED BY ’123456′ WITH GRANT OPTION;

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

这个是因为权限的问题,处理方式如下:

 代码如下 复制代码
shell>mysql --user=root -p

输入密码

 代码如下 复制代码
mysql>use mysql

mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON [db_name].* TO [username]@[ipadd] identified by '[password]';

[username]:远程登入的使用者代码

[db_name]:表示欲开放给使用者的数据库称

[password]:远程登入的使用者密码

[ipadd]:IP地址或者IP反查后的DNS Name,此例的内容需填入'60-248-32-13.HINET-IP.hinet.net' ,包函上引号(')

(其实就是在远端服务器上执行,地址填写本地主机的ip地址。)

也可以这样写

 代码如下 复制代码

mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = ‘%’ where user = ‘root’;mysql>select host, user from user;

【数据库开发】is not allowed to connect to this MySQL server解决办法的更多相关文章

  1. 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 MyS ...

  2. mysql远程访问 登录ERROR 1130: is not allowed to connect to this MySQL server解决办法

    LINUX6.3 里装了mysql5.0.18 版本运行服务器. 提示错误为: ERROR 1130: Host '192.168.0.102' is not allowed to connect t ...

  3. is not allowed to connect to this MySQL server解决办法

    GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; myuser:代表你 ...

  4. 连接数据库报错:1130-Host 'xxx' is not allowed to connect to this MySQL server解决

    出现这个问题的同学都很奇怪,为啥用localhost就可以连接上,但是使用本地ip就不行.出现这个问题的原因就是mysql未开启mysql远程访问权限导致. 这时候我们就用cmd去访问下你的mysql ...

  5. Host is not allowed to connect to this MySQL server解决方法

    在装有MySQL的机器上登录MySQL mysql -u root -p密码 执行use mysql; 执行update user set host = '%' where user = 'root' ...

  6. 云链接 接口不允许 情况 解决方法 mysql Host is not allowed to connect to this MySQL server解决方法

    在装有MySQL的机器上登录MySQL mysql -u root -p密码 执行use mysql; 执行update user set host = '%' where user = 'root' ...

  7. 远程连接mysql报错【1130 -host 'localhost' is not allowed to connect to this mysql server】

    远程连接mysql时包如下错误: 1130 -host 'localhost' is not allowed to connect to this mysql server 解决办法 本地用root账 ...

  8. HOSt ip is not allowed to connect to this MySql server, MYSQL添加远程用户或允许远程访问三种方法

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

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

    报错:1130-host ... is not allowed to connect to this MySql server   解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在l ...

随机推荐

  1. boost::swap

    boost::swap是对标准库里的std::swap的增强和泛化,为交换两个变量的值提供便捷的方法. 为了使用需包含头文件: #include <boost/swap.hpp> 原理 c ...

  2. centos6.5 安装163yum源

    1.下载yum源 http://mirrors.163.com/.help/CentOS6-Base-163.repo 2.把下载好的yum源放到/etc/yum.repos.d下 mv CentOS ...

  3. 二十七. Keepalived热备 Keepalived+LVS 、 HAProxy服务器

    1.Keepalived高可用服务器 proxy:192.168.4.5(客户端主机) web1:192.168.4.100(Web服务器,部署Keepalived高可用软件) web2:192.16 ...

  4. [Luogu] 仓鼠找sugar

    https://www.luogu.org/problemnew/show/3398 树剖练习题,两个懒标记,搜索时序为全局懒标记 #include <bits/stdc++.h> usi ...

  5. HDU4254 A Famous Game

    luogu嘟嘟嘟 这题刚开始特别容易理解错:直接枚举所有\(n + 1\)种情况,然后算哪一种情况合法,再统计答案. 上述思想的问题就在于我们从已知的结果出发,默认这种每一种情况中取出\(q\)个红球 ...

  6. css添加了原始滚动条要隐藏滚动条的显示

    // 添加伪类 <style> ::-webkit-scrollbar {display:none} </style> <div style=" width:2 ...

  7. 配置Notepad++

    Notepad++配置 1.自动换行 视图 - 自动换行 2.隐藏工具栏 设置 - 首选项... > 常用 > 工具栏 - 隐藏 3.隐藏菜单栏 设置 - 首选项... > 常用 & ...

  8. php关于mysql长连接问题

    1.当 函数 mysql_connect 的前三个参数(server username password)相同,并且第四个参数(new_link)不传递时候,重复调用 mysql_connect 是会 ...

  9. 1825:【01NOIP提高组】数的划分

    #include<bits/stdc++.h> using namespace std; ],tot; void dfs(int num,int pos) { if(pos==k) ]) ...

  10. ansible 主机正则

    ansible <pattern> -m <module_name> -a <arguments> 该功能主要针对Inventory的主机列表,案例如下: 1.AL ...