MySQL Unit Test Login Failure

I just recently started having issues running unit tests for my application, but can't figure out why. When I run rake test:units, I get "Access denied for user 'root@localhost' using password: NO".

My database.yml file is configured to use the ODBC login, but it's not being passed to my unit tests. Any ideas?

development:   adapter: mysql   encoding: utf8   database: db_development   username: ODBC   password:   socket: /tmp/mysql.sock

test:   adapter: mysql   encoding: utf8   database: db_test   username: ODBC   password:   socket: /tmp/mysql.sock

U have odbc as the user for test db. But u have root as user in mysql.
Either change odbc to root or create odbc user in mysqladmin.

Http://www.rubyplus.org Free Ruby & Rails screencasts

Bcp wrote:

U have odbc as the user for test db. But u have root as user in mysql. Either change odbc to root or create odbc user in mysqladmin.

I have both the root and ODBC users set up in mysql. I thought that the database.yml file would tell the tests to use the ODBC user instead of the root user. Is there some other location where the test is getting the user?

After digging around the environment was being set in another spot, so as soon as I commented that out, everything worked great.