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.
[Back to original message]
|