问题现象:本机连接远程环境的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. Registering Components-->Autofac registration(include constructor injection)

    https://autofaccn.readthedocs.io/en/latest/register/registration.html Registration Concepts  (有4种方式来 ...

  2. JavaScript中this关键字的使用比较

    JavaScript中this关键字的使用比较 this关键字在JavaScript中,用的不能说比较多,而是非常多.那么熟悉this关键字的各种用法则显得非常关键. this有时候就是我们经常说的上 ...

  3. 红米手机.驱动.XP安装

    1.发现 官网上下载的 驱动在 XP下安装不上去... (Win7 记得 貌似 没有问题...) 1.1.网上搜到的 解决方案为:解决手机不能连电脑 XP系统无法安装MTP设备驱动的终极解决_小米No ...

  4. Spark- 使用第三方依赖解析IP地址

    使用 github上已有的开源项目1)git clone https://github.com/wzhe06/ipdatabase.git 2)编译下载的项目: mvn clean package- ...

  5. Eclipse的编码格式设置

    在使用Eclipse开发中,许多文件编码默认是ISO-8859-1,不支持中文(如常用的JSP).这样我们每次建文件都要手动改编码,其实我们可以在设置文件默认编码,今后再创建时就不用每次修改编码了, ...

  6. org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML.

    org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Offic ...

  7. django model_fields_validators 前端页面编辑自定义验证

    # model_field_validators.py import re from django.core.exceptions import ValidationError from django ...

  8. opencv:创建滑动条

    函数原型: ,); #include <opencv.hpp> using namespace cv; #define WINDOW_NAME "线性混合示例" // ...

  9. VMware虚拟机克隆Linux系统引起的网卡问题

    1. 手动配置静态网卡地址不生效2. 网卡名变成了eth1[root@localhost network-scripts]# ls |grep ifcfg ifcfg-eth0 ifcfg-lo [r ...

  10. 【ccf2017-12-2】游戏(模拟)

    问题描述 有n个小朋友围成一圈玩游戏,小朋友从1至n编号,2号小朋友坐在1号小朋友的顺时针方向,3号小朋友坐在2号小朋友的顺时针方向,……,1号小朋友坐在n号小朋友的顺时针方向. 游戏开始,从1号小朋 ...