We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

can't log into DB on EE 2

How Do I?

richard's avatar
richard
3 posts
5 years ago
richard's avatar richard

Trying to get an old site up & running on a new server (EE 2) Have changed the credentials in database.php to one for the new MySQL db. However, the site errors with “Failed to connect to MySQL: Access denied for user ‘OLDUSER’@’localhost’ (using password: YES) ” with ‘olduser’ being the previous MySQL account before database.php was edited. So it looks like it’s cached somewhere, or is being overridden elsewhere. I’ve searched for this username in the php files and can’t see it anywhere else so am a little stumped. Could anyone give me any pointers? TIA.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Any chance you have an include in either your config.php or database.php file? If it was setup using master config or the like, it could be pulling in an outside configuration. Usually you’ll see an include() at the bottom of the config.php if that’s the case.

       
richard's avatar
richard
3 posts
5 years ago
richard's avatar richard

Hmm, no can’t see one:

database.php looks like this:

<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);

$active_group = ‘expressionengine’; $active_record = TRUE;

$db[‘expressionengine’][‘hostname’] = ‘anon’; $db[‘expressionengine’][‘username’] = ‘anon’; $db[‘expressionengine’][‘password’] = ‘***’; $db[‘expressionengine’][‘database’] = ‘*****’; $db[‘expressionengine’][‘dbdriver’] = ‘mysql’; $db[‘expressionengine’][‘pconnect’] = FALSE; $db[‘expressionengine’][‘dbprefix’] = ‘exp_’; $db[‘expressionengine’][‘swap_pre’] = ‘exp_’; $db[‘expressionengine’][‘db_debug’] = TRUE; $db[‘expressionengine’][‘cache_on’] = FALSE; $db[‘expressionengine’][‘autoinit’] = FALSE; $db[‘expressionengine’][‘char_set’] = ‘utf8’; $db[‘expressionengine’][‘dbcollat’] = ‘utf8_general_ci’; $db[‘expressionengine’][‘cachedir’] = ‘/home/client/public_html/system/expressionengine/cache/db_cache/’;

/* End of file database.php / / Location: ./system/expressionengine/config/database.php */

       
richard's avatar
richard
3 posts
5 years ago
richard's avatar richard

The config.php is a bit too long to post, but I’ve searched it for ‘include’ and nothing there.

If I remove/rename the database.php file, I get ‘no database connection settings were found in the database config file’, so it must be looking at that file, if not honouring the contents of it.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Two things I can think of.

  1. The login info is just wrong. You could try using the server wizard and seeing if you can connect with the same db info.

  2. I’ve actually seen people hard code the database settings in the EE files. Seems unlikely- but you might take a look just to see.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.