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: "Host 'admin-PC' is not allowed to connect to this MySQL server")这个问题

解决办法:


mysql -u root -p 

mysql>use mysql; 

mysql>select 'host' from user where user='root'; 

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

mysql>flush privileges; 

mysql>select 'host'   from user where user='root'; 

第一句是以权限用户root登录 

第二句:选择mysql库 

第三句:查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称) 

第四句:修改host值(以通配符%的内容增加主机/IP地址),当然也可以直接增加IP地址 

第五句:刷新MySQL的系统权限相关表 

第六句:再重新查看user表时,有修改。。

重启重启mysql!!!!


启动服务命令 
net start mysql
关闭服务命令 
net stop mysql 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM