What are common issues that can arise when using XAMPP for Windows with MySQL databases, and how can they be resolved?
Issue: One common issue when using XAMPP for Windows with MySQL databases is the "Access denied for user 'root'@'localhost' (using password: YES)" error. This can occur when the password for the MySQL root user is not set correctly or when the root user does not have the necessary privileges. Solution: To resolve this issue, you can reset the password for the root user in MySQL or grant the necessary privileges to the root user.
<?php
// Reset password for root user in MySQL
$mysqli = new mysqli('localhost', 'root', '');
$mysqli->query("SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword')");
$mysqli->close();
?>