我正在尝试连接到phpstorm中的mysql数据库,但我没有成功。 我将非常感谢你的帮助。
<?php
$servername = "http://localhost:8012";
$username = "root";
$password = "";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}else{
die("Connected successfully");
}
错误是:502 Bad Gateway
答案 0 :(得分:1)
您可以像这样连接数据库:
ClaimsPrincipal
答案 1 :(得分:0)
<?php
$servername = "localhost:8012";
$username = "root";
$password = "";
$database = "dbname";
// Create connection
$conn = mysqli_connect($servername, $username, $password,$database) or die(mysqli_error($conn);
echo "Connection Successful";
&#13;