Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Weird Problem with DBI

by PsychoSpunk (Hermit)
on Jul 03, 2001 at 21:16 UTC ( [id://93587]=note: print w/replies, xml ) Need Help??


in reply to Re: Weird Problem with DBI
in thread Weird Problem with DBI

perldoc DBD::mysql

That being said, your DSN passed to connect isn't properly configured. DBD::mysql requires a different syntax in the connect statement requiring hostname and database instead of simply naming the database you wish to use.

Assuming the mysql-server is on the same box as the script, try: $dbh = DBI->connect("dbi:mysql:database=test;hostname=localhost", "username", "password", {RaiseError => 1});

The RaiseError is just good use of available attributes of the DBI. Read perldoc DBI for more and what they do.

ALL HAIL BRAK!!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-26 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found