Quantcast
Channel: WampServer - WampServer English
Viewing all articles
Browse latest Browse all 3177

Warning: mysqli::__construct(): (HY000/1045) (1 reply)

$
0
0
I have (had) a working program. The configuration was Windows Server 2008 and WAMP Server 2.2. The server was upgraded to Windows Server 2016. I removed the old WAMP Server completely, including deleting the c:\wamp directory (well I renamed it). I loaded new version (3.2) of 64-bit WAMP Server. I created my databse and then loaded it from exported previously db.sql file. I changed the RootDirectory to c:\www and loaded my application to c:\www\app_name\. I set up a root password from phpMyAdmin. The phpMyAdmin has no problems. I tested the password by connecting using the root credentials from command line, it worked. But an attempt to connect in PHP code gives me an error.
The offfending line is:
$mysqli = new mysqli($GLOBALS['mysql_host_name'], $GLOBALS['mysql_user_id'], $GLOBALS['mysql_user_password'], $GLOBALS['mysql_db_name']);
I verified the contents of the $GLOBAL variables and I also tried plugging in the actual values directly.
The error is:
Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)
Any ideas?
Richard

Viewing all articles
Browse latest Browse all 3177

Trending Articles