Connecting to mysql in xampp without password

做~自己de王妃 提交于 2019-12-04 07:11:51

问题


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?

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

回答1:


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).



来源:https://stackoverflow.com/questions/19517566/connecting-to-mysql-in-xampp-without-password

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!