Php 在xampp中无密码连接mysql

Php 在xampp中无密码连接mysql,php,mysql,xampp,Php,Mysql,Xampp,我想将mysql xampp密码配置为无密码。我打开my.ini,看到了以下行: # password = password 我不使用密码我应该键入什么 这就是我尝试通过php连接mysql时遇到的错误: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\spikes\functions.ph

我想将mysql xampp密码配置为无密码。我打开my.ini,看到了以下行:

# password       = password
我不使用密码我应该键入什么

这就是我尝试通过php连接mysql时遇到的错误:

 mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using     
password: YES) in C:\xampp\htdocs\spikes\functions.php on line 53
Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: YES)
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in     
C:\xampp\htdocs\spikes\home.php on line 6

如果您没有为MySQL设置密码(通过XAMPP打开MySQL配置进行检查),只需将“”作为密码。确保您的PHP脚本也被配置为使用该密码,因为它当前正试图使用该密码(因此使用密码:YES)。

这不是xampp的问题。检查您提到mysql用户名和密码的php文件。