Mysql::Error: Lost connection to MySQL server during query:

解决这个问题的步骤是:
1.下载 [url=http://www.vandomburg.net/files/mysql-ruby-windows-2.7.1.zip]mysql/ruby 2.7.1[/url]


2解压其中的mysql.so到%RUBYARCHDIR%目录下(例如:C:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt)

3.MySQL/Ruby needs a DLL dependency satisfied in order to run. You can do this by either:

[list]------(Recommended) Including the MySQL bindir in your path (e.g. C:\Program Files\MySQL\MySQL Server 5.0\bin).[/list]

[list]------Copying libmysql.dll from your MySQL bindir or source package to your Ruby bindir (e.g. C:\ruby\bin).[/list]

[quote]Instant Rails users: You will find that the libmysql.dll from the included PHP distribution won’t work. Instead, grab a libmysql.dll from a real MySQL distribution. InstantRails 1.3a comes with MySQL 4.1.9, which you can download here

[/quote]

4.To verify, try to run the following code:

[code]
require 'mysql'
puts Mysql::VERSION[/code]

If it outputs 20700, then you’re all set up
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值