在笔记本上安装了mysql, 想测试一下连接池的影响,用了另一台PC来测试一段sql,出现以下错误:
jdbc:mysql://10.201.11.128:3306/test
Cannot create PoolableConnectionFactory (null, message from server: "Host ‘10.201.10.53‘ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts‘")
根据网上教程,在mysql库中更新host的值为%,之后也刷新了,却还是遇到上述的错误
use mysql;
update user set host = ‘%‘ where user = ‘root‘;
这样在远端就可以通过root用户访问Mysql.
第二种方式 赋权 也是不行
后来查看到新版mysql更改方式,如下
use mysql;
alter user ‘root‘@‘%‘ identified with mysql_native_password by ‘root‘;
flush privileges;
Cannot create PoolableConnectionFactory (Could not create connection to database server.)
查看了一下我的mysql版本,
原因是mysql驱动版本太低导致,后来下载了最新的驱动 【https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.13】
Error preloading the connection pool
连接数太大,更改JDBC Connection Configuration中的最大连接数
原文:https://www.cnblogs.com/qianjinyan/p/10248046.html