I'm encountering the following error when trying to connect my MySQL database to a PHP application: SQLSTATE[HY000] [1045] Access Denied for User 'admfrog'@'localhost' (Using Password: YES).

RAYSSA GEYZIELE LEITE PIRES 0 Reputation points
2024-09-06T15:06:51.63+00:00

I’ve set up a MySQL server using XAMPP and now I’m trying to use this database in a PHP program. The error occurs specifically when I attempt to insert data via the web interface, but the database connection works fine during other tests.

It seems that the user admfrog does not have superuser permissions, and I’ve tried creating a new superuser, but I couldn’t get that to work either.

Can someone please help me resolve this issue and ensure that my user has the necessary permissions for the connection?

Note: The error only occurs when attempting to insert data through the web interface; otherwise, the connection works normally.

setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Conectado com sucesso";
} catch (PDOException $e) {
    echo "Falha na conexão: " . $e->getMessage();
}
?>

The code shown above is mine, it only changes my information

Note: The error only occurs when attempting to insert data through the web interface; otherwise, the connection works normally.Screenshot_1Screenshot_3

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,630 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.