0

JRuby 1.7.1 和 Rails 3.2.11

在终端中,我正在运行“rake db:multi:migrate DATABASE=configuration”,但我不断收到以下错误,这意味着据我所知没有创建配置数据库。

Connecting to database specified by database.yml
(4.0ms)  SET SQL_AUTO_IS_NULL=0
rake aborted!
The driver encountered an unknown error: 
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'configuration'

我应该遵循的具体步骤是:

mysql.server start

mysql -uroot
create user 'funapp_test'@'localhost' IDENTIFIED BY 'funapp_test';
grant all privileges on *.* to 'funapp_test'@'localhost' with grant option;
create user 'funapp'@'localhost' IDENTIFIED BY '#sh4r3!';
grant all privileges on *.* to 'funapp'@'localhost' with grant option;

RAILS_ENV=test rake db:create
RAILS_ENV=development rake db:create

mysql -uroot funapp_test < db/structure.sql
mysql -uroot funapp < db/structure.sql

rake db:multi:migrate DATABASE=funapp
rake db:multi:migrate DATABASE=configuration

数据库.yml

development:
adapter: mysql
database: funapp
username: funapp
password: "#sh4r3!"
host: 127.0.0.1
pool: 5
xa: false

test: &test
adapter: mysql
database: funapp_test
username: funapp_test
password: "funapp_test"
host: 127.0.0.1
pool: 5
xa: false

configuration_development:
adapter: mysql
database: configuration
username: funapp
password: "#sh4r3!"
host: 127.0.0.1
pool: 5
xa: false

configuration_test:
adapter: mysql
database: configuration_test
username: funapp_test
password: "funapp_test"
host: 127.0.0.1
pool: 5
xa: false

关于我可以做些什么来解决这个问题的任何想法?我尝试过 rake db:drop 和 rake db:migrate,以及 rake db:create:all(这给了我一个 Riak::Node 配置必须包括 :source 和 :root 键。错误)非常感谢!

4

1 回答 1

0

想通了,比我想象的要简单得多

mysql -uroot
create database configuration;
create database configuration_test;
于 2013-08-09T18:13:26.910 回答