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

远程连接mysql数据库,出现异常:

null,message from server:"Host '27,45,38,132' is not allowed to connect

解决方案:

原因是:远程服务器不允许你访问它的数据库。所以,我们要对远程服务器进行设置,使它允许你进行连接。

1,打开cmd命令窗口,进入MySQL安装目录的bin目录,然后登录MySQL

mysql -u root -p

2,输入:切入mysql数据库

use mysql;

3,输入:查看user表

select host,user from user;

4,输入:更改host字段值

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

5,输入:即时生效

flush privileges; 

6,如果还是没效果,再次输入:创建远程登陆用户并授权:

grant all PRIVILEGES on msyql.* to root@'192.168.1.101'  identified by '';
grant all PRIVILEGES on sys.* to root@'192.168.1.101' identified by '';

或者

grant all PRIVILEGES on *.* to root@'192.168.1.101'  identified by '';

上面的语句表示将 test_db 数据库的所有权限授权给 root 这个用户,允许 root 用户在 192.168.1.101 这个 IP 进行远程登陆,并设置 root 用户的密码为 123456 。

7,输入:即时生效

flush privileges; 

Mysql报错java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to connect的更多相关文章

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

  2. 远程连接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'; 然后重 ...

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

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

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

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

    java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect 2014年06月29日  ...

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

  8. (办公)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 ...

  9. Spring 连接MySQL报错java.sql.SQLException: Unknown system variable 'tx_isolation'

    先是报错255,这个时候需要把 jdbc:mysql://localhost:3306/projUse 写成 jdbc:mysql://localhost:3306/projUse?useUnicod ...

随机推荐

  1. vue弹窗组件

    文件结构 component.vue <template> <div class="_vuedals" v-show="show"> & ...

  2. ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper create failed after 4 attempts

    ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper create failed after 4 attempts ERROR [main] m ...

  3. Selenium基础知识(三)元素判断

    一.由于有些页面加载完后,某些元素还没有加载,这样就会导致异常,脚本稳定性变差 为了解决这个问题,selenium提供了WebDriverWait以及implicitly_wait()等待 WebDr ...

  4. PHP 函数 ignore_user_abort()详解笔记

     定义和用法 ignore_user_abort()函数设置与客户机断开是否会终止脚本的执行  语法 ignore_user_abort(setting) 参数 描述 setting 可选.如果设置为 ...

  5. sqli-labs(十二)(and和or的过滤)

    第二十五关: 这关是过滤了and 和or 输入?id=1' or '1'='1 发现or被过滤了,将or换成and也一样. 输入?id=1' oorr '1'='1 这样就可以了,将一个or置空后,o ...

  6. 014-Session服务器状态保持

    开始并为Session赋值:Session[“uName”]=“CNYaoMing”;取值:string strName = Session[“uName”].ToString();销毁(取消/退出) ...

  7. mysql 5.6 每天凌晨12:00 重置sequence表中的某个值

    #.创建evevt要调用的存储过程update_current_value_procedure delimiter // drop procedure if exists update_current ...

  8. IT新起之秀

    辞职以后自己比较迷茫,不知道自己能干什么,09年毕业到现在虽然工作经验有7.8年,但是感觉自己什么都不会,除了自己能下车间别的好像也做不成,没有一技之长.我更像是一个经验用了7.8年而不是有7.8年的 ...

  9. sitecore系列教程之更改您的个人设置

    在Sitecore控制面板中,您可以设置个人设置,例如密码或区域和语言选项,以使应用程序满足您的需求. 要更改您的个人设置: 在Sitecore Launchpad上,单击“ 控制面板”. 在“控制面 ...

  10. this上下文一致

    什么是this对象 先来说说什么是this对象吧,每个函数在调用的时候都会自动获取两个特殊变量:this和arguments对象.this值具体是指哪个对象是和该函数的执行环境相关的.如果是作为对象的 ...