问题现象:本机连接远程环境的mysql数据库报错,提示本机ip无法连接到mysql服务器。

  问题原因:本机对远程mysql数据库没有访问权限。

  解决方法:在远程mysql数据库添加本机ip的访问权限:

  1、登陆远程mysql,这里的用户名和密码都是root

[root@izwz932ypmamm80m434qqyz ~]# mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5.-log MySQL Community Server (GPL) by Atomicorp Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  2、进入mysql数据库,查询用户表

mysql> use mysql;
Database changed
mysql> select user,password,host from user;
+------+-------------------------------------------+-------------------------+
| user | password | host |
+------+-------------------------------------------+-------------------------+
| root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | localhost |
| root | | izwz932ypmamm80m434qqyz |
| root | | 127.0.0.1 |
| root | | :: |
| | | localhost |
| | | izwz932ypmamm80m434qqyz |
+------+-------------------------------------------+-------------------------+
rows in set (0.00 sec)

  3、添加本机ip(这里为117.149.10.46),用户名密码还是设置为root

mysql> grant all privileges on *.* to root@"117.149.10.46" identified by "root";
Query OK, rows affected (0.00 sec) mysql> select user,password,host from user; +------+-------------------------------------------+-------------------------+
| user | password | host |
+------+-------------------------------------------+-------------------------+
| root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | localhost |
| root | | izwz932ypmamm80m434qqyz |
| root | | 127.0.0.1 |
| root | | :: |
| | | localhost |
| | | izwz932ypmamm80m434qqyz |
| root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | 117.149.10.46 |
+------+-------------------------------------------+-------------------------+
rows in set (0.00 sec)

  4、重新加载mysql的访问权限

mysql>flush privileges;

  本机重新连接远程mysql成功。

本地连接远程环境mysql报错:Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server的更多相关文章

  1. 报错 "Host '192.168.209.1' is not allowed to connect to this MySQL server"

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/weixin_37632381/artic ...

  2. Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server

    Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server ...

  3. Mysql远程连接报错:SQL Error (1130): Host '192.168.61.128' is not allowed to connect to this MySQL server

    Mysql远程连接报错:SQL Error (1130): Host '192.168.0.18' is not allowed to connect to this MySQL server     ...

  4. Mysql远程连接报错:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server

    通过SQLyog连接linux中的MySQL报错问题:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this ...

  5. 通过navicat连接mysql服务器提示SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server

    新装一个mysql,尝试用通过navicat连接mysql服务器的时候提示: SQL Error (1130): Host '192.168.1.100' is not allowed to conn ...

  6. MySQL 1130 - Host 127.0.0.1 is not allowed to connect to this MySQL server

    在开发中为了让开发更方便,在本地配置环境,希望可以直接访问服务器上的MySQL数据库,更方便的管理数据库, 需要在本地远程连接linux服务器的本地数据库,直接用数据库管理工具连接出现如下报错1130 ...

  7. SQL Error (1130): Host '192.168.1.126' is not allowed to connect to this MySQL server

    通过HeidiSQL连接MYSQL数据库报错: SQL Error (1130): Host '192.168.1.126' is not allowed to connect to this MyS ...

  8. ERROR 1130 (HY000): Host '172.16.1.54' is not allowed to connect to this MySQL server

    centos7.5 远程连接数据库报错 问题: [root@db04-54 ~]# mysql -urep -p123 -h172.16.1.51 Warning: Using a password ...

  9. MYSQL错误1130:ERROR 1130: Host 10.10.36.115 is not allowed to connect to this MySQL server

    解决远程连接mysql错误1130代码的方法  在用远程连接Mysql服务器的数据库,不管怎么弄都是连接不到,错误代码是1130,ERROR 1130: Host 10.10.36.115 is no ...

  10. 解决ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL

    使用navicat进行远程登录MySQL时,报出 ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL  se ...

随机推荐

  1. 查询当天数据(mysql)

    SELECT count(*) as nums FROM go_member_share WHERE DATEDIFF(FROM_UNIXTIME(time, '%Y-%m-%d') , now()) ...

  2. Dispatcher initialization failedUnable to load configuration 解决办法

    检查<package name="action" extends="struts-default"></package>中是否有exte ...

  3. 【Node.js】'readline' 逐行读取、写入文件内容

    [转]运用readline逐行读取的两种实现 效果图如下: 左边1.log 为源文件 右边1.readline.log为复制后的文件 下边为命令行输出 实现方式一: [javascript] view ...

  4. JavaWeb -- Struts2 ResultType细化, 国际化

    1. ResultType细化 <result-types> <result-type name="chain" class="com.opensymp ...

  5. Pandas分类数据

    通常实时的数据包括重复的文本列.例如:性别,国家和代码等特征总是重复的.这些是分类数据的例子. 分类变量只能采用有限的数量,而且通常是固定的数量.除了固定长度,分类数据可能有顺序,但不能执行数字操作. ...

  6. JNI_Z_09_Java的字符串

    ZC: jstring 就是 Java中的String对象 ZC: 10.8 Unicode字符串结尾(http://www.360doc.cn/article/14233282_321497569. ...

  7. 在oracle中插入数据报错:ORA-00984列在此处不允许

    这里报错的原因就是当数据类型varchar2时没有使用单引号. 没写单引号,不管是双引号还是什么都没写都会报这个错误.

  8. 利用$http获取在服务器的json数据

    以下是存储在web服务器上的 JSON 文件: http://www.runoob.com/try/angularjs/data/Customers_JSON.php { "records& ...

  9. Linux find 命令大全

    find 含义: 顾名思义,是从来查找满足条件的内容. 从指定目录,递归的查找满足条件的内容. 格式: find [查询目录] [参数] [匹配方式] 文件操作: -name : 查找文件名  ( f ...

  10. SPOJ - VLATTICE

    链接 题意:三维平面,找从(0,0,0)看(n,n,n)能看到的点 题解:很明显就是求gcd(i,j,k)==1的(i,j,k)对数,改一下公式即可,记得要算平行坐标轴的三个平面,还有含0的三个坐标 ...