What are common issues when trying to activate MySQL in PHP on a Windows XP SP2 system?

Common issues when trying to activate MySQL in PHP on a Windows XP SP2 system include missing MySQL extension in PHP configuration and incorrect MySQL server settings. To solve this, you need to ensure that the MySQL extension is enabled in the PHP configuration file (php.ini) and that the MySQL server is running with the correct settings.

// Enable MySQL extension in php.ini
extension=php_mysql.dll
extension=php_mysqli.dll

// Connect to MySQL server with correct settings
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "mydatabase";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";