Announcement Announcement Module
No announcement yet.
org.springframework.jdbc.CannotGetJdbcConnectionEx ception Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.jdbc.CannotGetJdbcConnectionEx ception

    Hi all,

    I am getting the below exception in spring mvc project.

    org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

    I checked the privileges in mysql.It is all looking good.I ran the below query to check the privileges for root user
    SELECT * from mysql.user WHERE user = 'root';

    Pls find the below screenshot for the mysql privileges.

    Here is my code related to database connection in servlet xml file.

    <bean id="ds" class="org.springframework.jdbc.datasource.DriverM anagerDataSource" >
    <property name="driverClassName" ><value>com.mysql.jdbc.Driver</value></property>
    <property name="url" ><value>jdbc:mysql://localhost:3306/WORK</value></property>
    <property name="username" ><value>root</value></property>
    <property name="password" ><value>admin</value></property>

    Pls let me know on how to resolve this issue.I really appreciate all your help.Thanks a lot.
    Attached Files

  • #2
    Please use [ code][/code ] tags when posting code, that way it remains readable.

    If you don't get access either your password is wrong our your user doesn't have access to the databse you are trying to use (WORK in this case).