Re: Can't connect to MySQL via PHP

From: Date: Sat, 12 Jan 2013 20:36:15 +0000
Subject: Re: Can't connect to MySQL via PHP
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-320075@lists.php.net to get a copy of this message
Simple test I just did. A simple script that first connects to mysql and then tries to select a db. With a uid/pswd that I just made up for the script, I get the following: **** Error - Could not connect to database from sql_db_connect Access denied for user 'albany_ginerjm3'@'localhost' (using password: YES) **** Going into my host's mysql manager, I created the uid/pswd to match what my script has in its code. The next execution returns this: **** Error - Could not select database in sql_db_connect Access denied for user 'albany_ginerjm3'@'localhost' to database 'albany_jgfiles' **** Going back to my mysql manager, I added the new user to the db that I am trying to select. No more error messages. I would check that the user is defined to access the db that you are trying to use, if not all the dbs you have.

« previous php.general (#320075) next »