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 David Haynes on 12/29/05 15:05

JPribe wrote:
> 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
>>
> I am having the "same" issue on my server. WinXP Pro, Apache 2.0.55,
> MySQL 4.1.15, PHP 5.11.
>
> I have read the whole thread, is there anyone who can point out some
> obvious Windows issues, besides PATH= and the location of the .dll.
>
> In addition, PHPinfo does not list MySQL extension as loaded...so
> totally perturbed at this point...
>
Things to check:
1. In php.ini:
- extension=mysql.dll and/or extension=mysqli.dll are uncommented
- extension_dir is set to the path to the ext directory (e.g. C:\php\ext)
2. In apache2/bin:
- libmysql.dll has been copied here from the mysql directory
3. You can connect to mysql from the command prompt: (e.g. mysql -uxxx
-pxxx)

-david-

 

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

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