in reply to connecting to Mysql from Win32

Well, so I thought I might check into this further so I ran this code with "perl -d" and the last part of that output is as follows:
DB<1> dsn: DBI:mysql:database=ssis;host=128.83.153.43 main::(mysql_connect.pl:21): $dbh = DBI->connect($dsn,$dbuser,$dbpa +ss) or die "couldn't connect to $dbhost: " . DBI->errstr . "\n"; DB<1> x $dbh 0 undef DB<2> n Signal SEGV at C:/Perl/site/lib/DBI.pm line 486 DBI::connect('DBI', 'DBI:mysql:database=ssis;host=1.2.3.4', 'u +ser', 'pass') called at mysql_connect.pl line 21
Any thoughts on the SEGV?

Replies are listed 'Best First'.
Re^2: connecting to Mysql from Win32
by tachyon (Chancellor) on Oct 22, 2004 at 23:17 UTC

    Any thoughts on the SEGV?

    Well I assume you know a SEGV is a SEGmentation Violation aka a SEGFAULT. Given that I and many others connect to Linux based Mysql databases from Win32 using DBI without any issues the question is why?

    The DB connection is a TCP one to 3306 so your Win32 and Linux firewalls need to allow that. You don't show it but I assume that your real connection string includes server *and* port:

    'dbname=DATABASENAME;host=MYSQLSERVER.DOMAIN.COM:3306'

    You should be able to connect via telnet :

    C:\> telnet mysqlserver.domain.com 3306 0 4.0.20-standardZZ5;eo{=,&#9787; Connection to host lost. C:\>
    And see a response like the one above from your remote Mysql server. If not you have a firewall issue to fix.

    Assuming you are pointing the connect string at the server:port where your Mysql server lives then a likely reason is that you are using binaries for DBI and DBD::Mysql that are linked against the wrong C libraries for your system. The first suggestion is to install the latest versions of DBI and DBD::Mysql you can find. Also just make a trivial test script that connects, makes a query and disconnects to make sure it is not an issue with DBI and the other modules you are using. If you have CL.EXE you could compile DBI and DBD::Mysql yourself which would almost certainly resolve the issue.

    cheers

    tachyon