版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_37632381/article/details/84933091
严重: create connection error java.sql.SQLException: null, message from server: "Host '192.168.209.1' is not allowed to connect to this MySQL server" at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1040) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)**加粗样式**
前提:在window下的eclipse连接Linux虚拟机中的MySQL报错,但是用window下的
navicat可以正常连接同一数据库。
分析报错提示:Host 用户不允许连接数据库。

从上面的截图可以看出chyun用户只允localhost连接。
解决方案:

改表法。
在localhost的那台电脑,登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从"localhost"改称"%"
mysql -u root -pvmwaremysql>use mysql;
mysql>update user set host = ‘%’ where user = ‘chyun’;
mysql>flush privileges;
mysql>select host, user from user;

授权法。
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON . TO ‘myuser’@’%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON . TO ‘myuser’@‘192.168.1.3’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器的dk数据库,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON dk.* TO ‘myuser’@‘192.168.1.3’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
————————————————
版权声明:本文为CSDN博主「爱吃鱼的小乖乖」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_37632381/article/details/84933091

报错 "Host '192.168.209.1' is not allowed to connect to this MySQL server"的更多相关文章

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

  2. 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 ...

  3. 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 ...

  4. 通过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 ...

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

    问题 远程连接mysql时遇到如下问题: ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MyS ...

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

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.8' IDENTIFIED BY 'www.linuxidc.com' WITH GRANT OPTI ...

  7. hive报错java.sql.SQLException: null, message from server: "Host '192.168.126.100' is not allowed to connect to this MySQL server"

  8. java.sql.SQLException: null, message from server: "Host '192.168.xxx.xxx' is not allowed to connect to this MySQL server"

    当你连接自己的电脑上的MySQL时,报这样的错,你可以把ip换成 127.0.0.1或者localhost  ,当然前提是用户名和密码正确

  9. linux中mysql运程连接时错误host ‘192.168.0.1’ is not allowed to connect to this MySql server

    1.改表法 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "u ...

随机推荐

  1. IDEA部署项目到远程服务器

    一.idea安装阿里插件Alibaba Cloud Toolkit 二.添加Host 三.应用部署 四.修改源程序重新部署 五.查看实时日志 欲买桂花同载酒,终不似,少年游

  2. Docker部署code-server

    Docker部署code-server 版本:codercom/code-server:v2 code-server可以放在服务器上,随时随地在浏览器中,编写代码.运行.调试: 手机,pad都可以进行 ...

  3. Signal Processing and Pattern Recognition in Vision_15_RANSAC:Performance Evaluation of RANSAC Family——2009

    此部分是 计算机视觉中的信号处理与模式识别 与其说是讲述,不如说是一些经典文章的罗列以及自己的简单点评.与前一个版本不同的是,这次把所有的文章按类别归了类,并且增加了很多文献.分类的时候并没有按照传统 ...

  4. centos下关闭自动锁屏

    自己这段时间在学习Linux,选用的系统的为CentOS,在实际操作过程中遇到问题,在无任何操作情况下,系统过一段时间自动锁屏需要重新输入密码.经过多次尝试以后终于成功!解决方法如下: Setting ...

  5. 查看python和NumPy版本和安装路径

    记录查看Python和NumPy版本以及路径的几条命令 # 查看Python版本及路径 python -V python -c "import sys;print(sys.executabl ...

  6. PAT Basic 1045 快速排序 (25 分)

    著名的快速排序算法里有一个经典的划分过程:我们通常采用某种方法取一个元素作为主元,通过交换,把比主元小的元素放到它的左边,比主元大的元素放到它的右边. 给定划分后的 N 个互不相同的正整数的排列,请问 ...

  7. Insufficient space for shared memory file 解决办法

    Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:   /tmp/hsperfd ...

  8. Window脚本学习笔记之BAT调用设置

    用一句bat脚本调用window的系统设置: rem 调用回收站 explorer.exe ::{645FF040-5081-101B-9F08-00AA002F954E} rem 检查Windows ...

  9. css中 禁止spa有点击状态

    <span class="an" onclick="selNum();"></span> var selNum = function() ...

  10. python自动华 (十四)

    Python自动化 [第十四篇]:HTML介绍 本节内容: Html 概述 HTML文档 常用标签 2. CSS 概述 CSS选择器 CSS常用属性 1.HTML 1.1概述 HTML是英文Hyper ...