Ok you can do 1 of 2 things:

1: recompile mysql to put your mysql.sock where php expects to see it.
2: modify your php.ini to tell it where mysql is putting it's mysql.sock.
(Optional 3 idea)
3: check the archive before posting because someone asks this question just
about daily.

Of the 3 I would suggest 3 on a regular basis and #2 to fix this problem.

Cal
http://www.calevans.com


-----Original Message-----
From: denis mettler [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 9:48 AM
To: [EMAIL PROTECTED]
Subject: Error: MYSQL Connection failed


Hi there,

First i have the mysql db on linux in /usr/local/
then i installed new on /var

now i get the message:
Warning: MYSQL Connection failed:
Can't connect to local MYSQL Server through Socket
'/var/lib/mysql/mysql.sock' (111) in /usr/local/httpd/htdocs/dbopen.php3 on
line 8.

This is the text from dbopen.php3:
<?
$server = "localhost";  // MySQL-Server
$user   = "root";       // MySQL-Nutzer
$pass   = "secret";  // MySQL-Kennwort
//
$conn = mysql_connect($server, $user, $pass);
if($conn) {
   echo "<B>Yes, we're open!</B> Handle: $conn";
} else {
   echo "<B>Oops, something goes wrong";
   exit;
}
$select = mysql_select_db("name_of_db",$conn);
?>

Any Ideas?
Thanks in advance

Regards from cologne
denis

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to