不用密码在xampp中连接mysql [英] Connecting to mysql in xampp without password

查看:24
本文介绍了不用密码在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:xampphtdocsspikesfunctions.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:xampphtdocsspikeshome.php on line 6

推荐答案

如果你没有设置 MySQL 的密码(通过 XAMPP 打开 MySQL 配置检查),只需输入"作为密码.确保您的 PHP 脚本也配置为使用它作为密码,因为它当前正在尝试使用一个(因此使用密码:YES).

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天全站免登陆