PDA

View Full Version : cannot connect to SQL



Martin
02-19-2008, 11:21 PM
I have never had problems on other hosts using:

DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'databasename'); $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() ); to connect to the database

So with hostmonster I realise it goes:

DEFINE ('DB_USER', 'accountname_username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'accountname_databasename');

but still I get the error:
Could not connect to MySQL: Access denied for user 'fiveharec_tester'@'localhost' (using password: YES)

the mysql_connect file is in the public_html folder and permissions are 755.

I have tried putting the IP 'xx.xxx.xxx.xxx' instead of the 'localhost' and get same error :
Could not connect to MySQL: Access denied for user 'fiveharec_tester'@'host215.hostmonster.com' (using password: YES)

So what is the deal with Hostmonster please tell what I have to do?!?
I have connected to databases frequently before why is hostmonster diff?

Martin
02-19-2008, 11:38 PM
solved my own problem moments after posting, thanks anyway, it was just a typo. I wasted 4 hours troubleshooting, not a good day

321disenoweb
07-05-2011, 11:16 PM
I have the same issue now, please help me.

xingyichen
11-23-2011, 02:44 AM
I have the same issue now, please help me.