问题现象:本机连接远程环境的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. 探测web服务质量方法

  2. 编译lineageos

    lineageos 2 -- 编译rom包 fu*k小米,手机老是1年左右出现充不进去电.前段时间我的红米note4x突然充不进去电了,只好新买了个手机(买手机先看lineageos支持列表 ^_^) ...

  3. LeetCode——Number of Boomerangs

    LeetCode--Number of Boomerangs Question Given n points in the plane that are all pairwise distinct, ...

  4. ReactiveX/RxJava文档中文版

    项目地址:https://github.com/mcxiaoke/RxDocs,欢迎Star和帮忙改进. 有任何意见或建议,到这里提出 Create New Issue 阅读地址 ReactiveX文 ...

  5. selenium学习笔记(简单的元素定位)

    收拾一下心情开始新的一周工作 继续是selenium的学习.配置成功后 由于所有操作都是建立在页面元素基础上的.所以下来就是学习定位元素 首先是基础的定位.就使用博客园首页搜索框为例: 下面是代码: ...

  6. B/S,C/S简单介绍

    B/S,C/S 架构 硬件环境不同:C/S 一般建立在专用的网络上, 小范围里的网络环境, 局域网之间再通过专门服务器提供连接和数据交换服务. B/S 建立在广域网之上的, 不必是专门的网络硬件环境, ...

  7. Django进阶Admin篇 - admin基本配置

    django admin 是django自带的一个后台app,提供了后台的管理功能. 基础知识点: 一.认识ModelAdmin 管理界面的定制类,如需扩展特定的model界面,需要从该类继承 二.注 ...

  8. stringToDateUtils 字符串转化日期

    import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; impor ...

  9. 利用pycharm远程调试openstack代码

    1.安装pycharm专业版 本文安装pycharm 2016.2.3专业版.网上教程较多,这里不做详细介绍,只要到pycharm官网上下载应用程序进行安装即可. 2.pycharm配置 (1)首先按 ...

  10. 23-THREE.JS 光照材质

    <!DOCTYPE html> <html> <head> <title></title> <script src="htt ...