我正在使用Joomla 1.5,并希望进行自定义分页。为此,我需要连接到数据库。
database_connection.php:
<?php
/*Define constant to connect to database */
DEFINE('DATABASE_USER', 'padekime_db'); //this is my user's name
DEFINE('DATABASE_PASSWORD', 'myPassword');
DEFINE('DATABASE_HOST', 'hostingas.in');
DEFINE('DATABASE_NAME', 'padekime_db');
// Make the connection:
$dbc = @mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD,
DATABASE_NAME);
if (!$dbc) {
trigger_error('Could not connect to MySQL: ' . mysqli_connect_error());
}
?>
这是我收到的错误:
Notice: Could not connect to MySQL: Access denied for user 'padekime_db'@'neva.hostingas.in' (using password: YES) in /home/padekime/domains/juokoera.lt/public_html/components/com_allvideoshare/views/videos/tmpl/database_connection.php on line 16
可能出了什么问题?
啊。服务器很可能拒绝远程主机访问。如果它们在同一台服务器上,请为您的主机设置localhost。此外,该主机可能不是为MySQL数据库提供服务的主机。希望这能有所帮助!