Attention XAMPP & MySQL Gurus!
Help! Getting No traction on a DB connection error!
still cannot get the planets to line up!
*^&%$#!! totally frustrated!
I know that I am not the first to post on this subject, but am having no luck with anything I have googled so far.
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost'
(using password: YES) in C:\xampp\htdocs\dbconnect.php on line 8 (the mysqli_connect call)
Environment:
Win 7 Pro
Installed XAMPP V3.2.2, running Apache & MySQL
Get this error trying to connect from php script to MySQL DB:
From the browser (Chrome), running this:
http://localhost:81/dbconnect.php
<?php
# db connect parms
$dbhost = 'localhost';
$dbuser = 'root';
$dbpwd = 's3kr1t';
$dbname = 'gmap1';
$dbcon = mysqli_connect($dbhost, $dbuser, $dbpwd, $dbname);
?>
Returns this error:
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost'
(using password: YES) in C:\xampp\htdocs\dbconnect.php on line 8 (the mysqli_connect call)
So far I have done this:
* added a root password for root (default was no password)
* logged on to phpMyAdmin as root
* created a db (gmap1), table, and loaded data to it
* in phpMyAdmin selected the table data and successfully exported it
* confirmed that MySQL user root has all db access privileges:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD 'passroot';
So, root should be able to connect to the db!
I have worn google out researching this problem tried everything suggested to no avail
Any help much appreciated! I will even give you the rest of the day off!