Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2011
    Posts
    14
    Plugin Contributions
    0

    Default "Connection to Database failed" upon install - I think I need database name help

    Hi - just d/l the zen cart sw, and uploaded everything to my server. Even tho i use Windows, I have a Linux hosting package. So, I think I am in the correct forum, right? :)

    Upon attemting to do the database setup, I get:

    Connection to Database failed
    Unknown MySQL server host

    Now, initially, the Database Host field was filled with 'localhost'. I left that, and entered my username and pword. When that didn't work, I went back and changed 'localhost' to 'ftp.xxxxx.hostname.com' That didn't work either. And I know I have everything right, b/c I can log into my server using filezilla with that host, username and pword.

    So, clicked the 'more info' button, and in addition to proper username/pword, the window that opened told me:

    You may also have given the wrong database name (Does it exist? Did you create it? -- NOTE: Zen Cart™ does not create a database for you.).

    So that must be the problem. Q is: what do I put in the database name field? Do I need to create something?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    Who is your web host company?
    20 years a Zencart User

  3. #3
    Join Date
    Sep 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    Dotster

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    Ok... never heard of "Dotster" but they look as if they could be reliable. I trust you have taken a LINUX hosting account with them?

    If not, you must ask them to move you OFF windows hosting to Linux hosting. Zencart is much easier to manage when on a Linux box.

    You will create your database in the C-Panel of your hosting account.

    When you get to your C-Panel Admin Screen, you will see an area for DATABASES, and there will be a little icon called "MySQL" databases.

    You need to CREATE a database, and a USER for that database, and then LINK the user to the database.

    This all takes a few seconds, and there will be a tutorial on your C-PAnel showing how it's done.

    You need to make a note of your DATABASE NAME, your DATABASE USER NAME and your USER PASSWORD.

    When you install zencart, it will prompt you for this information.
    20 years a Zencart User

  5. #5
    Join Date
    Sep 2011
    Posts
    14
    Plugin Contributions
    0

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    Excellent - got it - thank you!

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

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    Quote Originally Posted by jasong1968 View Post
    Upon attemting to do the database setup, I get:
    < snip >
    Unknown MySQL server host
    This is the 'important' part of the error message

    Quote Originally Posted by jasong1968 View Post
    Now, initially, the Database Host field was filled with 'localhost'.
    This is almost always correct.

    Quote Originally Posted by jasong1968 View Post
    I left that, and entered my username and pword. When that didn't work,
    Which username and password did you use? You probably have several.
    One for your WebHosts account (control panel), another for your FTP account (although this is often the same as the control panel account, at least by default), one for the admin section of the store, and yet another one for the SQL database. This will be different than any of the others.

    Quote Originally Posted by jasong1968 View Post
    I went back and changed 'localhost' to 'ftp.xxxxx.hostname.com' That didn't work either.
    This is an FTP server site. What you need is the SQL server site, and since most hosts dissallow remote SQL anyway it is unlikely that you'll need to use anything other than 'localhost' for the database server.

    Quote Originally Posted by jasong1968 View Post
    And I know I have everything right, b/c I can log into my server using filezilla with that host, username and pword.
    See above. An FTP server and an SQL server are two entirely separate things. By design an FTP server will allow remote access, which is why you need to use the full server name to connect to it. The SQL server, even if on the same host, has its own rules and requirements, login details, etc

    Quote Originally Posted by jasong1968 View Post
    the window that opened told me:

    You may also have given the wrong database name (Does it exist? Did you create it? -- NOTE: Zen Cart™ does not create a database for you.).

    So that must be the problem.
    Most definitely.

    Quote Originally Posted by jasong1968 View Post
    Q is: what do I put in the database name field?
    The database server name should be 'localhost' unless your webhost has explicitly given you other instructions.

    The username and password for the database will be something that *you* choose when you create the database (zencart doesn't do this for you).

    Quote Originally Posted by jasong1968 View Post
    Do I need to create something?
    Yes, you need to create the database before trying to do the zencart installation. You don't need to create any tables in the database, you only need to create the database itself (and a user with permissions to connect to it). This is usually quite a simple task and most Hosts will provide a tool or 'wizard' in the control panel to make it really simple.
    Just remember that when you create the database, the user, and the password, you should jot these down somewhere, because THAT is the data you will need to enter during the zen installation.

    NOTE: When creating the SQL user password make it as complex as possible. This isn't a username/password that you will use on a regular basis. You will need to enter it once when creating the account, and once again during the zencart installation. After that it will be stored in the config file and you'll probably never, ever have to refer to or use them again.
    Don't use the same username/password that you have used anywhere else.

    Cheers
    Rod

  7. #7
    Join Date
    Nov 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    i need help zen cart db connection on server its work fine on localhost this is my include/configure.php

    Code:
    <?php
    /**
     * @package Configuration Settings circa 1.3.9
     * @copyright Copyright 2003-2010 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 2011-11-25 08:56:01
     */
    
    
    /*************** 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', 'http://staysports.com/');
      define('HTTPS_SERVER', 'http://staysports.com/');
    
      // Use secure webserver for checkout procedure?
      define('ENABLE_SSL', 'false');
    
    // 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', 'http://staysports.com/zencart-1-3-9/');
      define('DIR_WS_HTTPS_CATALOG', 'http://staysports.com/zencart-1-3-9/');
    
      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', 'C:/wamp/www/zencart-1-3-9/');
    
      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');
      define('DB_PREFIX', '');
      define('DB_SERVER', 'Localhost');
      define('DB_SERVER_USERNAME', '');
      define('DB_SERVER_PASSWORD', '');
      define('DB_DATABASE', '');
      define('USE_PCONNECT', 'false');
      define('STORE_SESSIONS', 'db');
    
      // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage
    
      // 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', 'C:/wamp/www/zencart-1-3-9/cache');
    
    // EOF


    this is my admin/include/confiugue.php
    Code:
    <?php
    /**
     * @package Configuration Settings circa 1.3.9
     * @copyright Copyright 2003-2010 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 2011-11-25 08:56:01
     */
    
    
    /*************** 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.      ***********/
    
    // 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
       *
       * If you desire your *entire* admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
       */
      define('HTTP_SERVER', 'http://staysports.com/');
      define('HTTPS_SERVER', 'http://staysports.com/');
      define('HTTP_CATALOG_SERVER', 'http://staysports.com/');
      define('HTTPS_CATALOG_SERVER', 'http://staysports.com/');
    
      // Use secure webserver for catalog module and/or admin areas?
      define('ENABLE_SSL_CATALOG', 'false');
      define('ENABLE_SSL_ADMIN', 'false');
    
    // 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)
      //saqib area to change the admin root name
      define('DIR_WS_ADMIN', '/zencart-1-3-9/admin-new/');
      define('DIR_WS_CATALOG', '/zencart-1-3-9/');
      define('DIR_WS_HTTPS_ADMIN', '/zencart-1-3-9/admin-new/');
      define('DIR_WS_HTTPS_CATALOG', '/zencart-1-3-9/');
    
      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)
      //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
      define('DIR_FS_ADMIN', 'C:/wamp/www/zencart-1-3-9/admin-new/');
      define('DIR_FS_CATALOG', 'C:/wamp/www/zencart-1-3-9/');
    
      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');
      define('DB_PREFIX', '');
      define('DB_SERVER', 'Localhost');
      define('DB_SERVER_USERNAME', '');
      define('DB_SERVER_PASSWORD', '');
      define('DB_DATABASE', '');
      define('USE_PCONNECT', 'false');
      define('STORE_SESSIONS', 'db');
    
      // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage
    
      // 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', 'C:/wamp/www/zencart-1-3-9/cache');
    
    // EOF

    plz help me!!!!!!!!!!!!!!!!!!!!!!

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

    Default Re: "Connection to Database failed" upon install - I think I need database name help

    Simple: do a NEW install on the server. Keep the NEW configure.php files built by the server, and copy the other files to your server.
    Explained here: https://www.zen-cart.com/tutorials/i...hp?article=100
    .

    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.

 

 

Similar Threads

  1. v154 Install Connection To Database Failed
    By rbach in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 3 Feb 2015, 01:43 AM
  2. Replies: 4
    Last Post: 2 Jan 2012, 10:46 PM
  3. "database appears to need patching" just after install
    By uccaxap in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 15 Jan 2010, 09:12 AM
  4. Help.... "Connection to Database failed - Can't connect to local MySQL"
    By chadwick in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Nov 2009, 09:07 PM
  5. Getting a "Connection to Database Failed" message
    By Inuashley in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 17 Nov 2008, 01:34 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