note 54834 deleted from function.mysql-connect by bjori

From: Date: Sat, 15 Apr 2006 18:37:19 +0000
Subject: note 54834 deleted from function.mysql-connect by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-108189@lists.php.net to get a copy of this message
Note Submitter: spam at modem-help dot com ---- (Centos4, php4, mysql4.1) If mysql uses a Unix socket to connect, and you move the DB tables from the default directory, **do not** also change the location or name of the mysql socket file within my.cnf, else your old scripts will not connect without modification. The simplest solution is to leave the socket file in it's default location (/var/lib/mysql with Centos/Redhat). Other options are to set `mysql.default_socket' (see http://www.php.net/manual/en/ref.mysql.php#ini.mysql.default-socket), or to set the new path within the server option to mysql_connect() as above. Extra info: Centos4 sets `skip-networking' within my.cnf by default, which causes all mysql connections to be made via Unix sockets (or named pipes on Windows). This both restricts all connections to the localhost (a security enhancement) and is faster. The problem is that, although `mysql.default_socket' is NULL by default, the Unix socket name + location is both hard-coded into the Centos/Redhat php-mysql RPM libraries *and* PHP will ignore any my.cnf socket-settings that differ from the defaults. Brought to you from the School of Hard Knocks.

« previous php.notes (#108189) next »