mysql - PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user -
i have made project in php oop , runs perfect @ localhost server tried uploading site online server , made database user , connect db project this:
<?php class connection { public function dbconnect() { return new pdo("mysql:host=127.0.0.1; dbname=danoupco_host", "za{c?quyq8g", "danoupco_user"); } } ?>
everything looks fine problem not load site. , error message on browser:
this page isn’t working
your site unable handle request.
http error 500
so saw error_log , says:
[10-sep-2017 13:53:02 utc] php fatal error: uncaught exception 'pdoexception' message 'sqlstate[hy000] [1045] access denied user 'za{c?quyq8g'@'localhost' (using password: yes)' in db.class.php line 6
so here line 6 of db.class.php
:
return new pdo("mysql:host=127.0.0.1; dbname=danoupco_host", "za{c?quyq8g", "danoupco_user");
and checked mysql database name , user , correct:
so don't know whats going on there... can check site , see yourself.