0

我使用 XAMPP 在本地主机中收到此警告

Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in C:\xampp\htdocs\folder\dbconnect.php on line 135

我该如何解决这个警告,它是什么意思?

4

2 回答 2

0

Log onto your XAMPP's PHPMyAdmin and run the following query inside of PHPMyAdmin

SET PASSWORD = PASSWORD('your_old_mysql_password')

where your_old_mysql_password should be replaced with your current MySQL password.

This should fix your problem.

You can also simply reinstall XAMPP (to another directory if possible), which should guarantee a fix since it's self-contained.

于 2013-12-15T03:34:38.603 回答
0

转到您的 xampp 文件夹目录:xampp/htdocs/xampp/mysql.php

您将在页面上找到此代码:

<?php if (@mysql_connect("localhost", "pma", "")) { echo "OK"; } else { echo "NOK"; } ?>

所以你所要做的就是用下面的代码交换整个代码:

<?php if (@mysql_connect("localhost", "pma", "")) { echo "OK"; } else { $err = mysql_errno(); if ((1044 == $err) || (1045 == $err) || (1130 == $err)) { echo "OK"; } else { echo "NOK"; } } ?>

你的错误很快就解决了!!

于 2013-08-27T14:35:50.557 回答