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).
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.