note 49220 added to function.mysql-connect

From: Date: Thu, 20 Jan 2005 17:38:27 +0000
Subject: note 49220 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-83685@lists.php.net to get a copy of this message
Debian (and "flavors" of Debain such as Ubuntu Linux) installations of mysqld place the socket file on a directory OTHER than /tmp/mysql.sock causing php connection problems. A quick workaround, as described in the docs above, is to specify ":/path/to/socket in the server parameter in db_connect. Here is an example where mysql socket is located at /var/run/mysqld/mysqld.sock: function open_connection() { $host = "localhost:/var/run/mysqld/mysqld.sock"; $user = "root"; $passwd = NULL; $db_name = "ipd"; return db_connect($host, $user, $password, $db_name); } ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49220 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49220&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49220&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49220&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49220&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49220&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49220&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83685) next »