Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: mysql

by robartes (Priest)
on Apr 10, 2003 at 07:39 UTC ( [id://249554]=note: print w/replies, xml ) Need Help??


in reply to mysql.pm not found

Are you using DBD::Mysql directly? In that case, you probably mistyped - you wanted to say use Mysql; whereas it appears you said use mysql;.

If this is the case, consider switching to using DBI in conjuction with DBD::Mysql.

If this is not the case, could you post the relevant portion of your script, so we can have a better look at the problem.

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: mysql
by Anonymous Monk on Apr 10, 2003 at 07:47 UTC
    here is the code
    #!/usr/bin/perl -w use Mysql; $Host = "Localhost"; $Database = "test"; $User = "user"; $Passwd = ""; $dbh = Mysql->connect($Host, $Database, $User, $Passwd); $sql_statement = "select * from TEST"; $sth = $dbh->query($sql_statement); if (!defined $sth) { warn($dbh->errmsg); } while ( @row = $sth->fetchrow_array ) { print "$row[0]\t$row[1]\n"; } exit 0;
      Ah, in that case you probably do not have the module installed. Try installing it with CPAN.pm:
      $ perl -MCPAN -e 'install Bundle::DBD::mysql'
      If that works (if it's the first time you use CPAN.pm, you will have to answer some configuration questions), you should be set to go. But, as said, do consider switching to DBI (which is installed with the bundle).

      CU
      Robartes-

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://249554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found