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]
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
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.
Re: error establishing a database connection
Use FTP and check date modified for your configure.php files
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?
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.
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_
Re: error establishing a database connection
Quote:
Originally Posted by
Spinners Derek
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