Linked Questions

Popular Questions

I'm trying to connect to mysql database, but I get one and the same error: javax.servlet.ServletException: java.sql.SQLException: Access denied for user 'user'@'localhost' (using password: YES)

I've already tried the following solutions:

  1. Checked my username and password. MySQL connection is established via username = user1, password = 123. I use the same in my code, when I connect to the database: Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/employee","user1", "123");
  2. Granted privileges to user1 in the following manner: GRANT ALL PRIVILEGES ON * . * TO 'user1'@'localhost'; FLUSH PRIVILEGES; By the way I have the same problem when I try to connect with 'root'@'localhost'. Do you have any ideas why it doesn't work still?

Related Questions