Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Database connection problem

    Click image for larger version. 

Name:	Screenshot_1.jpg 
Views:	88 
Size:	28.8 KB 
ID:	18819
    Both config files should be ok but, I do get the above greeting.

    Code:
    <?php
    /**
     * @package Configuration Settings circa 1.5.0
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * File Built by zc_install on 2012-08-16 03:15:28
     */
    
    
    /*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
    /***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/
    
    // Define the webserver and path parameters
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
     define('HTTP_SERVER', 'https://venla.fi');
     define('HTTPS_SERVER', 'https://venla.fi');
     define('HTTP_CATALOG_SERVER', HTTP_SERVER);
     define('HTTPS_CATALOG_SERVER', HTTPS_SERVER);
    
    // Use secure webserver for checkout procedure?
      define('ENABLE_SSL', 'true');
    
    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      define('DIR_WS_CATALOG', '/');
      define('DIR_WS_HTTPS_CATALOG', '/');
    
      define('DIR_WS_IMAGES', 'images/');
      define('DIR_WS_INCLUDES', 'includes/');
      define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
      define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
      define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
      define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
      define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
      define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
    
      define('DIR_WS_PHPBB', '/');
    
    // * 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_CATALOG', '/home/wwkupklr/public_html/');
    
      define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
      define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
      define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
      define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
      define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
    
    // define our database connection
    define('DB_TYPE', 'mysql'); // always 'mysql'
    define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET', 'utf8mb4'); // 'utf8mb4' or older 'utf8' / 'latin1' are most common
    define('DB_SERVER', 'localhost');  // address of your db server
    define('DB_SERVER_USERNAME', 'wwkupklr_venla');
    define('DB_SERVER_PASSWORD', '(redacted)');
    define('DB_DATABASE', 'wwkupklr_venla');
    
      // The next 2 "defines" are for SQL cache support.
      // For SQL_CACHE_METHOD, you can select from:  none, database, or file
      // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
      // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
      // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
      define('SQL_CACHE_METHOD', 'none'); 
      define('DIR_FS_SQL_CACHE', '/home/wwkupklr/public_html/cache');
    // EOF
    Code:
    <?php
    /**
     * @package Configuration Settings circa 1.5.0
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * File Built by zc_install on 2012-08-16 03:15:28
     */
    
    
    /*************** NOTE: This file is similar, but DIFFERENT from the "store" version of configure.php. ***********/
    /***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/
    
    /**
     * WE RECOMMEND THAT YOU USE SSL PROTECTION FOR YOUR ENTIRE ADMIN:
     * To do that, make sure you use a "https:" URL for BOTH the HTTP_SERVER and HTTPS_SERVER entries:
     */
     define('HTTP_SERVER', 'https://venla.fi');
     define('HTTPS_SERVER', 'https://venla.fi');
     define('HTTP_CATALOG_SERVER', HTTP_SERVER);
     define('HTTPS_CATALOG_SERVER', HTTPS_SERVER);
    
      // secure webserver for admin?  Valid choices are 'true' or 'false' (including quotes).
      define('ENABLE_SSL_ADMIN', 'true');
    
      // secure webserver for storefront?  Valid choices are 'true' or 'false' (including quotes).
      define('ENABLE_SSL_CATALOG', 'true');
    
    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      $t1 = parse_url(HTTP_SERVER);$p1 = $t1['path'];$t2 = parse_url(HTTPS_SERVER);$p2 = $t2['path'];
    
      define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
      define('DIR_WS_CATALOG', '/');
      define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
      define('DIR_WS_HTTPS_CATALOG', '/');
    
      define('DIR_WS_IMAGES', 'images/');
      define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
      define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
      define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
      define('DIR_WS_INCLUDES', 'includes/');
      define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
      define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
      define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
      define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
      define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
      define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');
    
    // * DIR_FS_* = Filesystem directories (local/physical)
      define('DIR_FS_ADMIN', realpath(dirname(__FILE__) . '/../') . '/');
      //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
      define('DIR_FS_CATALOG', '/home/wwkupklr/public_html/');
    
      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/');
    
    // define our database connection 
    define('DB_TYPE', 'mysql'); // always 'mysql'
    define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET', 'utf8mb4'); // 'utf8mb4' or older 'utf8' / 'latin1' are most common
    define('DB_SERVER', 'localhost');  // address of your db server
    define('DB_SERVER_USERNAME', 'wwkupklr_venla');
    define('DB_SERVER_PASSWORD', '(redacted)');
    define('DB_DATABASE', 'wwkupklr_venla');
    
      // The next 2 "defines" are for SQL cache support.
      // For SQL_CACHE_METHOD, you can select from:  none, database, or file
      // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
      // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
      // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
      define('SQL_CACHE_METHOD', 'none'); 
      define('DIR_FS_SQL_CACHE', '/home/wwkupklr/public_html/cache');
    
    // Define the webserver and path parameters
      // Main webserver: eg-http://www.your_domain.com - 
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
      // HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.com
      /* 
       * URLs for your site will be built via:  
       *     HTTP_SERVER plus DIR_WS_ADMIN or
       *     HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or 
       *     HTTP_SERVER plus DIR_WS_CATALOG or 
       *     HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG
       * ...depending on your system configuration settings
       */
    // EOF
    Last edited by DrByte; 27 Jan 2020 at 06:34 PM. Reason: redactions

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Database connection problem

    1. Don't post your passwords here! This site is heavily indexed by search engines.
    You should go change your database password in both config files and of course in the database itself. I've edited your post to remove your password, but it might have been seen/scraped already, leaving you vulnerable to people who might try malicious things.

    2. The "we're having trouble connecting to the database" is telling you exactly the situation: it can't connect.
    If it "did" connect "previously" (ie: it was working yesterday, or an hour ago), but it has since "stopped connecting", then something has gone wrong on your server: probably your server administrator is doing something with the database.
    Possible causes:
    a) wrong username/password .... but if it was working already, then unless you changed those then this shouldn't be the cause.
    b) something wrong in the database engine ... perhaps the hosting company is doing maintenance? Perhaps there's an error? Did you look at your site's error logs? either in cPanel or in your /logs/ directory? You'll find helpful answers there.
    c) talk to your hosting company and/or server administrator.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Database connection problem

    The password is fake - not even close to reality. I thought about the url:s, but left them there. Thanks!

  4. #4
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Database connection problem

    Suddenly "gone wrong", is not the issue. I had it working on xampp, but it hit the wall when I moved to the live url. Sorry if I was ambiguous.

  5. #5
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Database connection problem

    Wild guess - did you grant all privileges to user wwkupklr_venla for that database?

  6. #6
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Database connection problem

    Good point, but priviledges were granted. Did also try with file rights - read and execute for everyone, but write status only for me - didn't help.

  7. #7
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Database connection problem

    The outcome is the same even if the password is faulty.
    Click image for larger version. 

