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?
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?