Cant connect to mysql from perl interface

R

Ramesh

Hi,
I installed mysql on my windows xp machine. I am able to go to mysql
prompt and execute database commands. Howerver when I use DBI/
DBD::mysql to connect to the database I see my perl crashing. I am
running the perl script on the same machine where mysql is installed.
I am using perl 5.6.1 and DBD-mysql version 2.9.004. Mysql version is
5.0.27.

Can someone please give me some suggestions on how to fix this?

use DBI;
use Data::Dumper;

my @availabledrivers = DBI->available_drivers;
print Dumper @availabledrivers;

print "Before connect\n";

$dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx');

Thanks.

-Ramesh.
 
U

usenet

I see my perl crashing.

You should never let Perl drive your car.
Can someone please give me some suggestions on how to fix this?

Why are you asking us what the problem is when you haven't even asked
Perl what the problem is?
$dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx');

Try:

$dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx')
or die $DBI::errstr;
 
R

Ramesh

You should never let Perl drive your car.


Why are you asking us what the problem is when you haven't even asked
Perl what the problem is?


Try:

$dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx')
or die $DBI::errstr;


Thanks for the tip. I added the die $DBI::errstr; as you suggested but
I still dont see any output. Cant figure out why perl crashes even
though I put this statement.
 
D

DJ Stunks

Thanks for the tip. I added the die $DBI::errstr; as you suggested but
I still dont see any output. Cant figure out why perl crashes even
though I put this statement.

what do you mean "crashes"?

-jp
 
T

Tintin

Ramesh said:
Thanks for the tip. I added the die $DBI::errstr; as you suggested but
I still dont see any output. Cant figure out why perl crashes even
though I put this statement.

Proper diagnosis of a problem requires exact error messages or
description of how it's not behaving as expected.

Perl crashes is as useless a description as "does not work".
 
R

Ramesh

Proper diagnosis of a problem requires exact error messages or
description of how it's not behaving as expected.

Perl crashes is as useless a description as "does not work".

I get the followin popup - "Perl Command Line Interpreter has
encountered a problem and needs to close. We are sorry for the
inconvenience". I clicked on Debug and I get - An exception 'Unhandled
Win32 Exception' has occured in perl.exe.
 
R

Ramesh

I get the followin popup - "Perl Command Line Interpreter has
encountered a problem and needs to close. We are sorry for the
inconvenience". I clicked on Debug and I get - An exception 'Unhandled
Win32 Exception' has occured in perl.exe.


Problem got resolved by upgrading to following versions
DBI 1.53
DBD-mysql 4.001
from http://theoryx5.uwinnipeg.ca/ppmpackages
 

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,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top