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

表示该对象不是远程对象,不能通过该对象远程访问数据

解决:

方案一:改表:

use mysql ;select user,host,password from user;

update user set host = '%' where user='root';

方案二:授权法:

例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。 
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码 
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

需要重启mysql数据库。

java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQL server"的更多相关文章

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

    在用solr从mysql导入数据的时候,因为linux和本机的数据库不在同一个ip段上, 又因为本地的mysql没有设置远程其它ip可以访问所以就报了如下错误 解决办法: 在mysql任意可以输入查询 ...

  2. message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决

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

  3. message from server: "Host 'XXX' is not allowed to connect to this MySQL server

    Access denied for user 'root'@'XXXXX' (using password: YES) mysql命令不正确造成: grant all privileges on *. ...

  4. Cannot create PoolableConnectionFactory (null, message from server: "Host 'admin-PC' is not allowed to connect to this MySQL server")

    1.别人在用自己的tomcat访问我留的查询接口时,出现Cannot create PoolableConnectionFactory (null,  message from server: &qu ...

  5. 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server

    这段时间在研究火车头的入库教程,在“配置登陆信息和数据库(mysql)”连接中,出现“服务器连接错误Host 'XXX' is not allowed to connect to this MySQL ...

  6. ERROR 1130: Host xxx is not allowed to connect to this MySQL server

    在使用MySQL-Front连接mysql的时候发生的这个错误 ERROR 1130: Host xxx is not allowed to connect to this MySQL server ...

  7. Host 'xxx' is not allowed to connect to this MySQL server.

    mysql开启远程连接 今天在服务器安装了mysql,准备用mysqlguitools远程登录的时候出错,提示:Host 'xxx' is not allowed to connect to this ...

  8. 连接远程数据库时出现 SSH: expected key exchange group packet from server / 2003 - Can't connect to MySQL server on 'XXX' (10038) / 1130 - Host 'XXX' is not allowed to connect to this MySQL server

    昨天在自己的远程服务器上玩,把系统重装了.新装了MySQL,在本地用navicat连接的时候出了几个小问题. 问题一:SSH: expected key exchange group packet f ...

  9. Mysql 数据库允许远程连接 服务器连接错误 Host 'XXX' is not allowed to connect to this MySQL server

    如果连接数据库的时候出现这个问题 Host 'XXX' is not allowed to connect to this MySQL server 说明 Mysql数据库 不允许远程连接, 需要修改 ...

随机推荐

  1. WDA-FPM-2-APPLICATION-TABSTRIP(OIF)

    转载:https://www.cnblogs.com/sapSB/p/10081344.html   FPM二:简单的APPLICATION-TABSTRIP(OIF) 1.新建WDA程序ZLYFPM ...

  2. Apache kafka v1.0.0 部署文档

    简介: Apache Kafka 是一个 Scala 语言编写的可扩展.分布式.高性能的容错消息发布.订阅系统. 官网地址:http://kafka.apache.org 中文教程:http://ww ...

  3. 求数组中的逆序对的数量----剑指offer36题

    在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对.输入一个数组,求出这个数组中的逆序对的总数: 如数组{7,5,6,4},逆序对总共有5对,{7,5},{7,6},{7, ...

  4. 线性判别分析LDA详解

    1 Linear Discriminant Analysis    相较于FLD(Fisher Linear Decriminant),LDA假设:1.样本数据服从正态分布,2.各类得协方差相等.虽然 ...

  5. Containerpilot 配置文件 之 Telemetry

    如果提供telemetry选项,ContainerPilot将公开可用于刮擦性能telemetry的Prometheus HTTP客户端界面. telemetry接口被公告为consul服务. tel ...

  6. NBU 还原LINUX ORACLE数据库(CRM)

    [root@oraclea ~]# su - oracle [oracle@oraclea ~]$ bplist -C oracle-db1 -s // -e // -k oracle_oracle- ...

  7. 【c++】多层次继承类对象的构造函数参数的传递方法

    #include <iostream.h> //基类CBase class CBase { int a; public: CBase(int na) { a=na; cout<< ...

  8. 【原创】java删除未匹配的文件夹FileFileFilter,FileUtils,删除目录名字不是某个名字的所有文件夹及其子文件夹

    闲着无聊,写了个小程序. 需求: 举例: 比如我的E盘有一个test的目录,test的结构如下: 要求除了包含hello的目录不删除以外,其他的所有文件夹都要删除. 代码如下: package com ...

  9. sql批量修改字段内容的语句-SQL技巧

    --update '表名' set 要修改字段名 = replace (要修改字段名,'被替换的特定字符','替换成的字符')--update tRecord set columnName = rep ...

  10. 基本控件设置边角图片 drawableleft

    btn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_galley_comment, 0, 0,0); 四个参数分别是左上右下四个方向 ...