Access denied for user 'root'@'localhost'
Posted by: mikewb (140.211.25.---)
Date: August 17, 2020 06:31PM

For the past 12 years we've had a phpBB3 help desk site running on our intranet using an older version of WAMP (2.0). The help desk site has been running normally for many years until the recent requirement to use TLS 1.2. To move to a newer version of WAMP which supports TLS 1.2 we cloned the Windows 2012 R2 server in a VMWare isolated environment. I installed WAMP 3.2.0 on the cloned server. The site is now running TLS 1.2 and the MySQL database was successfully exported from the old system and imported into the new version of MySQL.

This is my current configuration on the new server:
Windows Server 2012 R2
WAMP 3.2.0
Apache 2.4.41
PHP 5.6.40
MySQL 5.7.28

The only problem is that the web site will not connect to the database. The following error is returned:
SQL ERROR [mysql4]
Access denied for user 'root'@'localhost' (using password: YES) [1045]

I've tried many potential resolutions from Google searches and none of the suggested resolutions resolve the problem. I can successfully login to phpMyAdmin using root and I can login to mysql from the command line using root. Most of the 'Access denied' issues point to an incorrect password in the config.php file. I'm using the same password in the config.php file that I use to login as root in phpMyAdmin. I even tried creating a new account in MySQL and using that account in the config.php file, but the same 'Access denied' error is returned for the new user account.

This is my config.php file:
// phpBB 3.2.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysql';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'misphpbb';
$dbuser = 'root';
$dbpasswd = 'bigbarnbats';
$table_prefix = 'phpbb_';
$phpbb_adm_relative_path = 'adm/';
$acm_type = 'phpbb\\cache\\driver\\file';

@define('PHPBB_INSTALLED', true);
// @define('PHPBB_DISPLAY_LOAD_TIME', true);
@define('PHPBB_ENVIRONMET', 'production');
// @define('DEBUG_CONTAINER', true);

What else can I try to resolve the 'Access denied' error?

Options: ReplyQuote
Re: Access denied for user 'root'@'localhost'
Posted by: Otomatic (Moderator)
Date: August 17, 2020 06:39PM


Read Right-Click -> Help -> MariaDB - MySQL

Wampserver 3.2.9 32 bit - Apache 2.4.53 - PHP 8.1.5…5.6.40 - MySQL 5.7.38 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.9 64 bit - Apache 2.4.53 - PHP 8.1.5…5.6.40 - MySQL 5.7.38/8.0.29 - MariaDB 10.5.15/10.7.3
PhPMyadmin 5.1.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote

Sorry, only registered users may post in this forum.