Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2009
    Location
    Pattaya City, Thailand
    Posts
    14
    Plugin Contributions
    0

    Default 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.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Cannot connect to database

    Quote Originally Posted by blueroomhermit View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2009
    Location
    Pattaya City, Thailand
    Posts
    14
    Plugin Contributions
    0

    Default 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.
    Last edited by blueroomhermit; 16 Nov 2013 at 06:56 AM.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Cannot connect to database

    Quote Originally Posted by blueroomhermit View Post
    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...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2009
    Location
    Pattaya City, Thailand
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot connect to database

    Quote Originally Posted by mc12345678 View Post
    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.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Cannot connect to database

    Quote Originally Posted by blueroomhermit View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default 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.

  8. #8
    Join Date
    Feb 2009
    Location
    Pattaya City, Thailand
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot connect to database

    Quote Originally Posted by stevesh View Post
    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?

  9. #9
    Join Date
    Feb 2009
    Location
    Pattaya City, Thailand
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot connect to database

    Quote Originally Posted by mc12345678 View Post
    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.

  10. #10
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Cannot connect to database

    Quote Originally Posted by blueroomhermit View Post
    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' ?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Cannot connect to database
    By pontiacg5 in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 12 Jul 2010, 03:00 PM
  2. Cannot connect to database
    By Decostyle in forum General Questions
    Replies: 2
    Last Post: 7 Oct 2008, 08:40 PM
  3. Cannot connect to database
    By actorxfactor in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 18 Sep 2007, 10:05 PM
  4. Cannot Connect To Database...
    By kbalona in forum General Questions
    Replies: 2
    Last Post: 3 May 2007, 07:41 PM
  5. cannot connect to database
    By east coast in forum General Questions
    Replies: 1
    Last Post: 23 May 2006, 04:42 AM

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