错误SQLSTATE [28000] [1045]

时间:2015-05-09 22:37:45

标签: mysql

当我想与PDO联系时:

<?php
$host_name = "localhost";
$database = "pdo"; // Change your database name
$username = "root"; // Your database user id 
$password = "test"; // Your password

//////// Do not Edit below /////////
try {
     $dbo = new PDO('mysql:host=' . $host_name . ';dbname='.$database, $username, $password);
} catch (PDOException $e) {
     print "Error!: " . $e->getMessage() . "<br/>";
     die();
}
?>

我收到此错误消息:

 Error!: SQLSTATE[28000] [1045] Access denied for user 'user_name'@'ip.address' (using password: YES) 

PS:通常我会填写我的服务器信息。

0 个答案:

没有答案