<?php
$host = '127.0.0.1';  // MySQL服务器主机名
$username = 'root';  // MySQL用户名
$password = '123456';  // MySQL密码
$database = 'mysql';  // 数据库名称

// 创建MySQL连接
$conn = new mysqli($host, $username, $password, $database);

// 检查连接是否成功
if ($conn->connect_error) {
    die('连接失败：' . $conn->connect_error);
}

echo '成功连接到MySQL数据库success';

// 执行数据库操作...

// 关闭连接
$conn->close();
?>
