SQLSTATE [28000] [1045]:服务器提供程序崩溃后出现奇怪的PDO错误

After a crash server, we have a strange error with our database...

Password and user is correct, we use a simple PDO connect :

session_start();
ini_set('display_errors', 1);
ini_set('log_errors', 1);
try
{
    $bdd = new PDO('mysql:host=localhost;dbname=databaseName', 'correctUSER','correctPassword');
    die('ok');
}
catch(Exception $e)`enter code here`
{
    die('Erreur : '.$e->getMessage());
}

But we have a : "Error : SQLSTATE[28000] [1045] Access denied for user 'correctUSER'@'localhost' (using password: YES)" ??

We try to delete, recreate database and user but we have always the problem, the strange thing is that if we try we the root user => it works but it's not safe to use the root password...

Anyone have a solution ??

Thanks !

It was an error with mysql, I have to make a

REPAIR TABLE mysql.user

Nothing actually strange in this error. The answer is quite simple and obvious.

Password and user is correct

As you can see from the error message below, this statement of yours is simply not true.
So, to solve that problem you have to supply correct username and password.

Also just a side note: remove that try-catch-die stuff from your code. It's totally useless, redundant and insecure.