1.问题出现

在学习activemq的时候,配置activemq去连接mysql 但是activemq一起动就报错误连接不到mysql 说不允许连接。

java.io.IOException: Cannot create PoolableConnectionFactory (null,  message from server: "Host '192.168.58.134' is not allowed to connect to this MySQL server")

2.问题分析

是mysql对用于进行限制远程客户端连接。修改一下就可以了。

3.问题解决

mysql > grant all privileges on db_name.* to usr_name@'%' identified by 'pwd';

其中,db_name 是数据库名, usr_name 用户名, pwd 密码。'%' 为通配符。

mysql > flush privileges ;

4.参考博客

https://blog.csdn.net/timo1160139211/article/details/72831771