I just did a new install on Ubuntu 16.04 and MySQL 5.7. Im able to connect on the command line by my application running in Tomcat is getting access denied for the same user. Here is how I created my user:
create user 'myuser'@'localhost' identified by 'mypassword';
grant all on myschema.* to 'invenio'@'myuser';
I can login from the command line and get access to everything:
mysql -u myuser -p
But, my application gets access denied for the same user/password
show grants;
| GRANT USAGE ON *.* TO 'myuser'@'localhost' |
| GRANT ALL PRIVILEGES ON `myschema`.* TO 'myuser'@'localhost' |
The user privileges look strange:
SELECT * FROM information_schema.USER_PRIVILEGES;
`myuser'@'localhost' | def | USAGE | NO
This is the error from Tomcat:
Access denied for user 'myuser'@'localhost' (using password: YES)
java.sql.SQLException: Access denied for user 'myuser'@'localhost'
(using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
Any lead to what Im missing would be greatly appreciated.