Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Posts
    23
    Plugin Contributions
    0

    Default Install Connection To Database Failed

    We are trying to do a fresh install Zen Cart 1.5.4

    When running the installer we are being given the error message 'Connection to Database failed'

    Our Level 3 Tech Support spent a long time trying to solve this and reports as follows

    (We should also say that we ARE able to install on a PHP5.3 server without issues)

    We have double checked the database credentials being used as below by using the same credentials in a remoter MySQL client and this connects without issue

    We have tried everything from changing between mysqli and mysql statements, triple checking the user/pass/database/hostname for connecting to MySQL server, to checking the error log for clues, all without having any success at getting ZenCart to connect.

    When using my own test script that uses mysql_connect, there was no issue connecting, and I’m able to pull database data, as shown:

    http://thesoapboxco.com/mysqltest.php

    A similar test fails when using mysqli_connect:

    http://thesoapboxco.com/mysqltestfail.php

    This is why we had tried replacing mysqli statements in ZenCart code, but without luck getting it to work.

    The error log indicates problems with PHP deprecated statements, including mysql/mysqli statements:

    ==========================
    [Sat Jan 31 02:54:57 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD. This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltestfail.php on line 14
    [Sat Jan 31 02:55:10 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 14
    [Sat Jan 31 02:55:10 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: Function mysql_numrows() is deprecated in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 19
    [Sat Jan 31 02:55:38 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD. This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltestfail.php on line 14
    [Sat Jan 31 02:55:40 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD. This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltestfail.php on line 14
    [Sat Jan 31 02:55:43 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 14
    [Sat Jan 31 02:55:43 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: Function mysql_numrows() is deprecated in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 19
    [Sat Jan 31 02:55:45 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 14
    [Sat Jan 31 02:55:45 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: Function mysql_numrows() is deprecated in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 19
    ==========================

    Based on this, we found the following article / posting:

    ==========================
    http://stackoverflow.com/questions/1...ure-use-mysqli

    “The entire ext/mysql PHP extension, which provides all functions named with the prefix mysql_, is officially deprecated as of PHP v5.5.0 and will be removed in the future.

It was originally introduced in PHP v2.0 for MySQL v3.23, and no new features have been added since 2006. Coupled with the lack of new features are difficulties in maintaining such old code amidst complex security vulnerabilities.

The manual has contained warnings against its use in new code since June 2011.

    Coupled with the lack of new features are difficulties in maintaining such old code amidst complex security vulnerabilities."

    ==========================

    Can you please confirm with the ZenCart developers that ZenCart is fully compliant with PHP 5.5.x, as it seems it is not?

    You may need to stick with using servers that have PHP 5.3, as on web26, until the application is made compliant with PHP 5.5.×.

    Please let us know if you need to migrate the ‘soapboxco’ account back to web26, and we can get that going for you, unless the developer has a way to fix the issue.

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Zen Cart 1.5.4 Install Connection To Database Failed

    Zen Cart 1.5.2 and newer use mysqli_* (as you noted mysql_* is deprecated). I'm currently running a couple Zen Cart 1.5.4 sites under PHP 5.5.20 and 5.6.4 (with applicable patches).


    Out of curiosity, what version of PHP and MySQL are in use on the site where you are experiencing issues?
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

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

    Default Re: Install Connection To Database Failed

    Yes, Zen Cart v1.5.4 is fully compliant with PHP 5.5 ... AND it only uses mysqli_ functions not the deprecated/obsolete mysql_ functions.
    .

    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 Connection to Database failed
    By royaldave in forum Installing on a Linux/Unix Server
    Replies: 15
    Last Post: 22 Jun 2015, 04:38 PM
  2. v150 Database Setup Issue: Connection to Database failed, on iPage
    By tempoart in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 10 Jul 2012, 07:43 AM
  3. "Connection to Database failed" upon install - I think I need database name help
    By jasong1968 in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 30 Nov 2011, 10:50 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