问题现象:本机连接远程环境的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. linux service start|stop|restart

    用了这么些日子的linux/unix系统,也和别人一起合作开发了不少程序,发现高手都喜欢在命令行上操作,而且控制程序的运行偏好于使用脚本,加上参数如:start.restart.stop等. 后来自己 ...

  2. Android获取所有应用的资源id和对应的uri

    背景 在某些应用中,为了实现应用apk资源放入重复利用,或者使用反射得到本应用的资源,需要使用反射方式获得,但Resources类中也自带了这种获取方式,并且功能更加强大 你可以获取string,co ...

  3. [日常训练]AekdyCoin的跳棋

    Description $AekdyCoin$正在玩一个游戏,该游戏要用到两副牌和一个数轴和一个棋子. 刚开始的时候棋子位于数轴的$0$位置.然后$AekdyCoin$交替的从两副牌中抽取一张牌,然后 ...

  4. oracle: 分割字符串,或者查找字段里面的关键字(关键字1,关键字2,关键字3)

    表中有一个字段:keyword, keyword里面的存储的字符一般是:[关键字1,关键字2,关键字3] 那么,在搜索的时候,不能用like 来模糊查询,因为这样会,多查询出一下不相干的关键字, hi ...

  5. zabbix原理

    数据采集-->数据存储-->数据展示和分析-->报警 数据采集 SNMP agent ICMP/ssh/IPMT数据存储: cacti:rrd nagios:无数据库.mysql z ...

  6. YCSB benchmark测试cassandra性能——和web服务器测试性能结果类似

    转自:http://www.itdadao.com/articles/c15a531189p0.html http://www.cnblogs.com/bettersky/p/6158172.html ...

  7. Agilent RF fundamentals (11)-Vector modulator

     Vector modulator 矢量调制器:调整信号的幅度和相位 http://www.21ic.com/app/test/201805/762401.htm

  8. PostgreSQL 全文检索

    PostgreSQL 8.3.1  全文检索(转) 在postgreSQL 8.3自带支持全文检索功能,在之前的版本中需要安装配置tsearch2才能使用,安转配置tsearch2就不再多说了,主要介 ...

  9. S2SH框架中的无刷新验证码功能实现

    暑假期间在实验室做使用S2SH框架的项目,其中登录和注册需要验证码,实现了一个没有实现刷新验证码功能的简单版本,代码如下: 1 package com.sem.action; 2 3 import j ...

  10. Webpack 热部署检测不到文件变化问题

    Webpack 热部署检测不到文件变化问题 今天在用Webpack开发的时候,突然发现文件变动后热部署功能不工作了,感觉好像是webpack检测不到文件的修改了.折腾了半天,开始一直以为是自己的代码有 ...