Forum Moderators: open
I used my host's 'quick install' to get mySQL and PhpMyAdmin up and running. Can log in fine from root, can create users, can create databases, can give users permission to specific databases ...
When I give the info to my contract guy (who can deal with installing HIS software if the mySQL is up and running, but can't seem to troubleshoot this one with me), he gets a login error. (Access denied for user 'name'@'localhost'. password YES)
I checked the login/password combo a zillion times. Checked permissions. I stopped and restarted mySQL. I uninstalled it and reinstalled it just in case I had the settings off from the get-go. I searched and searched for solutions, and have still only figured out that I am not cut out to handle this without a brain malfunction.
Every "solution" I've read in various places assumes I know far more than I actually do about PHP and databases. So I don't even know where to look. When it comes to this type of problem, I'm a driver, not a mechanic. I can change the oil but that's about it. I may have a feeling a wire is loose, somewhere, but I'm not sure where. I'm pretty sure I've got the right set of keys, though.
Access denied for user 'name'@'localhost'
Are you sure the database is local? This means on the same machine as the server, which is often not the case:
define('DB','database_name');
//define('DBHOST','localhost'); //OR
define('DBHOST','mysql.yourhost.com');
define('DBUSER','db_user);
define('DBPASSWORD','your-db-pass');
$link = mysql_pconnect(DBHOST,DBUSER,DBPASSWORD) or die ("Could not connect server");
mysql_select_db(DB,$link);
If the host is not found or improperly defined, it will default to localhost, if there is no local mysql server, mysql will still run but give you access denied.