Cant connect to mysql from perl interface

Discussion in 'Perl Misc' started by Ramesh, Feb 22, 2007.

  1. Ramesh

    Ramesh Guest

    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.
    Ramesh, Feb 22, 2007
    #1
    1. Advertising

  2. Ramesh

    Guest

    On Feb 21, 4:07 pm, "Ramesh" <> 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)
    , Feb 22, 2007
    #2
    1. Advertising

  3. Ramesh

    Ramesh Guest

    On Feb 21, 4:27 pm, wrote:
    > On Feb 21, 4:07 pm, "Ramesh" <> 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.
    Ramesh, Feb 22, 2007
    #3
  4. Ramesh

    DJ Stunks Guest

    On Feb 21, 7:22 pm, "Ramesh" <> wrote:
    > On Feb 21, 4:27 pm, wrote:
    > > On Feb 21, 4:07 pm, "Ramesh" <> 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
    DJ Stunks, Feb 22, 2007
    #4
  5. Ramesh

    Tintin Guest

    Ramesh wrote:
    > On Feb 21, 4:27 pm, wrote:
    >> On Feb 21, 4:07 pm, "Ramesh" <> 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
    Tintin, Feb 22, 2007
    #5
  6. Ramesh

    Ramesh Guest

    On Feb 21, 11:24 pm, Tintin <> wrote:
    > Ramesh wrote:
    > > On Feb 21, 4:27 pm, wrote:
    > >> On Feb 21, 4:07 pm, "Ramesh" <> 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.
    Ramesh, Feb 22, 2007
    #6
  7. Ramesh

    Ramesh Guest

    On Feb 22, 8:24 am, "Ramesh" <> wrote:
    > On Feb 21, 11:24 pm, Tintin <> wrote:
    >
    >
    >
    > > Ramesh wrote:
    > > > On Feb 21, 4:27 pm, wrote:
    > > >> On Feb 21, 4:07 pm, "Ramesh" <> 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
    Ramesh, Feb 23, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lasse Edsvik

    Cant connect to db......

    Lasse Edsvik, Jan 20, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    1,632
    =?Utf-8?B?SmFtaWU=?=
    Jan 21, 2004
  2. Nagaraj
    Replies:
    1
    Views:
    856
    Lionel B
    Mar 1, 2007
  3. John P.
    Replies:
    6
    Views:
    288
    John P.
    Mar 7, 2011
  4. Allen Marshall
    Replies:
    1
    Views:
    192
    Gunnar Hjalmarsson
    Jan 24, 2004
  5. mike_solomon
    Replies:
    0
    Views:
    167
    mike_solomon
    Apr 16, 2009
Loading...

Share This Page