> I just installed mysql 3.23.32 on my server and it
> went without a hitch. I ran mysql_install_db, changed
> the root password, started the server. I used GRANT
> statements to create another user, then connected
> as that user to the mysql client--no problem at all,
> ran queries, etc.
> 
> But I wrote a PHP test script to test the connection,
> also on the same machine (so this is a localhost
> connection), used the same username and password
> that worked just fine with the client, and I get:
> 
> Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (111)
> 
> This usually means that the server isn't started,
> but it's running. I use dbtools on my wintel to

...but in this case, it means that PHP is trying
to connect not through TCP/IP as other remote
machines, but rather through a UNIX socket located
on the machine as you have described above.

It probably means that 
1) PHP expects to find the socket file as it says
2) your new version of MySQL creates the socket file
   somewhere else.

Either recompile PHP or re-configure MySQL so they
both agree on where to find the socket file.
Alternatively, try connecting from PHP specifying
the host name rather than localhost. This will
force PHP to use TCP/IP rather than the socket
file (at the cost of some performance loss)

/ Carsten
--
Carsten H. Pedersen
keeper and maintainer of the bitbybit.dk MySQL FAQ
http://www.bitbybit.dk/mysqlfaq


> connect to the departmental mysql server, so I
> set up a connection in it to this one, and it connects
> just fine, no problem. I looked at the PHP code
> and saw no problems there, but to test it, I changed
> the dbhost, user, and password to connect over the
> network to the departmental server, and it works
> just fine, so it's not the code. It just won't
> connect to localhost--though the connection works
> from the command line and dbtools.
> 
> Anybody have any idea what's going on here?
> 
> 
> --
>  /"\
>  \ /  ASCII RIBBON CAMPAIGN
>   X   AGAINST HTML EMAIL
>  / \  AND POSTINGS
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 

---------------------------------------------------------------------
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

Reply via email to