English 中文(简体)
铁路应用程序 无法通过Named-Pipe/Socket——Windows 7 x64
原标题:Rails Application Cannot Connect to Local MySQL Server Through Named-Pipe/Socket --- Windows 7 x64

我试图建立铁路申请,在我的当地机器上使用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: mysql

test:
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而不失败。

问题回答

请具体说明贵国数据库中的港口号码。 添加这一参数:

port: 3306 (or whatever your mysql port has)




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签