Exorcismus
Exorcismus

Reputation: 2482

web application can't query from MySQL on server

I have a web application (jsf+hibernate) deployed on a tomcat server that tries to connect to MySQL database on another server, I have added the web app server ip to be allowed when connecting to the MySQL server, when I start the app I get

23:55:50,077  WARN SqlExceptionHelper:144 - SQL Error: 1142, SQLState: 42000
23:55:50,077 ERROR SqlExceptionHelper:146 - SELECT command denied to user 'xxx'@'yyyy' for table 'zzz'
org.hibernate.exception.SQLGrammarException: could not extract 

ResultSet
...

please note that, I have given the user all the privileges, also I can connect to the database from net beans and query normally. also running the web application and the mysql on local host, working fine.

Upvotes: 0

Views: 324

Answers (1)

Mark Leiber
Mark Leiber

Reputation: 3138

Make sure you have the same database name locally and on the remote server. Often database hosts add a prefix or suffix to the database name that is in conflict with what you have in hibernate.

Upvotes: 1

Related Questions