Cannot connect to database
I have very stupidly overwritten the Zen Cart database on the server. My web host has kindly restored the database with a recent back up. They are now telling me that: "You can connect your account to it again, but will need to create the SQL user for it again."
I have created the SQL user as it was before. How do I now connect the account to it again"? I tried uploading the config.php file in includes and the config.php file in admin but there is no change to the error messages I am getting.
These are:
When I try to connect to Zen Cart admin:
0 DB_ERROR_NOT_CONNECTED
in:
[select * from project_version WHERE project_version_key = 'Zen-Cart Database' ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
AND
When I try to access the site I get:
Sorry!
There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.
Would really appreciate any help that someone could give me.
Re: Cannot connect to database
Quote:
Originally Posted by
blueroomhermit
I have very stupidly overwritten the Zen Cart database on the server. My web host has kindly restored the database with a recent back up. They are now telling me that: "You can connect your account to it again, but will need to create the SQL user for it again."
I have created the SQL user as it was before. How do I now connect the account to it again"? I tried uploading the config.php file in includes and the config.php file in admin but there is no change to the error messages I am getting.
These are:
When I try to connect to Zen Cart admin:
0 DB_ERROR_NOT_CONNECTED
in:
[select * from project_version WHERE project_version_key = 'Zen-Cart Database' ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
AND
When I try to access the site I get:
Sorry!
There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.
Would really appreciate any help that someone could give me.
While it would be easier to tell what is going on by being able to look at the two areas, the mySQLAdmin and the configure.php files, the above indicates that files were restored to what they were, but doesn't appear that a verification has been made that all aspects of the two (three) areas match to each other. The other possibility is that the cache/cookies need to be cleared from your browser.
Look at the mySQLAdmin area for your database, identify/verify that the database name, user id and password match those listed in both configure.php files. Also, look to make sure that in restoration of your database that the database is still hosted on the server identified in your configure.php files...
Make sure you clear your cache/cookies (or even possibly use a different browser/computer) to try your site.
Perhaps someone else has a different idea to address this if the above doesn't work.
Re: Cannot connect to database
First off thank you so much for taking the time to reply. I have now been able to restore the shop part of the site. The settings in the includes configure.php files did not match as you so correctly said. However, I am still unable to login to the admin section. I have checked and re-checked the settings in the admin configure.php file and they appear to be correct. Consequently I am stuck again. If it would help I could copy and paste any relevant code? By the way, I did try to access admin on a different computer with a different browser with the same result.
Really appreciate your help so far.
Re: Cannot connect to database
Quote:
Originally Posted by
blueroomhermit
First off thank you so much for taking the time to reply. I have now been able to restore the shop part of the site. The settings in the includes configure.php files did not match as you so correctly said. However, I am still unable to login to the admin section. I have checked and re-checked the settings in the admin configure.php file and they appear to be correct. Consequently I am stuck again. If it would help I could copy and paste any relevant code? By the way, I did try to access admin on a different computer with a different browser with the same result.
Really appreciate your help so far.
In a way I'm not sure how best to approach the next part, as I don't want you to publish information that would allow others access to anything. But, I guess a couple things that can be done are to post the variable names that are listed in your admin configure.php file to confirm that it at least contains. The correct variables to be declared aample of one of them may be DIR_FS_IMAGES. But leave off what it equals in cases of paths.
You don't have an admin/includes/local/configure.php file do you?
Also when you say you can't get into your admin, could you please elaborate? I'm somewhat guessing at possible solutions at the moment. Are you getting a blank screen? Are you having to enter your password multiple times and it just cycles. What error logs do you have as a result? Etc...
Re: Cannot connect to database
Quote:
Originally Posted by
mc12345678
In a way I'm not sure how best to approach the next part, as I don't want you to publish information that would allow others access to anything. But, I guess a couple things that can be done are to post the variable names that are listed in your admin configure.php file to confirm that it at least contains. The correct variables to be declared aample of one of them may be DIR_FS_IMAGES. But leave off what it equals in cases of paths.
You don't have an admin/includes/local/configure.php file do you?
Also when you say you can't get into your admin, could you please elaborate? I'm somewhat guessing at possible solutions at the moment. Are you getting a blank screen? Are you having to enter your password multiple times and it just cycles. What error logs do you have as a result? Etc...
I don't see DIR_FS_IMAGES at all in the admin confure.php file
// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_ADMIN', 'BLANKED OUT');
define('DIR_FS_CATALOG', 'BLANKED OUT');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
I don't have an admin/includes/local/configure.php file.
I can't get into my admin means that when I click the shortcut on my desktop to reach it I now get a screen with the following error message:
0 DB_ERROR_NOT_CONNECTED
in:
[select * from project_version WHERE project_version_key = 'Zen-Cart Database' ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Re: Cannot connect to database
Quote:
Originally Posted by
blueroomhermit
I don't see DIR_FS_IMAGES at all in the admin confure.php file
// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_ADMIN', 'BLANKED OUT');
define('DIR_FS_CATALOG', 'BLANKED OUT');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
I don't have an admin/includes/local/configure.php file.
I can't get into my admin means that when I click the shortcut on my desktop to reach it I now get a screen with the following error message:
0 DB_ERROR_NOT_CONNECTED
in:
[select * from project_version WHERE project_version_key = 'Zen-Cart Database' ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
DIR_FS_IMAGES is already defined in the regular side, so would not need to be defined again in the admin. Also, if you look there is the DIR_FS_CATALOG_IMAGES variable which is/should be/more than likely equivalent to the DIR_FS_IMAGES directory. (Sorry for delayed response, have been trying to finish this message this today.) I also wanted to look it up, but I thought there was a wiki or faq listing that "explains" all that should be in each of the configure.php files. If whatis provided is "everything" (data obscured to protect the site owner), then there is info missing about the database and I thought a couple of other lines like ssl activated,and some other things.
Re: Cannot connect to database
That error almost always means that your database credentials in one or both of the configure.php files is wrong. Double and triple check that the database name, user name and password are exactly the same in both includes/configure.php and YOUR_ADMIN/includes/configure.php.
Re: Cannot connect to database
Quote:
Originally Posted by
stevesh
That error almost always means that your database credentials in one or both of the configure.php files is wrong. Double and triple check that the database name, user name and password are exactly the same in both includes/configure.php and YOUR_ADMIN/includes/configure.php.
I just checked again and the entries in both configure.php files for the section
// define our database connection
are exactly the same. As I said I can now see the store but cannot access the admin section at all. Could I email the 2 files to you so you could check for any mistakes that I can't spot?
Re: Cannot connect to database
Quote:
Originally Posted by
mc12345678
DIR_FS_IMAGES is already defined in the regular side, so would not need to be defined again in the admin. Also, if you look there is the DIR_FS_CATALOG_IMAGES variable which is/should be/more than likely equivalent to the DIR_FS_IMAGES directory. (Sorry for delayed response, have been trying to finish this message this today.) I also wanted to look it up, but I thought there was a wiki or faq listing that "explains" all that should be in each of the configure.php files. If whatis provided is "everything" (data obscured to protect the site owner), then there is info missing about the database and I thought a couple of other lines like ssl activated,and some other things.
I'm sorry. Can't follow that reply at all.
Re: Cannot connect to database
Quote:
Originally Posted by
blueroomhermit
I just checked again and the entries in both configure.php files for the section
// define our database connection
are exactly the same. As I said I can now see the store but cannot access the admin section at all. Could I email the 2 files to you so you could check for any mistakes that I can't spot?
PM the files to me. It's almost impossible that they are the same and one works and one doesn't, but we'll see. Are both files writeable so you can make edits and have them 'take' ?