Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Cant connect to mysql from perl interface

Reply
Thread Tools

Cant connect to mysql from perl interface

 
 
Ramesh
Guest
Posts: n/a
 
      02-22-2007
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:umper;

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

print "Before connect\n";

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

Thanks.

-Ramesh.

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      02-22-2007
On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:

>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;


--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)

 
Reply With Quote
 
 
 
 
Ramesh
Guest
Posts: n/a
 
      02-22-2007
On Feb 21, 4:27 pm, use...@DavidFilmer.com wrote:
> On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:
>
> >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;
>
> --
> The best way to get a good answer is to ask a good question.
> David Filmer (http://DavidFilmer.com)



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.

 
Reply With Quote
 
DJ Stunks
Guest
Posts: n/a
 
      02-22-2007
On Feb 21, 7:22 pm, "Ramesh" <rpallap...@gmail.com> wrote:
> On Feb 21, 4:27 pm, use...@DavidFilmer.com wrote:
> > On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:

>
> > >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;

>
>
> 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

 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      02-22-2007
Ramesh wrote:
> On Feb 21, 4:27 pm, use...@DavidFilmer.com wrote:
>> On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:
>>
>>> 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;
>>
>> --
>> The best way to get a good answer is to ask a good question.
>> David Filmer (http://DavidFilmer.com)

>
>
> 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".

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Ramesh
Guest
Posts: n/a
 
      02-22-2007
On Feb 21, 11:24 pm, Tintin <tin...@invalid.invalid> wrote:
> Ramesh wrote:
> > On Feb 21, 4:27 pm, use...@DavidFilmer.com wrote:
> >> On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:

>
> >>> 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;

>
> >> --
> >> The best way to get a good answer is to ask a good question.
> >> David Filmer (http://DavidFilmer.com)

>
> > 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".
>
> --
> Posted via a free Usenet account fromhttp://www.teranews.com- Hide quoted text -
>
> - Show quoted text -


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.

 
Reply With Quote
 
Ramesh
Guest
Posts: n/a
 
      02-23-2007
On Feb 22, 8:24 am, "Ramesh" <rpallap...@gmail.com> wrote:
> On Feb 21, 11:24 pm, Tintin <tin...@invalid.invalid> wrote:
>
>
>
> > Ramesh wrote:
> > > On Feb 21, 4:27 pm, use...@DavidFilmer.com wrote:
> > >> On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:

>
> > >>> 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;

>
> > >> --
> > >> The best way to get a good answer is to ask a good question.
> > >> David Filmer (http://DavidFilmer.com)

>
> > > 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".

>
> > --
> > Posted via a free Usenet account fromhttp://www.teranews.com-Hide quoted text -

>
> > - Show quoted text -

>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql -- cannot connect (can in Perl) John P. Ruby 6 03-07-2011 03:04 PM
Using perl can I connect to mysql via a ssh tunnel mike_solomon Perl Misc 0 04-16-2009 01:13 PM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM
man i cant belive i cant get help please unclejesse01 DVD Video 2 04-14-2005 03:15 PM
Seen this message? Can't connect to local MySQL server through socket '/tmp/mysql.sock' Allen Marshall Perl Misc 1 01-24-2004 10:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57