0

Almost all answers I read say either my databse name or pw is wrong but I am 100% sure it isnt.Here is a http error description : javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)"

If anyone can help me, I would be really greatful.Still a begginer at programming, dont go hard on me. :)

Here is a line of code i used at my other projects and it worked fine for me:

<sql:setDataSource var = "snapshot" driver = "com.mysql.jdbc.Driver" url = "jdbc:mysql://127.0.0.1/project" user = "root"  password = "######"/>
Radiodef
  • 37,180
  • 14
  • 90
  • 125

1 Answers1

0

Execute this by some command line or GUI

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '%password%' WITH GRANT OPTION;

Replace %password% with your password.

And if the above solution can't help you go and find some here

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
prit.patel
  • 330
  • 3
  • 12