earth tech

[software and hardware technology originating from or otherwise pertinent to planet earth]

use these buttons to share this blog on portal sites:

Add to Google
Connect with Facebook

Saturday, February 21, 2009

 

MySQL "unable to select database" error

A quick Google search will show a lot of somewhat disjoint solutions to or descriptions of this problem - basically, it's pretty simple - I found it when I set up a "Login" example page using PHP and MySQL. All looked right, but the login failed with a "Select Failed" message, which in turn allowed that the user defined for the web opeation was not authorized by the database, causing the select to fail.

Further investigation led me to insert mysql_error() at the point of the select error, which told me that the problem was that the user had not been added [defined] for the database.

So if a PHP script gets a "Cannot select DB" error on the select statement, make sure the user has been added to the database with the appropriate permissions.





<< Home

Archives

2006/12   2007/01   2007/05   2007/06   2007/07   2007/08   2007/10   2008/01   2008/02   2008/03   2008/05   2008/11   2008/12   2009/01   2009/02   2009/03   2009/04   2009/05   2009/07   2009/09   2009/10   2009/11  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]