Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: YAMSP (Yet Another MySQL Socket Problem)

by chrism01 (Friar)
on Oct 13, 2008 at 01:58 UTC ( [id://716729]=note: print w/replies, xml ) Need Help??


in reply to YAMSP (Yet Another MySQL Socket Problem)

Well, I've always used this method:
sub db_connect { my ( $db, # database to connect to $dsn, # data source name ); # Create data source string and connect ... $dsn = "DBI:mysql:". "database=".$cfg::params{'DB_NAME'}.";". "host=".$cfg::params{'DB_HOST'}.";". "port=".$cfg::params{'DB_PORT'}; $cfg::dbh = DBI->connect( $dsn, $cfg::params{'DB_USER'}, $cfg::params{'DB_PASSWD'}, {RaiseError => 0, AutoCommit => 1} ); if( $DBI::errstr) { exit_with_error($DBI::errstr); } }
where the $cfg::params are read from a text cfg file, and I've never had a prob with it not working, on many systems.

HTH
Cheers
Chris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-24 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found