繁体   English   中英

rake db:multi:migrate DATABASE = JRuby,mysql,riak的配置错误

[英]rake db:multi:migrate DATABASE=configuration error with JRuby, mysql, riak

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

数据库

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键。错误)非常感谢!

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

mysql -uroot
create database configuration;
create database configuration_test;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM