Connection attempts to a MySQL database can return "MySQL Error Number 1045".Â This is a frustrating error, but has a reasonably simple solution.
While this solution is presented in the context ofÂ databasesÂ hosted on dreamhost.com accessed by the MySQL Administrator tool,Â most of the discussion is likely to apply to anyone encountering the 1045 error.
At the root of the error is the fact that the database server validates not only the user account making the request but also the machine the request is being made from.Â To resolve the error it is necessary to tell the server that the machine is authorized.
The first step is determine the fully qualified host name of the machine you are accessing from.Â The easiest way to do that is to google "display my host name".Â This will locate sites like www.displaymyhostname.com, which will show you the fully qalified host name for your machine.Â Copy this, you'll need it in a moment.
In the case of Dreamhost.com databases, log into your dreamhost.com control panel, then select MySQL databases from the menu.
Scroll down to the database you were trying to access, then to the right of the database name click the username being used.
The next page lists the databases that user has access to and the rights held on those databases.
In the "Allowable Hosts" section, add, on a separate line, the fully qualified host name you identified above.
Save the changes, and you're done.Â You'll now be able to access your database.