MySQL ACCES DENIED ERROR

Status
Not open for further replies.

drerhys

New Member
Messages
5
Reaction score
0
Points
0
Hello, for some reason my webpage wont connect to the mysql database. i keep getting this error

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'int.chopin.x10hosting.com' (using password: NO) i
Could not connect to mysql because Access denied for user 'root'@'int.chopin.x10hosting.com' (using password: NO).

Can anyone help me resolve this problem please.
 
Last edited:

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
(using password: NO)

That is the problem, you must use a password to connect with mysql server. MySql host is ---> localhost

Go to cPanel and create database and database user there, Then add user to database with all privileges.

***Moved to Free Hosting***
 

vishal

-::-X10 Guru-::-
Community Support
Messages
5,255
Reaction score
192
Points
63
Did you create DB user from Cpanel .If not create it .
And should be in following manner

MySQL Database : cpanelusername_dbname
MySQL DB User : cpanelusername_mysqlsuer
MySQL DB Host : localhost
MySQL DB Password : ********
 

drerhys

New Member
Messages
5
Reaction score
0
Points
0
That is the problem, you must use a password to connect with mysql server. MySql host is ---> localhost

Go to cPanel and create database and database user there, Then add user to database with all privileges.

***Moved to Free Hosting***



I already did all of that. Its seems as if its not recognizing the user I created for my database.
 

drerhys

New Member
Messages
5
Reaction score
0
Points
0
Did you create DB user from Cpanel .If not create it .
And should be in following manner

MySQL Database : cpanelusername_dbname
MySQL DB User : cpanelusername_mysqlsuer
MySQL DB Host : localhost
MySQL DB Password : ********

Where in CPANEL do you specify the database host?
 

vishal

-::-X10 Guru-::-
Community Support
Messages
5,255
Reaction score
192
Points
63
Where in CPANEL do you specify the database host?

Its not in Cpanel. I meant you should create dbuser from Cpanel.
I mentioned database host to mention it in connection string
 

drerhys

New Member
Messages
5
Reaction score
0
Points
0
Its not in Cpanel. I meant you should create dbuser from Cpanel.
I mentioned database host to mention it in connection string


oh ok. I specified all the necessities in my config file and I have already added a database and a database user to CPANEL. For some reason it isn't recognizing or reading the database user I created, its is still referring to the default root. not sure what to do.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
You're not creating a connection properly. Did you write the script, or are you using a 3rd party script? If the former, this should have been posted in the Programming Help forum; if the latter, Scripts & 3rd Party Apps/.
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
There's definitely something going wrong either with the script or script configuration. The error message indicates that the script is trying to connect with default MySQL credentials, so either the connection call isn't getting the configured username & password, the script isn't creating a connection (so a default one is opened) or something is trying to access MySQL before the connection is created. See one of the many other threads about this error message for more.

I also see you're using the very outdated mysql driver. Switch to the PDO driver, which is superior in every way. See "Writing MySQL Scripts with PHP and PDO" for a tutorial on how to use it.
 
Last edited:
Status
Not open for further replies.
Top