gpt4 book ai didi

mysql - rake 数据库 :multi:migrate DATABASE=configuration error with JRuby, mysql,riak

转载 作者:行者123 更新时间:2023-11-30 01:24:42 36 4
gpt4 key购买 nike

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

最佳答案

搞清楚了,比我想象的要简单

mysql -uroot
create database configuration;
create database configuration_test;

关于mysql - rake 数据库 :multi:migrate DATABASE=configuration error with JRuby, mysql,riak,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18149304/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com