I am trying to configure a perl script that I bought, which is connecting to a MySql database. Here is the code that it is using:
### connect to database on every entry to program use DBI; $driver = "mysql"; # Set somewhere else, just including it here $drh = DBI->install_driver( $driver ); $dbh = $drh->connect( $workspace,$userid,$password ); $rv = $drh->err; $str = $drh->errstr; if ($drh->err != 0) { $errormsg="Cannot connect to database"; &printerr; }


Here is the error I am getting:
Can't use an undefined value as a HASH reference at /usr/lib/perl5/site_perl/5.8.4/i686-linux/DBD/mysql.pm line 115.

I tried installing DBD::mysql again, but it just says it is already installed. Is this in the Perl, or is it actually perhaps a bad install of the DBD::mysql module? I run MySql on other sites on this server with no problems.

I know this is not totally perl, so I apologize, but if you know what could cause it, I would appreciate your responses.

thx,
Richard

In reply to Perl Script connecting to DBD::MySql problem by powerhouse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.