报错 "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/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"的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 通过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 ...
- 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 ...
- 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 ...
- hive报错java.sql.SQLException: null, message from server: "Host '192.168.126.100' is not allowed to connect to this MySQL server"
- 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 ,当然前提是用户名和密码正确
- linux中mysql运程连接时错误host ‘192.168.0.1’ is not allowed to connect to this MySql server
1.改表法 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "u ...
随机推荐
- nginx搭建反向代理服务器详解
一.反向代理:Web服务器的“经纪人” 1.1 反向代理初印象 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从 ...
- Ubuntu系统---C++之Eclipse编译器 CDT插件安装
Ubuntu系统---Ecli ...
- Ubuntu系统---安NVIDIA 驱动后 CUDA+cuDNN 安装
Ubuntu系统---安NVIDIA 驱动后 CUDA+cuDNN 安装 --------------------------------------------@20190726--------- ...
- Windows10官方正版系统的安装、激活、升级、U盘制作,无毒无害无捆绑无风险教程
一般电脑系统出了其他问题或电脑用久太卡了,可以选择此类方法解决系统卡顿问题,重置电脑系统或也可以恢复出厂设置 如果出现重置找不到恢复环境问题 可以通过下载系统镜像来解决,进入 MSDN 网站下载所需系 ...
- Reverse数组以及大O表达式
这篇主要是对数组实现一个倒排序(比如数组1.2.3,最后输出3.2.1),当然实现这个功能是非常easy的事,但是这里需要引入另外一个很重要的概念-----如何计算一个算法的时间复杂度并学会用大O表达 ...
- java之语言
1.集合类 主要掌握如何实现. ArrayList实现原理要点概括 ArrayList是List接口的可变数组非同步实现,并允许包括null在内的所有元素.底层使用数组实现该集合是可变长度数组,数组扩 ...
- jquery动态背景切换全屏登录插件supersized.js
下载地址:https://download.csdn.net/download/t101lian/10434198预览: http://www.daimabiji.com/codedemo/1530 ...
- github下载慢的问题
1. 修改HOSTS文件:在“C:\Windows\System32\drivers\etc” 下的HOSTS文件,添加以下地址: 151.101.44.249 github.global.ssl. ...
- ansible的安装和简单使用
ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具的优点,实现了批量系统配置.批量程序部署.批量运行命令等功能.ansible是基于模块工作的,本身没有批量部署的能力.真 ...
- Interleaving String (DP)
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given:s1 ...