MySQL Forums
Forum List  »  PHP

MySQL connection error
Posted by: Eric
Date: June 16, 2005 03:05PM

Hi All,
I am a MySQL newbie.
Using MySQL server config wizard, I created a database 'polls' and set passwd as 'admin'. I used the following PHP code to connect this db:

$host = "localhost:3036";
$user = "polls";
$pass = "admin";

$conn = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($user) or die ("Unable to select database!");

and I got the following error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'polls'@'localhost' (using password: YES) in C:\Server\Apache2 htdocs\Polls\user.php on line 17
Unable to connect!

Anyone could help to tell me why please? and BTW, what is the difference between the user name and db name? when I try to connect the db from DOS, it just prompted for password only, not username. Many thanks.

Options: ReplyQuote


Subject
Written By
Posted
MySQL connection error
June 16, 2005 03:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.