我不知道“连接”这个术语是否正确,但我无法想出其他任何东西。
因此我开始在 Ubuntu 22.04 中使用 devilbox,当我尝试运行此代码时:
<?php
$servername = "localhost"; $username = "root"; $password = ""; $database = "college";
// Create connection $conn = new mysqli($servername, $username,$password, $database);
// Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // echo "Connected successfully"; ?>
我遇到了这个问题:
Fatal error: Uncaught mysqli_sql_exception: No such file or
directory in /shared/httpd/my_project/Library-Book-Management-System/dbconfig/connect.php:8
Stack trace: #0 /shared/httpd/my_project/Library-Book-
Management-System/dbconfig/connect.php(8): mysqli->__construct('localhost', 'root', '', 'college') #1 {main} thrown in /shared/httpd/my_project/Library-Book-Management-System/dbconfig/connect.php on line 8
我的 mysql 服务器中有数据库,我在 phpmyadmin 中创建了另一个数据库,我也从 env 文件中解散了我的 msql 版本,但我一遍又一遍地看到这种情况