Watch out here I come again ;)

Trevor Leffler tleffler at u.washington.edu
Thu Dec 20 14:56:44 PST 2001


Dejan,

You're .my.cnf doesn't really matter in this case, because your php
script can't even see it--the web servers can't see your home directory.
Your script should make a connection to your DB via tcp, not a file
socket. You might write something analogous to:

$dbh = DBI->connect("DBI:mysql:$table:$host:$port", $user, $password);

Sorry I don't know how PHP would do that.

--Trevor

Dejan Nikic wrote:


> Well guys here i'm again with my PHP and MySQL installations. Now here

> is the deal. I deleted my previous installations and decided to go

> fresh. Now what I have problems with is that when i try to connect to

> mysql trough php i get this error:

>

> Warning: Can't connect to local MySQL server through socket

> '/tmp/mysql.sock' (2) in

> /nfs/guido06/dw01/d82/dejann/install/newtables.php on line 2

>

> now I have no idea why is trying to use /tmp/mysql.sock because in

> .my.cnf i put in a full path to my mysql.sock which is in the root of my

> home directory.

>

> is there a way to change this /tmp/mysql.sock to a working socket inside

> php? I made a file with phpinfo() in it and there it tells me that

> mysql socket is /tmp/mysql so I would like to have it changed.

>

> Thank you.

>

> p.s.

> Sorry I'm bothering you guys with all this, but I've been trying to find

> something on this since 3 last night and nothing yet. All help is

> greatly appreciated.

>

> _________________________________________________________________

> Join the world's largest e-mail service with MSN Hotmail.

> http://www.hotmail.com





More information about the Linux mailing list