0

当我运行命令时,rake db:create 我收到以下消息:

Couldn't create database for {"password"=>"secret1", "username"=>"root", "host"=>"localhost", "database"=>"zooz_development", "encoding"=>"utf8", "port"=>3307,
"adapter"=>"mysql"}, charset: utf8, collation: utf8_unicode_ci (if you set the c
harset manually, make sure you have a matching collation)

我正在使用 win7 mysql 正在使用端口 3307 我已经安装了 mysql gem,这是我的 database.yml 文件:

    development:
  adapter: mysql
  encoding: utf8
  database: zooz_development
  username: root
  password: secret1
  port: 3307
  host: localhost




# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  encoding: utf8
  database: chmaysa_test
  username: root
  password: secret1
  port: 3307
  host: localhost


production:
  adapter: mysql
  encoding: utf8
  database: zooz_development
  username: root
  password: secret1
  port: 3307
  host: localhost
4

1 回答 1

0

尝试:

将此添加到您的 Gemfile: gem 'mysql2'

并将您的适配器从更改mysqlmysql2

于 2013-03-27T18:58:07.340 回答