I’m using Hibernate with JPA and MySQL.
I got accessing denied.
java.sql.SQLException: Access denied for user ‘username’@’hostname’ (using password: YES)
I know the username/password are ok. The problem is that is that the driver is appending @’hostname’ at the end. How can I prevent that?
But the grant is only for username, and the machine are different, so I can’t grant for every hostname. (I don’t care if it’s secure or not, it’s a dev server).
I created the database that way:
create database mydbname character_set utf8 collate utf8_general_ci;
GRANT ALL ON mydbname.* TO username IDENTIFIED BY 'password';
You need grant to all machines that must access to MySQL.
If you have to many machines and you don’t want grant every one you can do:
or
I you don’t do this the clients won’t be able to connect to your database
For more info: http://dev.mysql.com/doc/refman/5.1/en/grant.html