0

I am getting this warning in my localhost using 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

How do I fix this warning and what does it mean?

user9371102
  • 1,278
  • 3
  • 21
  • 43
user2551750
  • 17
  • 1
  • 7

2 Answers2

0

go to your xampp folder directory : xampp/htdocs/ xampp/mysql.php

you will find this code on the page:

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

so all you have to do is exchange the whole code with this below:

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

and there you have your error fixed in a jiffy!!

JummahGURU
  • 33
  • 1
  • 1
  • 7
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.

Someguy123
  • 1,324
  • 13
  • 27