我正在尝试在 Xampp 服务器上部署 php 应用程序并在 index.php 上出现错误
Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\xampp\php-inventory\lib\database.php on line 85
Warning: mysql_error() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\xampp\php-inventory\lib\database.php on line 85
CDatabase::Connect() error
这是错误的功能:
function Connect($connect_params = "") {
extract($connect_params);
//resource mysql_connect ( [string server [, string username [, string password [, bool new_link !!! [, int client_flags ]]]]] )
$this - > conn_id = mysql_connect($server, $login, $password, True) or die("CDatabase::Connect() error ".mysql_error($this - > conn_id));
if ($default != "") $this - > SelectDB($default);
}
我尝试将“true”更改为 1 仍然相同。我是 php 新手,找不到任何有用的东西。没有为mysql设置密码。