|
Posted by Andy Hassall on 07/07/06 20:27
On 7 Jul 2006 10:16:20 -0700, "balavignesh" <kbalavignesh@gmail.com> wrote:
> I want to connect with mysql using php.
>
>In my mysql "my.cnf" file i have specified the socket for both client
>and server as
>"/usr/local/mysql/var/mysql.sock"
>
>In my "php.ini" file, for mysql socket i have specified
>
>/usr/local/mysql/var/mysql.sock as the default path.
>
>But i can't able connect with database. it shows DB connection failed.
>
>
>My phpinfo() gives the following two lines for mysql sock
>
>MYSQL_SOCKET /tmp/mysql.sock
>mysql.default_socket /usr/local/mysql/var/mysql.sock /usr/local/mysql/var/mysql.sock
>
>
>If i set the socket as /tmp/mysql.sock in "my.cnf" , I CAN ABLE TO
>CONNECT.
>
>What is the difference between MYSQL_SOCKET and mysql.default_socket ?
MYSQL_SOCKET shown on phpinfo() appears to be the value specified in
"configure" via --with-mysql-sock.
It gets mapped onto the constant MYSQL_UNIX_ADDR, which is used in the mysql
module's phpinfo function.
But after looking through the rest of the source of the mysql module (in
5.1.4) it doesn't appear to be used anywhere else - only the configuration
option mysql.default_socket seems to be accessed, so it's that one you've got
to set.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|