rake db:create - collation issues

前端 未结 7 2097
逝去的感伤
逝去的感伤 2020-12-10 18:07
kratos-iii:railsproj zachinglis$ rake db:create
(in /Users/zachinglis/Sites/rails/railsproj)
Couldn\'t create database for {\"adapter\"=>\"mysql\", \"host\"=>\         


        
7条回答
  •  没有蜡笔的小新
    2020-12-10 18:54

    I just encountered this as well on a fresh Snow Leopard install.

    I had another project that created the databases without issue, but my primary project would give the errors you described. After poking around, the only difference was the former specified a socket, whereas the failing project (and yours too) uses a host.

    That is to say, this database.yml causes the problem:

    development:
      adapter: mysql
      database: fanvsfan_development
      username: root
      password:
      host: localhost
    

    But this works:

    development:
      adapter: mysql
      database: fanvsfan_development
      username: root
      password:
      socket: /tmp/mysql.sock
    

    I'm unsure what the actual difference is, but this seems like a workaround.

提交回复
热议问题