Access denied for user error in connection

0

Can anyone tell me why I'm encountering this error?

  

Warning: mysqli_connect (): (HY000 / 1045): Access denied for user 'clients' @ localhost (using password: YES) in C: \ Program Files (x86) \ EasyPHP-Devserver- www \ Company Hard_php \ to_db.php on line 24

     

Warning: mysqli_error () expects parameter 1 to be mysqli, boolean given in C: \ Program Files (x86) \ EasyPHP-Devserver-17 \ eds-www \ Company Hard_php \ to_db.php on line 26

Code:

$ip = '127.0.0.1';
$conta = 'clienteaces';
$pass = 'abcdef123456';
$db = 'hard'; 



$conexao = mysqli_connect($ip,$conta,$pass,$db);
if(!$conexao){
   die("Não Conectado : ". mysqli_error($conexao)); 
   echo "O formulario não foi preenchido tente novamente mais tarde...";    
}
else{
    $sql = mysqli_query($conexao,"INSERT INTO 'contato' (nome) values ('$nome')");
    $sql = mysqli_query($conexao,"INSERT INTO 'contato' (email) values ('$email')");
    $sql = mysqli_query($conexao,"INSERT INTO 'contato' (assunto) values ('$assunto')");
    $sql = mysqli_query($conexao,"INSERT INTO 'contato' (mensagem) values ('$mensagem')");

    echo "Mensagem enviada obrigado logo estaremos entrando em contato!";
    echo "<input type='button' name='voltar' value='Voltar' href='../index.html'>";
}
?>

Since in the database I created a user with this name and password with the correct privileges.

    
asked by anonymous 25.08.2017 / 19:33

0 answers