MySql2 adapter hangs in Rails3 on Windows XP

Previously we’ve used Rails2.xx with no problems and we’re trying to
upgrade to ruby 1.9.2p180 and Rails 3.0.7 with pik to keep ruby
versions separate.

After some initial difficulties with MySql2 gem installation,
following these tips got mysql2 v0.2.7
installed.

My problem is that mysql2 hangs whenever I invoke it. For instance,
rake db:create never finishes.

Similarly, “rake db:migrate” and “rails console” also hang.

In all cases, if I kill the hung process, there is a stack trace that
shows basically the same hung location:
(in C:/Projects/Rails3/xxx)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate —this never finishes.
^C
C:…some…path…/mysql2_adapter.rb:312:in query' C:..some..path../mysql2_adapter.rb:312:inexecute’
C:…some…path…/mysql2_adapter.rb:629:in configure_connection' <snip> C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:inrun’
C:/Ruby192/bin/rake:31:in `’

I’ve checked the Gemfile and run bundle install.

Here is a snippet from the database.yml
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: xxx_schema_name_xxx
pool: 5
username: xxuser
password: xxpwd
host: xxx_dev.devhost.com
port: 3306

I have reconfigured this for a db local on my PC and for a remotes db-
server. Both of those databases respond normally to commandline mysql
monitor and to MySql Workbench.

The tests with sqlite3 databases work fine.

On Thursday 09 June 2011 03:32 AM, Eric Norberg wrote:

Previously we’ve used Rails2.xx with no problems and we’re trying to
upgrade to ruby 1.9.2p180 and Rails 3.0.7 with pik to keep ruby
versions separate.

After some initial difficulties with MySql2 gem installation,
followingthese tips got mysql2 v0.2.7
installed.

Based on my recent experience, I had found v0.2.6 to work well, not sure
if 0.2.7 is stable enough yet.

** Execute environment

port: 3306

I have reconfigured this for a db local on my PC and for a remotes db-
server. Both of those databases respond normally to commandline mysql
monitor and to MySql Workbench.

The tests with sqlite3 databases work fine.


Thanks& Regards,
Dhruva S.

Installing 0.2.6 fixes it. Thanks for information.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs