I'm trying to connect offline to a MySQL database, but I'm not getting it.
The code is on my machine, I've already tried IIS and XAMPP but every time I try to connect, it displays an error. Here's the connection string I'm using:
$host = ""; //computador onde o servidor de banco de dados esta instalado
$user = ""; //seu usuario para acessar o banco
$pass = ""; //senha do usuario para acessar o banco
$banco = ""; //banco que deseja acessar
$conexao = mysql_connect($host,$user,$pass);
if (!$conexao)
{
die('Erro: ' . mysql_error());
} else {
echo "Conectou";
}
mysql_select_db($banco);
Here is the error that appears:
Error: mysqlnd can not 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, 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.
Does anyone know why this happens?