Name:	Screenshot_2.jpg 
Views:	47 
Size:	27.0 KB 
ID:	18829
    Attached Images Attached Images  

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Database connection problem

    I'm confused: your first post suggested the question was related to an active previously-running live store. Your last post is showing zc_install, which probably isn't for a live store.

    Regardless, the origin of the problem is the same: the db credentials provided in the config don't match the db.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Database connection problem

    Quote Originally Posted by DrByte View Post
    I'm confused
    My mistake. Old (xampp) store was moved to live site, with existing xampp db. The combo doesn't work on the live site - frustration, panic. Start from scratch (zcinstall), ends up with "No such file or directory". Don't want to loose inputted data, but is there any other way?

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Database connection problem

    Quote Originally Posted by kalastaja View Post
    My mistake. Old (xampp) store was moved to live site, with existing xampp db. The combo doesn't work on the live site - frustration, panic. Start from scratch (zcinstall), ends up with "No such file or directory". Don't want to loose inputted data, but is there any other way?
    Little bit of a process problem in that if the live store remained live while the xamp store/database continued to be modified, then when the xamp database is transferred over to be the live database that any data collected between the initial backup and the current new live database are "lost".

    Here is the recommended way to upgrade by reinstall which is effectively a rebuild of the files with a followon update of the existing database (no data loss): http://www.zen-cart.com/entry.php?3-...d-of-upgrading

    The zc_install fileset in this situation of an upgrade serves basically two processes: Generate a set of configure.php files (includes/configure.php and admin/includes/configure.php) and then to also update the database from what it was to the version of software being used.

    The above process organizes to initially establish that there is a good connection between the database and that the files can be accessed as expected then when going through the zc_install process a second/subsequent time to do a database upgrade. The report of not having a database connection is as already been stated, the *new* issue of "no such file or directory" needs further clarification: where in the process does that appear, when trying to do what? What other software is installed that might lead to that issue? How was it made known that (unknown) file or directory did not exist?

    Need to be able to follow the actions leading to the issue to be able to offer suggestions for fixing it. Credentials have already been covered and would not lead to this new message.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Database connection problem
    By jgold723 in forum General Questions
    Replies: 2
    Last Post: 31 May 2014, 12:26 AM
  2. Odd database connection problem
    By afo in forum General Questions
    Replies: 6
    Last Post: 5 Nov 2010, 04:49 PM
  3. database connection problem
    By kjharrison in forum General Questions
    Replies: 5
    Last Post: 23 Apr 2010, 12:47 AM
  4. database connection problem
    By pixelpadre in forum General Questions
    Replies: 0
    Last Post: 18 Jul 2007, 08:34 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