MySQL Forums
Forum List  »  Newbie

mysql_connect - Access Denied
Posted by: Des Davies
Date: October 28, 2004 01:02PM

OK, having moved on from the problems I was having with LOAD DAT INFILE, I've been trying to get a PHP page to do the table creation and data inserts instead. However, that's causing me an even more basic error - can't connect to the database.

I've tried this on my webhost - creating the database through HELM (SWAP) and assigning a user to it (SWAPUSR). I've also tried the same thing on my local mySQL by creating the DB manually and doing "GRANT ALL PRIVILEGES on swap.* to 'SWAPUSR'@'%' INDENTIED BY 'password'.

In both cases when I open the PHP page I get an access denied error on the connection to the DB.

I'm using...

$conn = mysql_connect("localhost","swapusr","DB@Ccess");
if (!$conn) {
die('Could not connect: ' . mysql_error());
}

which gives me...

Warning: mysql_connect(): Access denied for user 'swapusr'@'localhost' (using password: YES) in E:\wwwroot\sites\SSM\members.php on line 208
Could not connect: Access denied for user 'swapusr'@'localhost' (using password: YES)

Can someone please help me here?

Thanks,
Des

Options: ReplyQuote


Subject
Written By
Posted
mysql_connect - Access Denied
October 28, 2004 01:02PM
December 31, 2007 03:06AM
November 08, 2004 05:06PM


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.