意外的异常:SQLSTATE [HY000] [1045]用户**** @'localhost'的访问被拒绝(使用密码:是) [英] Unexpected Exception: SQLSTATE[HY000] [1045] Access denied for user ****@'localhost' (using password: YES)

查看:2826
本文介绍了意外的异常:SQLSTATE [HY000] [1045]用户**** @'localhost'的访问被拒绝(使用密码:是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个老同事把申请交给我来管理.但是,每当我尝试运行它时,都会不断出现此错误.请任何帮助.

An application was handed to me by an old colleague to manage. However, whenever I try to run it, I keep getting this error. Please any help would do.

推荐答案

有时访问被拒绝异常错误,因为您的mysql凭据无效. 其次,根据我的经验,我发现这也是因为您没有为数据库连接设置密码而发生的.例如

Sometimes Access denied Exception Error because your mysql credentials are invalid. Secondly, from my experience i observed that this also happens because you did not set password to your database connectivity. eg

private $host = "localhost";
private $db_name = "db_dbtest"; // Database name
private $username = "db_user"; // your database username
private $password = "db_password"; // Your password
public $conn;

}

尝试为数据库连接设置密码.我有这样的经验,并且在操作"选项卡上将排序规则"更改为utf8_general_ci之后,这无法解决我的问题.我想到将密码添加到我的数据库连接中,并立即将其连接. 您可以试一下,看看是否有帮助.

Try and set password to your database connectivity. I had such experience and after changing my Collation to utf8_general_ci on the Operations tab, this could not solve my problem. I thought of adding password to my database connection and immediately it connected. You can tesrun this and see if it helps.

这篇关于意外的异常:SQLSTATE [HY000] [1045]用户**** @'localhost'的访问被拒绝(使用密码:是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