Segmentation fault trying to query MySQL

B

Ben

Hi all,

I'm trying to use DBI to connect to MySQL from ruby. Unfortunately, as
soon as I use execute to try to send a query, it seg-faults. Here's a
sample of code which does this:

require 'rubygems'
gem 'mysql'
gem 'dbi'
require 'dbi'
require 'mysql'

dsn = "DBI:Mysql:DATABASE:www.HOSTNAME.net"
dbh = DBI.connect(dsn, "USERNAME", "PASSWORD")

sth = dbh.execute("select * from pm limit 10;")

I've checked the value of dbh, and it's not nil, and looks fine. No
exceptions are thrown, as I've checked for that too. I'm running this
on Windows - not sure if that makes a difference?

Does anyone know what I'm doing wrong?

Thanks,

Ben
 
L

Luis Lavena

Hi all,

I'm trying to use DBI to connect to MySQL from ruby. Unfortunately, as
soon as I use execute to try to send a query, it seg-faults. Here's a
sample of code which does this:

require 'rubygems'
gem 'mysql'
gem 'dbi'
require 'dbi'
require 'mysql'

dsn = "DBI:Mysql:DATABASE:www.HOSTNAME.net"
dbh = DBI.connect(dsn, "USERNAME", "PASSWORD")

sth = dbh.execute("select  * from pm limit 10;")

I've checked the value of dbh, and it's not nil, and looks fine. No
exceptions are thrown, as I've checked for that too. I'm running this
on Windows - not sure if that makes a difference?

Does anyone know what I'm doing wrong?

What is your ruby version?

Can you provide more information about the MySQL version (more
importantly the libmysql.dll that is in the path, which version it is?
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top