PDA

View Full Version : Database problems?


Daimz
07-22-2006, 05:43 AM
I am having a problem connecting to my database. I am trying to set up a CMS for a flash website I am building and I am using php to transer data between my database and the flash gui. But when I try accessing my database I get this message.

Warning: mysql_connect(): Access denied for user 'softgoow_daimz'@'localhost' (using password: YES) in /home/softgoow/public_html/CMS_template/CMS_testing/reading.php on line 2
I cannot connect to the database because: Access denied for user 'softgoow_daimz'@'localhost' (using password: YES)

I am using this in my .php to try access the database:
$dbh=mysql_connect ("localhost", "softgoow_daimz", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("softgoow_serverworks");
exactly as is.(with password ofcourse tho but localhost and that all the same)
I have no idea how to fix this problem and would really apricciate the help as I am really new to databases and MSQL, as in this is the first one I have tried to set up.
cheers:D

bobdog
07-22-2006, 10:57 AM
Go to cpanel, click on MySQL icon, and see if you have assigned a user name and password to that database.

Daimz
07-22-2006, 06:24 PM
I set a user and pasword up already and added the user to the database and that is the username that I have in my code. but it still doesnt work. Would it have something to do with the use of "localhost" instead of and IP adress?

page1ink.
07-23-2006, 07:49 PM
is the code working elsewhere on the site? I would double check your user/password. it sounds silly but really that's why that error appears hehe =) if you continue to have trouble delete recreate your user in your cPanel's MySQL page.