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. 【LeetCode每天一题】Palindrome Number( 回文数字)

    Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same back ...

  2. 合理利用配置不同的机器资源做redis cluster的server

    Redis cluster可以使用不同配置的机器学习因为我们可以手动调整不同的机器所承担的slot的个数,这样内存小CPU相对少的机器应该承担更少的slots

  3. CentOS6.5安装Maven3.2.5

    1.首先从官网下载最新的安装包http://maven.apache.org/download.cgi  apache-maven-3.2.5-bin.tar.gz 2.上传安装包到 /usr/loc ...

  4. Elasticsearch5.x批量插入数据(Java)

    先上官方示例代码:官方示例 Java代码: // 批量插入数据 public void InsertBatch() { try { // 设置集群名称 Settings settings = Sett ...

  5. GBDT调参总结

    一.GBDT类库弱学习器参数 二.回归 数据集:已知用户的30个特征,预测用户的信用值 from sklearn.ensemble import GradientBoostingRegressor f ...

  6. mint-ui Picker的使用

    <template> <div v-bind:style="{minHeight:clientHeight + 'px'}" id="recive-mi ...

  7. MySQL.配置MariaDB的字符集

    配置MariaDB的字符集 环境: 操作系统:CentOS Linux release 7.x mariadb安装及配置 yum install mariadb-server mariadb #安装 ...

  8. Css预处理器---Less(二)

    三.Less语法 (1)变量 //less代码 @nice-blue : #5B83AD; @light-blue : @nice-blue + #111; #header { color : @li ...

  9. JAVA_Stream_练习

    package airycode_java8.nice7; import airycode_java8.nice1.Employee; import org.junit.Test; import ja ...

  10. JavaScript中直接量和变量

    标题 1.直接量 顾名思义,可以直接拿来使用的量.那哪些是直接量呢?数据类型又有很多种,因为不同类型的数据处理方式是不同的,所以数据要分类型 基本类型 1.1 String字符串 用单引号或双引号引起 ...