MYSQL problems

Status
Not open for further replies.

eternal-empire

New Member
Messages
53
Reaction score
0
Points
0
I try to access the mysql db through my PHP page but this is what i get...


Warning: mysql_connect() [function.mysql-connect]: Access denied for user '****'@'localhost' (using password: YES) in /home/********/public_html/functions.php on line 14
Could not connect: Access denied for user '****'@'localhost' (using password: YES)

I double- and triple-checked the passwords and users of the db...Why is this happening??

Its the same user and same pass...
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Did you create the database, the user, and then assign permissions to the user for the database?
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
You're not adding the prefix to your user and database.

You need to add your username_ before the database name and user name. So if my cPanel name is 'staff' and I create a database called corey the real name is staff_corey same thing for user names.

-Corey
 

eternal-empire

New Member
Messages
53
Reaction score
0
Points
0
aaaahhhhhh..........lemme try that
Edit:
it says could not select db
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Double check you have the names correct.

-Corey
 

luciotan

New Member
Messages
24
Reaction score
0
Points
0
i think he forgot the prefix. that is common mistakes in Access denied to mysql
 

eternal-empire

New Member
Messages
53
Reaction score
0
Points
0
Problem solved...:p i had forgotten to change prefix for db too :D

Thanks a lotttttttttt!!!!!!!!!!!
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
No problem, please re-open if further assistance is needed.

-Corey
 
Status
Not open for further replies.
Top