I'm new to using xampp, until a week ago I used a hosted server for php development. I'm having what is probably a newbie problem and would appreciate any advice offered.
I've got phpmyadmin working and have created a database and a user with full permissions. All the things I would do on my hosted server. When I try to connect using mysqli, I get the following error:
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'cromwell'@'localhost' (using password: YES) in C:\xampp\htdocs\cromwell\dbconnect.php on line 2 Connect failed: Access denied for user 'cromwell'@'localhost' (using password: YES)
The user account privileges were set up with the following SQL:
REVOKE ALL PRIVILEGES ON *.* FROM 'cromwell'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'cromwell'@'localhost' REQUIRE NONE WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
the connection script is as follows:
<?
$mysqli = new mysqli("localhost", "cromwell", 'password', "cromwell");
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
?>
both the user and database are named cromwell as per phpmyadmin's set-up when I created the user.
I assume I'm missing something simple in either the user setup or how I'm addressing the database from the script.
Thanks for any help or advice.