You are here: Re: Cannot get mysql_connect to work « PHP Programming Language « IT news, forums, messages
Re: Cannot get mysql_connect to work

Posted by Lars Hinrichsen on 12/29/05 16:19

Michael wrote:

> Hi,
>
> I'm trying to do something which should be very simple - connect to the
> MySQL database. Here is the call, followed by the error msg.
>
> $conn = mysql_connect("localhost", "root", "");
>
> Warning: mysql_connect(): Can't connect to local MySQL server through
> socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/buildhw.php on
> line 13
> failed
>
> I've also tried this with the host arg as "", but I get the same
> result. Logging on as root made no difference either.
>
> Any help would be very much appreciated.
>
> Thanks,
> M. McDonnell

Hi,

are you sure MySQL is running? Try mysqladmin -version and direct connect
with the mysql shell command.

I know e.g. early versions of SuSE Linux did not automatically start the
service.

What is your OS and what version of MySQL are you using?

Regards,
Lars

 

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

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