MYSQL CONNECTION ACCESS DENIED

Status
Not open for further replies.

dzux10bz

New Member
Messages
5
Reaction score
0
Points
1
After spending 3hrs just to figure out my problem its
still no luck.

heres my mysql connection code:

define('DBHOST', '127.0.0.1');
define('DBUSER', 'dzux10bz_user');
define('DBPASS', '123*****');
define('DBNAME', 'dzux10bz_db');

function db(){
global $db;
try {
$db=new PDO('mysql:host='.DBHOST.';dbname='.DBNAME.';charset=utf8',DBUSER,DBPASS);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES,false);
$db->setAttribute(PDO::MYSQL_ATTR_FOUND_ROWS, true);
} catch(PDOException $e){
echo $e;
exit();
}
}
db();



Error msg:
exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'dzux10bz_user'@'localhost' (using password: YES)' in /home/dzux10bz/public_html/cfg/pdo.php:31 Stack trace: #0 /home/dzux10bz/public_html/cfg/pdo.php(31): PDO->__construct('mysql:host=127....', 'dzux10bz_user', '123*****') #1 /home/dzux10bz/public_html/cfg/pdo.php(40): db() #2 {main}

 
Last edited:
Status
Not open for further replies.
Top