rake db:create:all 在redmine中创建开发数据库失败
我一直在尝试在Redmine中创建开发和测试数据库, rake db:create:all,但我收到以下错误:
Couldn't create database for {"encoding"=>"utf8", "username"=>"bitnami", "adapter"=>"mysql", "database"=>"redmine_development", "host"=>"localhost", "password"=>"e06fad54d8", "socket"=>"/home/tudor/redmine-1.2.0-0/mysql/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation) rake aborted! Don't know how to build task 'development'
这是我的database.yml 文件
production:
adapter: mysql
database: bitnami_redmine
host: localhost
username: bitnami
password: ********
socket: /home/tudor/redmine-1.2.0-0/mysql/tmp/mysql.sock
encoding: utf8
development:
adapter: mysql
database: redmine_development
host: localhost
username: bitnami
password: *********
socket: /home/tudor/redmine-1.2.0-0/mysql/tmp/mysql.sock
encoding: utf8
我检查过mysql 已打开。 生产数据库是默认创建的,问题出在开发数据库上。 我在阅读其他论坛时发现的一个可能的错误来源是在我的database.yml 中使用制表符而不是两个空格,但这里的情况并非如此。
测试配置:
- Ubuntu 11.04 Redmine v.1.2.0 Ruby v.1.8.7 Rake v.0.8.7 Rails v. 2.3.11
I have been trying to create the development and test databases in Redmine, with
rake db:create:all, but I have receive the following error :
Couldn't create database for {"encoding"=>"utf8", "username"=>"bitnami", "adapter"=>"mysql", "database"=>"redmine_development", "host"=>"localhost", "password"=>"e06fad54d8", "socket"=>"/home/tudor/redmine-1.2.0-0/mysql/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation) rake aborted! Don't know how to build task 'development'
This is my database.yml file
production:
adapter: mysql
database: bitnami_redmine
host: localhost
username: bitnami
password: ********
socket: /home/tudor/redmine-1.2.0-0/mysql/tmp/mysql.sock
encoding: utf8
development:
adapter: mysql
database: redmine_development
host: localhost
username: bitnami
password: *********
socket: /home/tudor/redmine-1.2.0-0/mysql/tmp/mysql.sock
encoding: utf8
I've checked that mysql is turned on.
The production database is created by default, the problem is with the development one.
One possible source of error that I found while reading other forums is using tab instead of two spaces in my database.yml, but that's not the case here.
Testing configuration :
- Ubuntu 11.04 Redmine v. 1.2.0 Ruby v. 1.8.7 Rake v. 0.8.7 Rails v.
2.3.11
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的用户有权在 mysql 中创建数据库,例如:
从 mysql 控制台应该可以解决问题。
Make sure that your user has access to create the database in mysql, something like:
from the mysql console should hopefully do the trick.