Skip navigation links

MySQL Forums :: Newbie :: mysql_connect - Access Denied


Advanced Search

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 Des Davies 10/28/2004 01:02PM
Re: mysql_connect - Access Denied Jonathan Stephens 10/28/2004 05:23PM
Re: mysql_connect - Access Denied Des Davies 10/29/2004 07:03AM
Re: mysql_connect - Access Denied jerblaster23 10/30/2004 01:19AM
Re: mysql_connect - Access Denied Benjamin Choi 10/30/2004 10:03PM
Re: mysql_connect - Access Denied Dustin Porter 11/06/2004 05:41PM
Re: mysql_connect - Access Denied pankaj rai 12/31/2007 03:06AM
Re: mysql_connect - Access Denied Algis 11/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.