Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP-Mysql Socket Problem
July 7, 2006, 5:16 pm
rate this thread
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
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.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
What is the difference between MYSQL_SOCKET and mysql.default_socket ?
Re: PHP-Mysql Socket Problem
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
Andy Hassall :: email@example.com :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
- » Securing Data Between PHP Script and Exec'd Compiled 'C' Program
- — Previous thread in » PHP Scripting Forum