Forums / Installing on a Windows Server / Database Connection Failure During Install

Database Connection Failure During Install

Views: 9,884

Results 1 to 19 of 19
15 Jan 2012, 8:05 PM
#1
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Database Connection Failure During Install

For the past 12 years I've been running a small non-profit that sells art and crafts created by prisoners (https://www.prisonart.org). I recently suffered a hardware failure and am now in the process rebuilding the site. This is a new install using Zen Cart 1.5 on a Windows Small Business Server 2011, which is located in my home.
PHP 5.3.8 and MySQL 5.5.19 are installed and configured correctly. When I run the Zen Cart install setup feature, however, I get an error on the database connection page. Here are some of the error messages I receive (depending on the value I enter for the host server, database or user name):

1. Connection to Database failed. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
2. Connection to Database failed. No connection could be made because the target machine actively refused it.
3. Connection to Database failed. Access denied for user 'Edward'@'localhost' (using password: YES).
4. Database does not exist. Unknown database 'zencart'
5. Connection to Database failed. php_network_getaddresses: getaddrinfo failed: No such host is known.

I am totally stumped as to why I cannot connect to the database, which is running just fine. Any ideas?
Ed

16 Jan 2012, 11:45 PM
#3
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Database Connection Failure During Install

I've just installed ZC 1.5 on a clean Windows Server. While I had some install issues, these were solved by information contained in another thread in this forum. As instructed by the install process I renamed my admin folder using the procedure for this version (did not modify any config files). When the install was done I accessed the store just fine. But when I tried to access the admin area I received the following error message from Firefox: "WARNING: An Error occurred, please refresh the page and try again." Internet Explorer gives me a different message which boils down to "HTTP 500 Internal Server Error." I was trying to access the admin area using a URL something like this: "http://www.mysite.com/new_admin_name".
Needless to say, without access to the admin area there is not much I can do with the site. Any help would be appreciated.
Ed

16 Jan 2012, 11:46 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Database Connection Failure During Install

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

17 Jan 2012, 12:18 AM
#5
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Database Connection Failure During Install

I checked the log file and get the following message:

[16-Jan-2012 15:42:47] PHP Fatal error: 1364:Field 'gzpost' doesn't have a default value :: insert into admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '0', 'Log found to be empty. Logging started.', '', '192.168.16.2') in C:\PA-Store\includes\classes\db\mysql\query_factory.php on line 101

I can modify the gzpost parameters if I know where to locate the file containing that string. It was in the ZC_install folder under the sql directory in the file named mysql_zencart.sql. But now, per instructions, that the folder has been moved and I'm guessing that making the change there will not make any difference?

17 Jan 2012, 9:37 PM
#6
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Database Connection Failure During Install

When I try to access the admin area using a URL something like this: "http://www.mysite.com/new_admin_name". I received the "An Error occurred, please refresh the page and try again" message. In examining the logs I find that "gzpost' doesn't have a default value". There are two files that contain references to gzpost:

admin_activity.php located in C:\my_store\my_store_new_admin and
init_admin_history.php located in C:\my-store\my_new_store_admin\includes\init_includes

I need to know how to modify one or both of these files in order to provide it or them with a default value it seeks for gzpost?

17 Jan 2012, 9:59 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Database Connection Failure During Install

This seems to be an issue only affecting Windoze installations of MySQL.

You took off the default value of the gz_post field when you did your install. Use phpMyAdmin to add it back to that field, and the problem should go away.

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

19 Jan 2012, 12:15 AM
#8
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Database Connection Failure During Install

Okay, Dr. Byte,
In your last post you suggested I use phpMyAdmin to add the gz_post field that I removed during the install, and that by doing this I should be able to access the admin section of my site.
I've found phpMyAdmin, downloaded it, and figured out how to install it. Now it is up an running but I have no clue as to how to add the gz_post field.
I've checked the documentation, online wiki, etc. but nothing provided me with information on how to add the gz_post field. Any suggestions? I really do want to use version 1.5 of Zen Cart. This should be the last obstacle standing in my way.

19 Jan 2012, 6:27 PM
#9
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Database Connection Failure During Install

