Hi,
I have just installed an ebook store script on my site and am having a problem. I've installed this before but don't recall this problem (or if I did, how I fixed it!) I've made all changes as stated in the instructions but when I go to the admin page I get the following message:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ebooksnmore'@'localhost' (using password: YES) in /www/110mb.com/e/b/o/o/k/s/n/m/ebooksnmore/htdocs/admin/includes/functions/database.php on line 12
Unable to connect to database server!
The pages to change are: includes/configure.php which has the following section to be changed -
// add your database and website details to the variables below
define('DB_SERVER_USERNAME', 'username');
// your username that you use to log into your web server
define('DB_SERVER_PASSWORD', 'password');
// your password that you use to log into your web server
define('DB_DATABASE', 'username_store');
// replace username with your web server username
define('DIR_FS_CATALOG', '/home/USERNAME/public_html/');
define('HTTP_SERVER', 'http://www.YOURWEBSITE.com');
define('HTTP_COOKIE_DOMAIN', '.YOURWEBSITE.com');
// do not include the www
and then admin/includes/configure.php has the following section to be changed -
// add your database and website details to the variables below
define('DB_SERVER_USERNAME', 'username');
// your username that you use to log into your web server
define('DB_SERVER_PASSWORD', 'password');
// your password that you use to log into your web server
define('DB_DATABASE', 'username_store');
// replace username with your web server username
define('DIR_FS_ADMIN', '/home/USERNAME/public_html/admin/'); // replace username with your web server username
define('DIR_FS_CATALOG', '/home/USERNAME/public_html/');
define('DIR_FS_DOCUMENT_ROOT', '/home/USERNAME/public_html/');
define('SITE', 'www.YOURWEBSITE.com');
define('WWW', 'http://www.YOURWEBSITE.com');
define('HTTP_SERVER', 'http://www.YOURWEBSITE.com');
define('HTTP_CATALOG_SERVER', 'http://www.YOURWEBSITE.com');
I have used the following for the variables above:
define('DB_SERVER_USERNAME', 'ebooksnmore (my account login)');
// your username that you use to log into your web server
define('DB_SERVER_PASSWORD', 'login password'); - replaced my actual login password (not showing it here)
// your password that you use to log into your web server
define('DB_DATABASE', 'ebooksnmore_store');
// replace username with your web server username
define('DIR_FS_ADMIN', '/home/ebooksnmore/public_html/admin/'); // replace username with your web server username
define('DIR_FS_CATALOG', '/home/ebooksnmore/public_html/');
define('DIR_FS_DOCUMENT_ROOT', '/home/ebooksnmore/public_html/');
define('SITE', 'ebooksnmore.110mb.com');
define('WWW', 'http://ebooksnmore.110mb.com');
define('HTTP_SERVER', 'http://ebooksnmore.110mb.com');
define('HTTP_CATALOG_SERVER', 'http://ebooksnmore.110mb.com');
In the above example, I have also tried my domain name (
http://www.ausebooks4u.com) in the website addresses in the last 4 lines but neither one makes any difference.
Below is some of the code from the database.php file stated in the error message, however, the installation instructions do not mention anything about changing this file:
<html dir="ltr">
<head>
<?php
/*
*/
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}
if ($$link) mysql_select_db($database);
return $$link;
}
function tep_db_close($link = 'db_link') {
global $$link;
return mysql_close($$link);
}
function tep_db_error($query, $errno, $error) {
die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');
}
function tep_db_query($query, $link = 'db_link') {
global $$link, $logger;
if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
if (!is_object($logger)) $logger = new logger;
$logger->write($query, 'QUERY');
}
$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());
if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
if (mysql_error()) $logger->write(mysql_error(), 'ERROR');
}
return $result;
}
The database I created was ebooksnmore_store and I added a username & password and assigned privileges.
Can anyone tell what has possibly gone wrong here?
Sarah