PDA

View Full Version : Database Connection Problem



balentti
12-19-2007, 04:07 AM
Hi all,
im having problem connecting to my DB, i have created the user, added the user to the DB and granted all the privileges to that user, but am still getting this error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'balentti_balent '@'localhost' (using password: YES) in /home/balentti/public_html/index.php on line 15

this is the code:
15 $db = mysql_connect("localhost","balentti_balent ","password")
16 or die ("Connetion error");
17 mysql_select_db("balentti_balenttimes")
Can somebody help me on this?

dvduval
12-19-2007, 06:23 PM
There has got to be an error somewhere in here. I see one already: "Connetion error". I would doublecheck everything.

linFox
12-19-2007, 08:00 PM
The code itself is fine, the issue is your username/password combo is being refused.
Ensure you typed them correctly both in your code and when you created them.

EDIT: I just spotted a space after the username in the code, that's probably not meant to be there.

balentti
12-20-2007, 01:13 AM
thanks for you answers but still not work... i have checked, the username/password are ok.. i tried even with different users but same problem...
Other suggestions?
thanks

omes
12-31-2007, 11:13 PM
thanks for you answers but still not work... i have checked, the username/password are ok.. i tried even with different users but same problem...
Other suggestions?
thanks

Check it again. A space at the end in the user name is enough...
If it still doesn't work contact support.