Pages: [1]   Go Down
Send this topic | Print
Author Topic: Problem with ebook store script - need help  (Read 643 times)
aussieangel2
Member
*
Offline Offline

Posts: 11


« on: November 23, 2008, 10:42:47 AM »

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:

Quote
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 -

Code:
// 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 -

Code:
// 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:

Code:
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:

Code:
<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

Logged
mytestpages
Authority Member
****
Offline Offline

Posts: 612


« Reply #1 on: November 23, 2008, 10:58:17 AM »

you need to change the data in the configure page

e.g the data to connect to the db
Logged

I am a freelancer offering web design at cheap rates http://www.garethgillman.co.uk

CSS tutorials - http://www.css-tutorials.co.uk
aussieangel2
Member
*
Offline Offline

Posts: 11


« Reply #2 on: November 23, 2008, 11:05:00 AM »

Hi,
I did change the details stated in the files quoted above.

Sarah
Logged
robleyd
Official 110mb Guru
********
Online Online

Posts: 5700

Ask before you PM


« Reply #3 on: November 23, 2008, 06:35:07 PM »

You have purchased the mysql upgrade AND set up your database AND given privileges to the database user to access the database?
Logged

I once had a hard drive clunk-clicking
Strange noises, weird sounds and tick-ticking
I thought I would wait
And procrastinate...
But now all my data is missing
--------------
dd, a dump, a data dump
read a line from standard in
$USER, the name I call my self
make - a long long time to run
.so a library that is shared
.ko it's not the same as .so
tee, a redirect with in and out
and brings us back to dd d d d
aussieangel2
Member
*
Offline Offline

Posts: 11


« Reply #4 on: November 23, 2008, 09:01:02 PM »

You have purchased the mysql upgrade AND set up your database AND given privileges to the database user to access the database?

Hi,
Yes to all of the above, even though the instructions for the script say you don't need to create the database username or password I have done that anyway.

Sarah
Logged
codewhite
Advanced Authority Member
*****
Offline Offline

Posts: 1340


Violent Patient


WWW
« Reply #5 on: November 23, 2008, 11:17:30 PM »

Your problem is here:
Code:
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

Your DB_SERVER_USERNAME should be the username that you created for the database and the DB_SERVER_PASSWORD is the password associated with that account, NOT your login info.
Logged


I am a signature virus, copy me to your signature to spread me <Generation 0>
Increase Generation number each time I'm copied.
Codewhite Designs Cigar Journal On sale now.
OleTom
RoadHo
Active Member
**
Offline Offline

Posts: 69


On The Road Some Where


WWW
« Reply #6 on: November 24, 2008, 06:44:21 AM »

for a start

all your paths need to be like:

/www/110mb.com/e/b/o/o/k/s/n/m/ebooksnmore/htdocs/admin/


not:

/home/USERNAME/public_html/admin/


Also your data base user name will be like:

aussieangel2_UserName

Your Data Base Name will be:

aussieangel2_DataBaseName

That one got me at first  smiley

And if you are not going to put you store in your root directory you need to change

define('DIR_FS_CATALOG', '/www/110mb.com/e/b/o/o/k/s/n/m/ebooksnmore/htdocs/YOUR_STORE_FOLDER/');
« Last Edit: November 24, 2008, 07:07:27 AM by OleTom » Logged

Pages: [1]   Go Up
Send this topic | Print
Jump to: