Mysql Access Denied for User 'Xxx'@'Localhost' While Create Connection in Java
There Are User 'Pawa' on My Ubuntu. When I Try Create Connection Object with Code: Properties Properties = New Properties(); Properties. Put("User", "Root")...
There are user 'pawa' on my Ubuntu. When I try create Connection object with code:
Properties properties = new Properties();
properties.put("user", "root");
properties.put("password", "password");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/library_db@localhost");
I get error like:
Caused by: java.sql.SQLException: Access denied for user 'pawa'@'localhost' (using password: NO)
I dont understand why my user appear here? In properties I put root user. I give all permission to my user with
GRANT ALL PRIVILEGES ON library_db.* TO 'pawa'@'localhost';
FLUSH PRIVILEGES;
but it doesnt work.
Edit to include screenshots supplied in comments: