1
I’m trying to connect offline to a Mysql base, but I’m not getting.
The code is on my machine, I’ve tried by IIS and XAMPP but every time I try to connect, it presents an error. Follow 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);
Follow the error that appears:
Error: 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.
Does anyone know why this happens?
Patrick, you posted the question in English on [en.so]. Could you translate? Or the intention was to post on [so] (in English)?
– bfavaretto
Patrick, your connection string is empty. That’s why it returns this error.
– gmsantos