你好,我是新来的主持人cpanel.我在测试我的网站时遇到了这个数据库连接错误


Hi am new to hostgator cpanel.I get this database connection error when testing my website

出于安全目的,我隐藏了其他详细信息

SQLSTATE[2800][1045]拒绝用户'cPanelUsername_databaseUsername'@'localhost'的访问(使用密码:YES)致命错误:对第25行/home3/username/public_html/domai/AppINIT.php中的非对象调用成员函数prepare()

appINIT.php configuration settings
<?php
$db_host        = "localhost";
$db_port        = "80";
$db_user        = "cPanelUsername_databaseUsername";
$db_password    = "xxxxxxx";
$db_name        = "cPanelUsername_databaseName";
define("EXT", '.php');
$licensekey = ""; #License Key
$secret = "yyyy";  #Secuirity Salt
?>
//prepared statement
$stmt = $dbh->prepare("select * from appconfig"); $stmt->execute(); $result = $stmt->fetchAll();

提前感谢

没有$dbh变量,因此不能对其调用prepare()。