I'm trying to write a patch for Rails. The ActiveRecord RUNNING_UNIT_TESTS file says that I have to load the MySQL .sql file from test/fixtures/db_defintions, but there is no mysql.sql. There is a connection.rb, but no mention of it in the Rakefile or in the RUNNING_UNIT_TESTS file. How do I load the MySQL fixtures?
Unless this has changed recently I never had to do that. I just created the activerecord_unittest and activerecord_unittest2 databases and gave the rails user access to them and I was good to go
Fred
Hmm Frederick is right, that's all I've had to do. If you read the latest RUNNING_UNIT_TESTS (http://dev.rubyonrails.org/browser/trunk/ activerecord/RUNNING_UNIT_TESTS) and the connection settings for running tests on MySQL (http://dev.rubyonrails.org/browser/trunk/ activerecord/test/connections/native_mysql/connection.rb), you pretty much create the 'activerecord_unittest' and 'activerecord_unittest2' databases and grant the 'rails' user all privileges and you're good to go.
What steps have you done? Perhaps that'd help us to find out what your problem is.
Cheers, Chu Yeow
I am having the same problem.
I created the rails user I created the two databases: mysqladmin -uroot create activerecord_unittest mysqladmin -uroot create activerecord_unittest I granted permissions: mysql -uroot GRANT ALL PRIVILEGES ON activerecord_unittest.* to 'rails'@'localhost'; GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost';
I run the test: rake test_mysql
And I get the exact same error.
the second was mysqladmin -uroot create activerecord_unittest2
Hmm could be due to this reported bug: http://dev.rubyonrails.org/ticket/10348
Try doing these steps first like the reporter suggests: rake mysql:build_databases rake test_mysql TEST=aaa_create_tables_test.rb
Cheers, Chu Yeow
I've done exactly what the file says. 1. I created the databases activerecord_unittest and activerecord_unittest2. 2. I added a user account for MySQL, as specified in connection.rb. 3. I granted ALL PRIVILEGES to that account to the created databases. 4. rake test_mysql 5. See the test fail.
Yes this fixed my problem.