我正在学习PHP MYSQL,所以我安装了php7.3,mysql5.7,mysql-work-bench,apache2,但是当我尝试通过工作台连接数据库服务器并输入url http:/ localhost:3306时,错误。
目的:我想将form.php文件连接到可以对其执行编辑更新,插入删除的数据库。
虽然mysql work-bench对我不起作用如前所述,我安装了apache服务器并尝试连接数据库服务器,但随后我发现此错误:
The requested URL /form.php was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
<?php
$servername = "localhost";
$username = "root";
$password = "ayujain";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
我正在尝试运行此代码。