0

hi my app is based on spring-hibernate.Database is mysql. I imported my db with phpmyadmin in jelastic. hibernate connection detail

 <property name="url"
                value="jdbc:mysql://mysql-estate.jelastic.servint.net/realestate" />
            <property name="username" value="root" />
            <property name="password" value="password" />

after i deployed my war file and shows following error on browser..

message Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'192.168.3.21' (using password: YES))

2
  • 1
    Did you give proper permissions to the root user in Mysql? Commented May 30, 2014 at 14:16
  • how do i set permssion on phpmyadmin Commented May 30, 2014 at 14:30

1 Answer 1

2

Mysql won't allow root connections from any host by default. You've got to whitelist account access. A better way to do this would be to create a mysql user for your application, and give that user remote login privileges.

Here's how you do that: CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass'; GRANT ALL ON db1.* TO 'jeffrey'@'localhost';

Note that when specifying a user you are required to specify a host.

Sign up to request clarification or add additional context in comments.

2 Comments

yes url is correct, the error message you're receiving indicates that you are connecting to the database, but the credentials you're using are not valid. you need to allow access to the database from a specific user and host.
cleared above problem. now it is showing java.net.UnknownHostException: mysql.hibernate.estate.jelastic.servint.net error....!! my environment name:-estate.jelastic.servint.net/ i refereed the link docs.jelastic.com/jelastic-db-hibernate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.