MySQL Module - Segmentation Fault - Windows

V

Venks

Hi,

I am getting "segmentation fault" when I try to run the following
piece of ruby code.

1) I installed the latest version of MySQL version for Windows 5.1.22
2) I installed the MySQL module using "gem install mysql" and chose
option 1 (mysql 2.7.3. win32)

I don't have this problem on Linux running Fedora. Unfortunately I
really need to make this work on my laptop running windows where most
of the development will be done.

Thanks,

-Venks

==============================================================
#!/usr/bin/ruby -w
# Ruby script using Ruby MySQL module to test connection information

require "mysql"

begin

dbh = Mysql.real_connect("localhost", "csread", "csread", "csapp")

puts "Client Info: " + dbh.get_client_info

rescue Mysql::Error => e

puts "Error code: #{e.errno}"
puts "Error message: #{e.error}"
puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")

ensure

dbh.close if dbh

end
====================================================================
 
L

Luis Lavena

Hi,

I am getting "segmentation fault" when I try to run the following
piece of ruby code.

1) I installed the latest version of MySQL version for Windows 5.1.22
2) I installed the MySQL module using "gem install mysql" and chose
option 1 (mysql 2.7.3. win32)

I don't have this problem on Linux running Fedora. Unfortunately I
really need to make this work on my laptop running windows where most
of the development will be done.

Did you run the same MySQL version under Fedora?

I didn't updated to latest beta (5.1) of MySQL, this is my result:

D:\Users\Developer\Desktop>ruby -w db_test.rb
Client Info: 5.0.45
Error in my_thread_global_end(): 1 threads didn't exit

5.1 is flagged as Release Candidate / Development Release. Maybe the
mysql-ruby bindings need to be tweaked for making this compatible.

Since mswin32 extensions need VC6, do you have the compiler available
to build from source?
 
V

Venks

No. I don't have the compiler and I can confirm that this is becuase
of MySQL 5.1.

When I install MySQL 5.0 on my laptop, things work fine.
 
D

Daniel Griffiths

Venks said:
Hi,

I am getting "segmentation fault" when I try to run the following
piece of ruby code.

1) I installed the latest version of MySQL version for Windows 5.1.22
2) I installed the MySQL module using "gem install mysql" and chose
option 1 (mysql 2.7.3. win32)

I don't have this problem on Linux running Fedora. Unfortunately I
really need to make this work on my laptop running windows where most
of the development will be done.

Thanks,

-Venks

I am having the same issue, although with MySQL version 5.0.45.
The steps I followed were as followed:
1) Download "mysql-5.0.45-win32.zip" from the MySQL community server 5.0
downloads page
2) Extract and run the contained "Setup.exe"
3) Perform installation of MySQL 5.0.45
4) Install mysql 2.7.3 win32 using "gem install mysql"
5) Run "irb" and try "require 'mysql'"

Each time I get:
c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/mysql.so: [BUG] Segmentation
fault
ruby 1.8.6 (2007-03-13) [i386-mswin32]
No. I don't have the compiler and I can confirm that this is becuase
of MySQL 5.1.

When I install MySQL 5.0 on my laptop, things work fine.

I was wondering which specific version of MySQL 5.0 you used and whether
you installed any other software to help get this to work.

I have tried trawling through Google but the answers to
Windows/MySQL/Ruby seem to be scattered and many are for older versions
of Ruby.

Thanks,
Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top