You are here: Re: connecting to a DB « PHP Language « IT news, forums, messages
Re: connecting to a DB

Posted by peter on 05/29/07 07:02

> I resolved the PHP warnings but now I have what seems to be quite a
> problem
> I think I messed up because when I tryed to connect to the
> database I have this error using this code:
>
> <?php
> $connection = mysql_connect("localhost", "raleigh", "1111") or die
> ("Couldn't connect to the server.");
> $db = mysql_select_db("secretDB", $connection) or die ("couldn't select
> database.");
> ?>
>
> Couldn't connect to the server.PHP Warning: mysql_connect()
> [function.mysql-connect]: Access denied for user 'raleigh'@'localhost'
> (using password: YES) in C:\Inetpub\wwwroot\phpBasics4.0\hs~connecting to
> a
> mysql database.php on line 2

The error message pretty much says it all. User raleigh was denied access.
Does this user definately exist with the password 1111 also does it have
access to connect from localhost (you have to specifically set this:-

http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

I am not sure which version of mysql you are using but the method should be
the same.

 

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

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