Hello everybody
I’ve an access denied error to my user when I try to insert a row in a table, and I’m using PDO to connect to my database and I coudn’t figure out what’s wrong, could someone help me please ? I have a file config.php that contains the constants to the database connection values, as db_host, db_name, db_user and db_pass.
Here is my code…
(…)
try {
self::$instance = new PDO(‘mysql:host’.DB_HOST.’;dbname=’.DB_NAME,DB_USER,DB_PASS)
self::$instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); self::$instance->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
} catch (PDOException $e) {
echo $e->getMessage();
}
(…)
Follows the error message:
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user ‘xxx_app’@’%’ to database ‘information_schema’ in /storage/ssd3/087/2516087/public_html/classes/Perfil.php:34 Stack trace: #0 /storage/ssd3/087/2516087/public_html/classes/Perfil.php(34): PDOStatement->execute() #1 /storage/ssd3/087/2516087/public_html/classes/teste_perfil.php(19): Perfil->insert() #2 {main} thrown in /storage/ssd3/087/2516087/public_html/classes/Perfil.php on line 34
Thanks in advance for help!
Mary