我试图建立铁路申请,在我的当地机器上使用MySQL服务器进行开发。 我已成功地汇编了< 编码>mysql2。 gem against MySQLConnector/C;尽管我因安装MySQL服务器而收到同样的错误。 当我试图打<代码>rake db:create时,申请未能与MySQL服务器连接。
MySQL is configured on my machine as a Windows service, started automatically for local-only connections through named-pipes; TCP-IP has been completely disabled. The name of the socket in my my.ini
file is mysql
.
My database.yml
我的铁路申请档案类似:
development:
adapter: mysql2
encoding: utf8 reconnect: false
database: application_dev
pool: 5
username: root密码: **********
host: localhost
socket: mysqltest:
adapter: mysql2
encoding: utf8 reconnect: false
database: application_test pool: 5
username: root密码: **********
host: localhost
socket: mysql
I m recieving的错误是:
D:DropboxProgrammingRubyapplication>rake db:create (in D:/Dropbox/Programming/Ruby/application) Can t connect to MySQL server on localhost (10061) Couldn t create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"application_test", "pool"=>5, "username"=>"root", "password"=>"**********", "host"=>"localhost", " socket"=>"mysql"}, charset: utf8, collation: utf8_unicode_ci
Can t connect to MySQL server on localhost (10061) Couldn t create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnec t"=>false, "database"=>"applicaton_dev", "pool"=>5, "username"=>"root", "password "=>"**********", "host"=>"localhost", "socket"=>"mysql"}, charset: utf8, collation: utf8_unicode_ci
Im 采用Windows 7 家政服务,64-bit, 配送方式如下:
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
Rails 3.0.7
mysql2 rubygem 0.2.7
mysql Ver 14.14 Distrib 5.5.11, for Win32 (x86)
mysqlLinkor/C 6.0.0
我曾尝试重新安装MySQL服务器,使TCP-IP连接起来,而只是hang而不失败。