警告:mysqli_connect():(HY000/1045):用户'root'@'localhost'的访问被拒绝(使用密码:NO) [英] Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

查看:1077
本文介绍了警告:mysqli_connect():(HY000/1045):用户'root'@'localhost'的访问被拒绝(使用密码:NO)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP警告:mysqli_connect():(HY000/1045):用户被拒绝访问 根目录中的'root'@'localhost'(使用密码:NO) G:\ PleskVhosts \ peacewithoutlimits.org \ httpdocs \ admin \ includes \ connect.php 在第8行

PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) in G:\PleskVhosts\peacewithoutlimits.org\httpdocs\admin\includes\connect.php on line 8

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "peace";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

?>

推荐答案

拒绝访问意味着身份验证失败.这意味着用户名或密码组合无效.对于SQL,很明显,用户可以是root用户.因此,请转到您的phpMyAdmin并从用户"标签中进行检查.您可能会发现在根帐户上设置的密码.通常,在线数据库始终受密码保护.

Access denied means that the authentication failed. That means there is an invalid username or password combination. For SQL, it's obvious that the user can be root. So please go to your phpMyAdmin and check from the users tab. You may find out the password set on the root account. And usually online databases are always password protected.

这篇关于警告:mysqli_connect():(HY000/1045):用户'root'@'localhost'的访问被拒绝(使用密码:NO)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