Re: PHP installed - MySql Server can't connect
| From: | Rasmus Lerdorf | Date: | Fri, 13 Jul 2001 05:30:49 +0000 |
| Subject: | Re: PHP installed - MySql Server can't connect | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-57684@lists.php.net to get a copy of this message | ||
This happens when the mysql server you are running is different from the
version of the mysql library php was linked against. If you compiled php
using "--with-mysql" you get the mysql client library that comes bundled
with PHP which may not match your mysql server and thus may look for the
mysql.sock file in the wrong place.
To fix this, either figure out where your mysql.sock file is and specify
it directly in your mysql_connect() call (see
http://php.net/mysql_connect) or recompile PHP against
your system's mysql
client library by using "--with-mysql=/usr" assuming your mysql client
library is in /usr/lib/mysqlclient.*
-Rasmus
> PHP install went perfectly. phpinfo shows MySql installed. But, when I try
> to start Mysql, I get:
>
> ERROR 2002: Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (111)
>
> What and why?
>
> Please reply to my e-mail address if you can help. Thanks!
>
> --
> Gaylen
> gfraley5@earthlink.net
>
>
>
>
>