Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Connecting to mysql using DBI and a non-standard socket

by Codon (Friar)
on Jul 05, 2005 at 20:04 UTC ( #472586=note: print w/ replies, xml ) Need Help??


in reply to Connecting to mysql using DBI and a non-standard socket

Why do you need connect via a the socket file? Presumably your mysql instance is listening for connections on a particular port number (default is 3306). In which case, you could use the command line

mysql -h localhost -P <port> -u root --password=password nemo
which would translate in DBI to
my $dbh = DBI->connect("DBI:mysql:database=nemo;host=localhost;port=$p +ort", 'root', 'password', \%attr);

Ivan Heffner
Sr. Software Engineer, DAS Lead
WhitePages.com, Inc.


Comment on Re: Connecting to mysql using DBI and a non-standard socket
Select or Download Code
Re^2: Connecting to mysql using DBI and a non-standard socket
by gellyfish (Monsignor) on Jul 05, 2005 at 20:18 UTC

    You might not want to have your mysqld listening on a TCP socket if there is no need for a client on another host to access the database. It makes for a more secure installation for one thing.

    /J\

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-07-28 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (185 votes), past polls