1

在我的 cloudcontrol 应用程序上创建数据库时遇到问题:

xxx:~/Sites/e_paper$ cctrlapp epaper/default run "rake db:create"
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "database"=>"xxx", "host"=>"mysqlsdb.xxx.eu-west-1.rds.amazonaws.com", "port"=>3306, "username"=>"xxx", "password"=>"xxx"}, charset: utf8, collation: utf8_unicode_ci
(if you set the charset manually, make sure you have a matching collation)
Connection to ssh.cloudcontrolled.net closed.

我的 database.yml 看起来像这样:

production:
  adapter: mysql2
  encoding: utf8
  pool: 5
  database: <%= "'#{ ENV['MYSQLS_DATABASE'] }'" %>
  host: <%= "'#{ ENV['MYSQLS_HOSTNAME'] }'" %>
  port: <%= ENV["MYSQLS_PORT"] %>
  username: <%= "'#{ ENV['MYSQLS_USERNAME'] }'" %>
  password: <%= "'#{ ENV['MYSQLS_PASSWORD'] }'" %>

网站上的凭据匹配。

有任何想法吗?

4

1 回答 1

2

您需要做的就是将池大小减少到 2(对于免费的 mysql 插件)。此配置对我有用:

production:
  adapter: mysql2
  encoding: utf8
  pool: 2
  database: <%= "'#{ ENV['MYSQLS_DATABASE'] }'" %>
  host: <%= "'#{ ENV['MYSQLS_HOSTNAME'] }'" %>
  port: <%= ENV["MYSQLS_PORT"] %>
  username: <%= "'#{ ENV['MYSQLS_USERNAME'] }'" %>
  password: <%= "'#{ ENV['MYSQLS_PASSWORD'] }'" %>
于 2013-07-03T11:59:49.453 回答