When I try to access the admin page on this new Windows install I get a "An Error occurred, please refresh the page and try again" message. With the help of Dr. Byte the issue has been narrowed down to giving the field gz_post a default value (a value that was removed during the install).
Can someone tell me:

1. The location or name of the file that needs the gz_post value, and
2. what that default value is (NULL?).

Thanks,
Ed

19 Jan 2012, 6:30 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Database Connection Failure During Install

*Moderator note: Once again your posts have been merged, to keep on topic. Please don't start multiple threads for the same issue. *

To make a change in phpMyAdmin, log in to phpMyAdmin, open the admin activity log table, find the field you're concerned about, and set a default value of blank.

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

19 Jan 2012, 8:44 PM
#11
quawk avatar

quawk

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Database Connection Failure During Install

Sorry about multiple threads. Your last instructions fixed the problem. Thanks for your help or I'd have never figured it out.

8 Feb 2012, 6:48 PM
#12
john_zyx avatar

john_zyx

New Zenner

Join Date:
Mar 2011
Posts:
1
Plugin Contributions:
0

Re: Database Connection Failure During Install

John http://www.zen-cart.com/forum/images/smilies/sad.gif

I tried using PHPMyAdmin to use NULL as the default on gzpost but I got this;
Error

SQL query:

ALTER TABLE tcf_admin_activity_log CHANGE gzpost gzpost MEDIUMBLOB NOT NULL DEFAULT '''''' <== ''

MySQL said: Documentation
#1101 - BLOB/TEXT column 'gzpost' can't have a default value

MySQL said: Documentation
#1067 - Invalid default value for 'gzpost'

Also looking at the MySQL documentation it clearly indicates
MEDIUMBLOB can not have defaults?!?!?!

BLOB and TEXT columns cannot have DEFAULT values.

http://dev.mysql.com/doc/refman/5.0/en/blob.html

After installing Zen Cart - zen-cart-v150-full-release-12302011

I had to edit mysql_zencart.sql
and remove some "default ''" statements from the Table creation command
Line 121 'page_parameters' and 125 'gzpost'
Otherwise MySQL would not accept the table.

After I got that done, the Zen Cart Tables installed fine.

I attempted to enter the 'admin' and got the following;

[08-Feb-2012 12:42:57 UTC] PHP Fatal error: 1364:Field 'gzpost' doesn't have a default value :: insert into tcf_admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '0', 'Log found to be empty. Logging started.', '', '96.240.27.171') in C:\WEB\TCF\zc\includes\classes\db\mysql\query_factory.php on line 101

Seems Zen Cart has not kept up with MySQL canges.
What version of MySQL should I use to avoid this problem?

Help!?!?!

This is what I have now;

ZenCart, Version 150, release-12/30/2011

MySQL
Server: localhost via TCP/IP
Server version: 5.5.20
Protocol version: 10
User: root@localhost
MySQL charset: UTF-8 Unicode (utf8)

Web server
Microsoft-IIS/6.0
MySQL client version: mysqlnd 5.0.8-dev - 20102224 -

$Revision: 321634 $

phpMyAdmin
Version information: 3.4.9

8 Jun 2012, 1:27 AM
#13
primehalo avatar

primehalo

New Zenner

Join Date:
Jun 2012
Posts:
2
Plugin Contributions:
0

Re: Database Connection Failure During Install

When installing zen-cart-v150-full-release-12302011 on my Windows machine, I also had the PHP Fatal error: 1101:BLOB/TEXT column 'page_parameters' can't have a default value :: CREATE TABLE ... error. I attempted to fix it through advice in other posts, but the fix wasn't quite correct as I also encountered this error upon trying to enter the admin area:

1364 Field 'gzpost' doesn't have a default value in: [insert into zen_admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '0', 'Log found to be empty. Logging started.', '', '127.0.0.1')]

To fix that I used phpMyAdmin to access the zen_admin_activity_log table and change the gzpost column to allow NULL.

Thus I just wanted to mention here the proper inital fix to the installation error should probably be:

Open: /zc_install/sql/mysql_zencart.sql

Find: (line 121)

