开发者

Can't connect to MySQL from webapp in Ubuntu

开发者 https://www.devze.com 2023-01-14 16:47 出处:网络
I have a MySQL database I\'m able to connect via the command prompt and the MySQL administration tool but using the same credentials in a Web application in a Tomcat server on the same server gives me

I have a MySQL database I'm able to connect via the command prompt and the MySQL administration tool but using the same credentials in a Web application in a Tomcat server on the same server gives me this error:

javax.servlet.ServletException: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

Which I recognize as an incorrect credentials issue. I checked that the MySQL server is listening on port 3306 using netstat. I don't have the mysql ro开发者_如何转开发ot credentials but I created a new account and granted all priviledges to it and are the ones used to connect both using the command prompt and the MySQL admin tool.


Turned out to be a caching issue. Disabled the context caching in the web application in order to "see" the changes. Windows doesn't show this behavior/issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消