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. 可视化库-seaborn-单变量绘图(第五天)

    1. sns.distplot 画直方图 import numpy as np import pandas as pd from scipy import stats, integrate impor ...

  2. Game2048

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  3. hivepython 实现一行转多行

    案例1: ==效果等同于一行转多行 数据表名称:zhangb.gid_tags 数据格式,每行是2个字段,(gid,tags) ,可能有脏数据,分隔符为“\t”,   ANDROID-9de77225 ...

  4. Mysql update 索引

    执行mysql update,或者delete的时候会遇到: You can't specify target table for update in FROM clause 相关的原因自不必说:下面 ...

  5. Swagger+ springfox +Spring mvc

    简介 Swagger 是一个规范和完整的框架,用于生成.描述.调用和可视化 RESTful 风格的 Web 服务.总体目标是使客户端和文件系统作为服务器以同样的速度来更新.文件的方法,参数和模型紧密集 ...

  6. 安装RabbitMq-----windows

    在官网download我们所需要的版本,安装rabbitMq需要erlang支持 rabbitMq :http://www.rabbitmq.com/download.html erlang  :ht ...

  7. 取消svn add

    svn commit之前,add的东西都可以取消. 通过先执行svn cleanup,再执行svn revert --recursive example_folder.

  8. day2:vcp考试

    Q21. An administrator has been instructed to secure existing virtual machines in vCenter Server.Whic ...

  9. .NET格式化字符串详细说明

    DataFormatString属性:{0:Bxx}B为取值类型 C 以货币格式显示数值. D 以十进制格式显示数值. E 以科学记数法(指数)格式显示数值. F 以固定格式显示数值. G 以常规格式 ...

  10. 10-string类的length()返回值一起的问题

    c++ string类length()(size())函数返回值–无符号数 首先,先来发现问题 string s = ""; for(int i = 0; i < s.len ...