Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
more useful options
 
PerlMonks  

Re: perl + mysql

by chas (Priest)
on May 26, 2005 at 10:35 UTC ( [id://460706]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to perl + mysql

Here is a simple script to test use of DBI, etc:
use DBI; @driver_names = DBI->available_drivers; print "@driver_names\n"; $DSN="DBI:mysql:database=test"; my $dbi=DBI->connect($DSN,"","") or die "Can't connect\n"; my $sth=$dbi->prepare("SHOW DATABASES"); $sth->execute(); $databases=$sth->fetchall_arrayref; for(@$databases){print "@$_\n"} $sth->finish(); $dbi->disconnect; exit;

(You have to have mysql running first. Also, in the connect statement you may need to put the username and password; you can give the password as an argument to the script so you don't hardcode it in.)
chas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://460706]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.