Erorr Connecting database in Quercus on tomcat

603 Views Asked by At

I am using Quercus for my blog combined with another Spring+MySQL+tomcat main app(2 war in 1 server). On my localhost i am able to compile WordPress PHP files compiled and everything seems great. But when i put same configuration on my hosting company cloud, i start getting "Error connecting Database" on my www.abc.com/blog page.

I have made changes in blog app's context.xml to have my database connection settings-

<Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource"
           maxActive="10" maxIdle="3" maxWait="10000"
           username="xxx" password="xxx" driverClassName="com.mysql.jdbc.Driver"
           url="jdbc:mysql://xxx.com/xxx?autoReconnect=true"/>

along with web.xml

<init-param>
  <param-name>database</param-name>
  <param-value>jdbc/xxx</param-value>
</init-param>

but this is not working. I have even put in same database connection settings in context.xml of my tomcat server but still same error i am getting. Please help me.

1

There are 1 best solutions below

1
On

It sounds like either:

  1. you did not grant permissions for that MySQL user to access that database

  2. you did not grant permissions for the cloud instance to access the MySQL server