You are here: Re: Return info about PHP installation mySQL compatibility « PHP Programming Language « IT news, forums, messages
Re: Return info about PHP installation mySQL compatibility

Posted by C. (http://symcbean.blogspot.com/) on 01/11/08 12:35

On Jan 10, 4:03 pm, "Robin S." <lasern...@hotmail.com> wrote:
> I've used phpinfo() to confirm settings for mySQL on our host server,
> and it's not returning accurate info.
>
> phpinfo() returns a mySQL client API version of 3.23.54 (uselss for
> me), where as a SELECT VERSION() query on the mySQL database returns
> version 5.0.27 (exactly what we need). I think there's something wrong
> with the mySQL library in PHP.
>

That's a bit of a gap but it should still work (note this is not an
error - the client code is quite seperate from the server code).

> Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to
> local MySQL server through socket '/tmp/mysql.sock' (2)
>

As Jerry said - it's trying to use a Unix socket. If you specify the
DBMS host as 'localhost' then the client automatically tries to use a
Unix socket (filesystem based) instead of a TCP/IP socket (network
based). The mysql client will try to read my.cnf to find where the
socket is - the location of my.cnf is defined at compile time. Of
course this only works if both server and client use the same my.cnf
(and the values aren't overridden in the MySQL startup script). On the
client side you can override the my.cnf setting with the
mysql.default_socket setting in php.ini.

If the mysqld is listening on a network port then you may be able to
use a network socket instead by specifying the FQDN of the box, an IP
adress for the box or '127.0.0.1' as the address - but then you have
the same problem of ensuring that both ends are using the same port,
and there is the additional complication of firewalls in between.

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация