rake db:create:all 在redmine中创建开发数据库失败

发布于 2024-11-26 23:32:18 字数 1215 浏览 1 评论 0原文

我一直在尝试在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏日落 2024-12-03 23:32:18

确保您的用户有权在 mysql 中创建数据库,例如:

grant all on redmine_development.* to bitnami;

从 mysql 控制台应该可以解决问题。

Make sure that your user has access to create the database in mysql, something like:

grant all on redmine_development.* to bitnami;

from the mysql console should hopefully do the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文