page_parameters text default '',

Replace with:

page_parameters text

Find: (line 125)

gzpost mediumblob NOT NULL default '',

Replace with:

 gzpost mediumblob,
8 Jun 2012, 2:52 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Database Connection Failure During Install

Unfortunately it has not been fully fixed universally in any official release as yet.

The Windows implementation of MySQL enforces rules differently than the way the Linux implementation does.

It will be fixed in a release after v1.5.0.

In the meantime it works without error on Linux hosts ... which are more popular and conventional anyway.

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

15 Jun 2012, 3:22 AM
#16
thietke_web avatar

thietke_web

New Zenner

Join Date:
Jun 2012
Posts:
1
Plugin Contributions:
0

Re: Database Connection Failure During Install

Quawk:

I've just installed ZC 1.5 on a clean Windows Server. While I had some install issues, these were solved by information contained in another thread in this forum. As instructed by the install process I renamed my admin folder using the procedure for this version (did not modify any config files). When the install was done I accessed the store just fine. But when I tried to access the admin area I received the following error message from Firefox: "WARNING: An Error occurred, please refresh the page and try again." Internet Explorer gives me a different message which boils down to "HTTP 500 Internal Server Error." I was trying to access the admin area using a URL something like this: "http://www.mysite.com/new_admin_name".
Needless to say, without access to the admin area there thiet ke web is not much I can do with the site. Any help would be appreciated.
Ed

Okay, Dr. Byte,
In your last post you suggested I use phpMyAdmin to add the gz_post field that I removed during the install, and that by doing this I should be able to access the admin section of my site.
I've found phpMyAdmin, downloaded it, and figured out how to install it. Now it is up an running but I have no clue as to how to add the gz_post field.
I've checked the documentation, online wiki, etc. but nothing provided me with information on how to add the gz_post field. Any suggestions? I really do want to use version 1.5 of Zen Cart. This should be the last obstacle standing in my way.

15 Jun 2012, 4:38 PM
#17
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Database Connection Failure During Install

Quoting drbyte's instructions> To make a change in phpMyAdmin, log in to phpMyAdmin, open the admin activity log table, find the field you're concerned about, and set a default value of blank.You should not be adding AA field, but making it's setting null.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

4 Jul 2012, 11:34 PM
#18
bad_kitty_studios avatar

bad_kitty_studios

New Zenner

Join Date:
Aug 2011
Location:
Portland, Oregon
Posts:
20
Plugin Contributions:
0

Re: Database Connection Failure During Install

I would just like to make a note that I installed Zen Cart 1.5 on Linux, not Windows, and it could not connect to the database right after install. The error messages were: "Sorry! There seems to be a problem connecting to our database." and on the admin side it said: "WARNING: An Error occurred, please refresh the page and try again."

I had to go to admin/includes/configure.php and includes/configure.php to update the database information. The information it had in both files was incorrect. If you get the two above message right after you install a fresh version of Zen Cart 1.5 take a look at the configure files and make sure your information is correct.

After saving and re-uploading those files the store works fine!

J. DeForest
Bad Kitty Studios

5 Jul 2012, 4:42 PM
#19
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Database Connection Failure During Install

Bad Kitty Studios:

I would just like to make a note that I installed Zen Cart 1.5 on Linux, not Windows, and it could not connect to the database right after install. The error messages were: "Sorry! There seems to be a problem connecting to our database." and on the admin side it said: "WARNING: An Error occurred, please refresh the page and try again."

I had to go to admin/includes/configure.php and includes/configure.php to update the database information. The information it had in both files was incorrect. If you get the two above message right after you install a fresh version of Zen Cart 1.5 take a look at the configure files and make sure your information is correct.

After saving and re-uploading those files the store works fine!There are really only three ways that the config files could have wound up incorrect.

  1. You failed to read the installation instructions for 1.5.0 and incorrectly edited the config files. (Older versions had the installer edit config files for accuracy.)
  2. You entered the wrong database connection information at installation. (should have created problems at installation, not later)
  3. You copied old config files from another installation. (Generally happens with an upgrade)
    Don't know which you did, but one of those is probably the culprit.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com