database connection error

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mohamed essam
Forum Newbie
Posts: 5
Joined: Sun Dec 20, 2009 5:19 pm

database connection error

Post by mohamed essam »

hello every one

please can any one fix this error please?

my error is when i made connection to mysql database i found this error(Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root '@'localhost' (using password: YES) )

i have tried to fix it with many ways but this ways couldn't be successful

please i want to know a correct solution for this error

my php code is:

<?php


$link = mysql_connect("localhost", "root ","mohamed");
if (!$link) {
die('Could not connect: ' );
}
echo 'Connected successfully';
mysql_close($link);
?>

i will wait any reply

thank you in advanced
mohamed essam
Forum Newbie
Posts: 5
Joined: Sun Dec 20, 2009 5:19 pm

Re: database connection error

Post by mohamed essam »

plz any one can give me steps to fix this problem
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: database connection error

Post by daedalus__ »

your password is wrong.
Post Reply