Marek Mahdal wrote:
>
> Hi,
> I have a problem with MySQL.
> I am running Redhat Linux 6.1, MySQL 3.23.38 and PHP 4.0.
> The command line client mysql is working perfectly. But if i try to connect to the
>MySQL server from a web site using PHP I get this error message:
>
> Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket
>'/tmp/mysql.sock' (111) in /web/domains/allegro-viatatry/index.php on line 3
>
> In the index.php I am using the same code I used on other machine, with the same
>parameters, and it worked. I looked into the /tmp directory. There is no file named
> 'mysql.sock'.
>
> Please help.
>
> Thank you. Marek Mahdal, Slovakia
Hi !
Try locating your mysql.sock file, depending on your mysqlinstallation
method and parameters its placed on different places.
I guess it could be in /usr/local/mysql/var/mysql.sock but try "locate
mysql.sock" in the shell.
Where the default mysql.sock is located by php can be set in php.ini i
think, otherwise you could supply som extra values to mysql_connect().
I think its mysql_connect("localhost:/usr/local/mysql/var/mysql.sock"),
but check the manual to be sure.
Good luck!
Eric
---------------------------------------------------------------------
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