I'm having an unusual error for myself. Next: When I try to connect via mysqli, I get a failed authentication return (access is denied), and the parameters are all correct! To confirm this access normally via SSH console with the same parameters and I succeed, but mysqli does not work! What could it be?
NOTE: the extension is enabled in the php configuration file
The connection code is simple:
$host = "localhost"
$user = 'usuario';
$password = 'senha';
$db = ' banco';
$mysqli = new mysqli($host, $user, $password, $db);
if (mysqli_connect_errno()) {
print("Conexão falhou: %s\n" . mysqli_connect_error());
exit();
}
The payback I have is:
Warning: mysqli::mysqli(): : Access denied for user 'usuario'@'localhost' to database ' banco' in /fakepath/arquivo.php on line 14
Conexão falhou: %s Access denied for user 'usuario'@'localhost' to database ' banco'