Rails Application Cannot Connect to Local MySQL Server Through Named-Pipe/Socket --- Windows 7 x64 -


i'm trying set rails application use mysql server on local machine development. have compiled mysql2 gem against mysqlconnector/c; although have received same error using libmysql.dll bundled installation of mysql server. when attempt rake db:create, application fails connect mysql server.

mysql configured on machine windows service, started automatically local-only connections through named-pipes; tcp-ip has been disabled. name of socket in my.ini file mysql.

my database.yml file rails application looks this:

development:
adapter: mysql2
encoding: utf8 reconnect: false
database: application_dev
pool: 5
username: root

password: **********

host: localhost
socket: mysql

test:
adapter: mysql2
encoding: utf8 reconnect: false
database: application_test pool: 5
username: root

password: **********

host: localhost
socket: mysql

and error i'm recieving is:

d:\dropbox\programming\ruby\application>rake db:create (in d:/dropbox/programming/ruby/application) can't connect mysql server on 'localhost' (10061) couldn't create database {"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 mysql server on 'localhost' (10061) couldn't create database {"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

i'm using windows 7 home premium 64-bit following ruby/rails/mysql distribution:

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, win32 (x86)

mysql connector/c 6.0.0

i've tried reinstalling mysql server , enabling tcp-ip connections, , hangs instead of failing.

try specify port number in database.yml adding parameter:

port: 3306 (or whatever mysql port has) 

Comments