Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2015
    Location
    Darwen, Lancashire
    Posts
    3
    Plugin Contributions
    0

    Default error establishing a database connection

    When I try to go on my website as a customer would the following message comes up;- 'error establishing a database connection'. When I try to go through my admin site the following page from Zen Cart comes up. Can someone help me through a simple way of getting me back on my site. Please make it simple to understand as you will be dealing with a Technophobe.
    Hello. Thank you for loading Zen Cart™.
    You are seeing this page for one or more reasons:
    This is your first time using Zen Cart™ and you haven't yet completed the normal Installation procedure.
    If this is the case for you, you will need to upload the "zc_install" folder using your FTP program, and then run zc_install/index.php via your browser (or reload this page to see a link to it).
    Your /includes/configure.php and/or /admin/includes/configure.php file contains invalid path information and/or invalid database-connection information.
    If you recently edited your configure.php files for any reason, or maybe moved your site to a different folder or different server, then you'll need to review and update all your settings to the correct values for your server.
    See the Online FAQ and Tutorials area on the Zen Cart™ website for assistance.
    To begin installation ...
    The Installation Documentation can be read by clicking here: Documentation
    You will need to upload the "zc_install" folder using your FTP program, and then run zc_install/index.php via your browser (or reload this page to see a link to it).
    The Online FAQ and Tutorials area on the Zen Cart™ website will also be of value if you run into difficulties.[/COLOR]

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: error establishing a database connection

    Therew is something wrong with your 2 configure.php files

    Did you recently move to a new host or relocate your shop??

    Please provide information at the top in posting tips when posting
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2015
    Location
    Darwen, Lancashire
    Posts
    3
    Plugin Contributions
    0

    Default Re: error establishing a database connection

    I have someone creating ane website for me and they have been duplicating the stock items from my existing website for the new one. I contacted them yesterday asking if they had been into my current website but they say they haven't.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: error establishing a database connection

    Use FTP and check date modified for your configure.php files
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: error establishing a database connection

    Does your internet host offer automatic file backup? If so, can you retrieve a slightly "older" backup than when work was being done to the site and compare the includes/configure.php and admin/includes/configure.php file to each other?

    How much access does the individual have to your control panel of your orginal site?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Jan 2015
    Location
    Darwen, Lancashire
    Posts
    3
    Plugin Contributions
    0

    Default Re: error establishing a database connection

    My Internet Host does offer the back up and kindly ran one back dated to prior to when the error occurred but says they cann ot resolve the issue, they ran a second back up dated a few days prior to the error but again it still hasn't resolved the issue.

    My new webpage designer doesn't have any access to my host account only the website itself.
    Last edited by Spinners Derek; 11 Aug 2015 at 03:14 PM.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: error establishing a database connection

    So then more than likely something about the database has changed. (Assume that the above backups were all file related). Are you able to identify the presence of a mysql database and identify things such as it's name?

    The database that the store is looking for is identifed in the file includes/configure.php. Near the lower half or so: where lnes begin like: define('DB_
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: error establishing a database connection

    Quote Originally Posted by Spinners Derek View Post
    When I try to go on my website as a customer would the following message comes up;- 'error establishing a database connection'.
    Create a file called 'debugdb.php' with the following code. Replace the 'X's with the same data that you have in the configure.php file(s).

    Code:
    <?php
    $server = "XXXXXXX";    // probably 'localhost'
    $username = "XXXXXXXXXXXX";
    $password = "XXXXXXXXXXXX";
    $database = "XXXXXXXXXXXX";
    
    
    $db = mysql_connect ($server, $username, $password);
    if (!$db) {
    die ('I cannot connect to the database because: ' .
    mysql_error());
    }
    else {
    mysql_select_db ($database);
    print("connected OK");
    }
    
    
    ?>
    Save the file into the 'root' folder of your store. then execute this script by pointing your webbrowser to http://yourstore.com/debugdb.php

    This should show you *why* the database connection can't be made.
    Delete the file when you've finished debugging.

    Cheers
    RodG

 

 

Similar Threads

  1. Replies: 0
    Last Post: 11 Dec 2013, 08:05 AM
  2. Error establishing a database connection
    By Fireflyz in forum General Questions
    Replies: 2
    Last Post: 22 Oct 2009, 12:19 PM
  3. Database Connection Error
    By ambprice in forum Installing on a Windows Server
    Replies: 5
    Last Post: 2 Nov 2007, 08:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR