Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Cannot connect to mySQL database. Access denied error


tx9271 - 2:31 am on Mar 16, 2011 (gmt 0)


I cannot connect to my database and I am unsure as to why.
Hear is the error message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'tx9271_admin'@'localhost' (using password: NO) in /home/tx9271/public_html/downfeed.com/config.php on line 5
I cannot connect to the database because: Access denied for user 'tx9271_admin'@'localhost' (using password: NO)


Here is the config.php file it is referring to:


<?php
$dbname="tx9271_users";
$host="localhost";
$user="tx9271_admin";
$dbh=mysql_connect ($host,$user,"") or die ('I cannot connect to the database because: ' . mysql_error(). '');
mysql_select_db ("$dbname") or die('I cannot select the database because: ' . mysql_error());

?>



my webhost is hostgator.com. I created the database tx9271_users and created a user in that database called tx9271_admin. If anyone knows what is wrong I would greatly appreciate some help.

Thanks,
tx9271


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4282269.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com