mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)
时间: 2023-11-04 22:01:16 浏览: 67
该错误是由于访问权限问题导致的,主要原因是用户名对应的密码错误。有几种解决方法可以尝试:
1. 通过命令行进入MySQL安全模式,重新更新密码并将密码设置为空。然后尝试重新登录。
2. 修改phpMyAdmin根目录下的config.sample.inc.php文件。找到cfg['Servers'][i]['password'] = '设置为空'的部分,并将其密码设置为空。如果问题仍然存在,可以尝试修改config.inc.php文件中的相应部分。
3. 检查是否使用了Appserv安装的MySQL。如果是的话,找到config.sample.inc.php文件并注释掉$cfg['Servers'][i]['controluser']和$cfg['Servers'][i]['controlpass']的部分。
完成这些步骤后,您应该能够成功解决问题并登录phpMyAdmin界面。
相关问题
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: Y
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)是phpmyadmin登录报错的一种错误信息。这个错误通常意味着登录到MySQL服务器时提供的用户名和密码不正确。引用中的错误提示表明,尝试使用用户名'pma'和空密码进行登录,而实际上需要提供正确的用户名和密码才能成功登录。引用中提到了一种可能的解决方法,即使用正确的用户名和密码进行登录。另外,引用中提到了可以通过修改config.sample.inc.php文件中的controluser和controlpass来设置正确的用户名和密码。所以,要解决这个错误,您需要确保提供正确的用户名和密码来登录到phpmyadmin。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [mysqli::real_connect(): (HY000/1045): Access denied for user ‘pma‘@‘localhost‘ (using password: ...](https://blog.csdn.net/weixin_52730551/article/details/129080578)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [mysqli_real_connect(): (HY000/1045): Access denied for user ‘root‘@‘localhost‘ (using password: ...](https://blog.csdn.net/qq_42043599/article/details/127814940)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)
这个错误提示是由于mysqli连接函数在尝试连接到MySQL服务器时,使用了错误的用户名或密码导致的。根据引用、和的内容,可以得出以下结论:该错误可能发生在一个PHP文件中,该文件尝试连接到MySQL数据库并执行一些操作,但连接时使用的用户名为'root',密码为错误的密码。为了解决这个问题,您可以采取以下步骤:
1. 确保您的MySQL数据库的用户名和密码是正确的,可以通过与MySQL服务器管理员进行确认来获取正确的用户名和密码。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)