0
votes

I've started getting weird access denied errors running grails 2.2.0 and mysql (mysql Ver 14.14 Distrib 5.6.10, for osx10.7 (x86_64) using EditLine wrapper) on Mac OS X.

Caused by: java.sql.SQLException: Access denied for user 'nfuser'@'localhost' (using password: YES)

Sample code

dataSource {
    pooled = true
    driverClassName = "com.mysql.jdbc.Driver"
    username = "nfuser"
    password = "nfuser"
    dialect = org.hibernate.dialect.MySQL5InnoDBDialect
}
..
    development {
        dataSource {
            dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:mysql://localhost:3306/nf_dev"
        }
    }

The usual grants and db create before running grails.

GRANT all ON nf_dev.* TO 'nfuser'@'%' identified by 'nfuser';

Tested with a brand new project and of course it works.. Ideas?

/S

1
Do you have any grails.config.locations external config files that might be overriding dataSource.password?Ian Roberts
Yes, of course I had, /etc/nf.properties contained a password. Duuhhhh. Asking here helped me finding it pretty much directly. Leaving the question here as a reminder to other stupid suckers like me ;-)Theresia Sofia Snow

1 Answers

0
votes

Duuh, external property file override on dataSource.password..