java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect

2014年06月29日 ⁄ 综合 ⁄ 共 637字 ⁄ 字号    ⁄ 评论关闭

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

java.sql.SQLException: Access denied for user 'root'@'xxx.xxx.xxx.xxx' at (数据库名)

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

解决:

方案一:改表:

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服务。

http://hi.baidu.com/soutnila/item/5356f2c0002781bf0d0a7bae

java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect的更多相关文章

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

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

  2. 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任意可以输入查询 ...

  3. (办公)mysql连接不上(java.sql.SQLException: null, message from server: "Host 'LAPTOP-O0GA2P8J' is not allowed to connect to this MySQL server")(转)

    转载自csdn文章:https://blog.csdn.net/Tangerine_bisto/article/details/803461511.对所有主机进行访问授权 GRANT ALL PRIV ...

  4. Mysql报错java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to connect

    Mysql报错java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to co ...

  5. 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  ,当然前提是用户名和密码正确

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

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

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

  9. 远程连接Mysql报错 java.sql.SQLException:null,message from server ... is not allowed to connect

    在MySQL命令行输入如下命令: use mysql; select host from user; update user set host ='%' where user ='root'; 然后重 ...

随机推荐

  1. TIB自动化测试快讯 - Appium手机自动化测试学习资料精选

    TIB自动化测试快讯 - Appium手机自动化测试学习资料精选   Appium+Android+Javahttp://automationqa.com/forum.php?mod=viewthre ...

  2. Android Studio 简单功能介绍

    Android Studio  建立系统工具包你用来生成,测试,运行您的应用程序和软件包.构建系统是独立于Android的工作室,所以你可以调用它的Android的工作室或从命令行.在你写你的应用程序 ...

  3. encfs创建时fuse: failed to exec fusermount: Permission denied错误解决

    今天用encfs创建加密文件夹时碰到提示错误fuse: failed to exec fusermount: Permission denied fuse failed. Common problem ...

  4. 【Android】Handler、Looper源码分析

    一.前言 源码分析使用的版本是 4.4.2_r1. Handler和Looper的入门知识以及讲解可以参考我的另外一篇博客:Android Handler机制 简单而言:Handler和Looper是 ...

  5. 将PDM文件导出成CHM帮助文件

    实际开发中常常将维护数据库字段用 powerdesigner 维护起来,而实际要查阅 数据库用了什么字段是,常常又不方便去打开PDM 文件去找. 下面分享一个小工具,效果看下图: 有这个小工具, PD ...

  6. Java Garbage Collection Basics--转载

    原文地址:http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html Overview Purpose ...

  7. 【转载】给VM虚拟机增加硬盘容量

    转载自:http://www.douban.com/note/53678368/ vmware-vdiskmanager [选项]这里的选项你必须包含以下的一些选择项或参数选项和参数描述<dis ...

  8. [转载]部署Office Web Apps Server并配置其与SharePoint 2013的集成

    Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...

  9. iOS-布局-Masonry-优先级

    一.AutoLayout有两个重要的属性: 1.Content Compression Resistance 百度翻译(内容压缩抗力) 2.Content Hugging    百度翻译(内容拥抱) ...

  10. 在eclipse中配置python插件

    最好离线下载python的离线包.名字叫——org.python.pydev.feature-1.6.3.2010100513 此包里面有两个文件夹 features 和 plugins,分别把2包中 ...