Connection issues » Connection problems

ID #1009

Error no. 1045: "Connection denied..."

 

The error message

 

Error No. 1045: Connection denied for 'someuser@somehost' (using password: YES/NO)

 

is a user authentication error. The user details specified do not "match" the user tables of the specified MySQL server. Common situations are

* No such user.
NOTE: MySQL does not use the OS's or domain's user's management. It operates its own user accounts. With a fresh MySQL installation the user ROOT is created with NO PASSWORD. When working with MySQL databases at ISP's an admin user most often must be activated from some web based Control Panel Application before connection to the MySQL server is possible. There could be more "rules" applying here (database and user naming conventions etc). Refer to the docs/support at the ISP for details on that. We can't give them!

* User is not allowed to connect from the actual host. Note that MySQL by default only allows connection from 'localhost'. To specify from where a user may connect SQL wildcards (% and _) can be used. Simply 'someuser@%' means that user 'someuser' may connect from everywhere.

* Wrong password, missing password or password specified where it should not

* If you are upgrading MySQL from an old version (4.0.x or lower) to a more recent (4.1.x or highere) and if you are still using a rather old PHP version you may need to execute this command from command-line client

SET PASSWORD FOR some_user@localhost = OLD_PASSWORD('newpwd');

(where some_user@localhost is the user used for this connection) since the format for storing passwords has changed between 4.0.x and 4.1.x versions.

 

Tags: -

Related entries:

Last update: 2005-09-20 23:47
Author: Peter Laursen
Revision: 1.0

Digg it! Print this record Send FAQ to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this FAQ:

Average rating: 1.87 out of 5 (45 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ

Comment of John:
This is nice information however the key that I see missing from most posts is that you don't give me the "how to" part of it. I still have no idea where to go or what SQL to type to grant the permissions. You are kind enough to take the time to write all this information, I would suggest taking a few minutes more to type out the syntax of how the grant of permissions should be entered.
Added at: 2008-08-25 18:45

Comment of Peter Laursen:
This is the SQLyog FAQ. SQLyog users will use the SQLyog GUI user management functionalities. The situations where commmand line GRANT syntax are required are 1) After server install on a remote host user may want to grant root access from remote machine 2) When creating an SSL-user
Added at: 2008-09-03 12:56