在没有密码的情况下连接到xampp中的mysql [英] Connecting to mysql in xampp without password

查看:92
本文介绍了在没有密码的情况下连接到xampp中的mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to configure the mysql xampp password to no password. I opened the my.ini and I saw the following line:

# password       = password

我不使用密码我应该输入什么?

I I don't use password what should I type?

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

And that's the error I get when I try to connect to mysql through php:

 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脚本还配置为使用该密码作为密码,因为它当前正在尝试使用该密码(因此,使用密码:是).

If you haven't set a password for MySQL (check by opening the MySQL config through XAMPP), just put "" as the password. Make sure your PHP script is also configured to use that as the password, because it is currently trying to use one (hence the Using password: YES).

这篇关于在没有密码的情况下连接到xampp中的mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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