Hey guys,

I'm looking into migrating some vanilla Java code (PreparedStatements etc.) 
to JOOQ. Everything works great on my development machine, but when I try 
to run the code on the production machine, using the exact same permissions 
for the user, I run into a permissions issue.

Exception in thread "main" org.jooq.exception.DataAccessException: SQL 
[select `mydb`.`flags`.`field`, `mydb`.`flags`.`value` from 
`mydb`.`flags`]; SELECT command denied to user 'java'@'[IP_goes_here]' for 
table 'flags'


Code used to create the user:

CREATE USER 'java'@'%' IDENTIFIED BY '[pass_goes_here]';
GRANT ALL PRIVILEGES ON MyDB.* TO 'java'@'%' WITH GRANT OPTION;

FLUSH PRIVILEGES; 


The non-JOOQ code works fine, I am able to login with that username just 
fine using the command line, but JOOQ just throws that error. I'm sure I'm 
missing some permission, but I can't figure out what.
The code that throws that exception:

DSL.using(staticConnection, SQLDialect.MYSQL)
.select(Tables.FLAGS.FIELD, Tables.FLAGS.VALUE)
.from(Tables.FLAGS)
.fetch();


What I tried so far:
- Upgraded from Percona 5.6 to 5.7
- Downgrade from MySQL 6 to 5 and back again
- Deleting and re-creating the user.

What do you think's going on?

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to