当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby on rails 3 - Rake db:create not doing anything (using mysql2 0..2.7)

问题描述:

I've been trying for a good while to get Rails to talk to MySQL. I was able to install the 'mysql2' gem (v0.2.7), create a new rails app defaulting to MySQL:

rails new mytest -d mysql

and bundle install everything.

However, when I run rake db:create, it simply hangs, no errors, no anything.

Running rake db:create --trace hangs at '** Execute db:create'.

My database.yml configuration:

development:

adapter: mysql2

encoding: utf8

reconnect: false

database: mytest_development

pool: 5

username: root

password: passwordforrootuser

host: localhost

Using:

  • Windows 7 (64-bit)
  • MySQL 5.5 Server (32-bit)
  • Ruby 1.9.2

Really at my wit's end. Help???

网友答案:

Might be worth a try, if you include:

  socket: /tmp/mysql.sock

My setup, normally looks like:

  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: foobar_development
  pool: 5
  username: root
  password: ***************
  socket: /tmp/mysql.sock
分享给朋友:
您可能感兴趣的文章:
随机阅读: