Thread: Database Patch

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Oct 2009
    Posts
    39
    Plugin Contributions
    0

    Default Database Patch

    I'm seeing a lot of people with the same error and haven't seen any solutions. My site says

    "Your database appears to need patching to a higher level. See Admin->Tools->Server Information to review patch levels."

    at the top currently. I have ran zc_install Database Upgrade only twice now and each time I get this:

    "253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
    in:
    [CREATE TABLE counter_history_clean as SELECT * FROM counter_history WHERE 1 GROUP BY startdate COLLATE latin1_general_ci;]"

    Server Information says:

    Zen Cart 1.3.9b
    Database Patch Level: 1.3.8

    How can I get this off my site or upgrade properly?

    Thanks.

  2. #2
    Join Date
    Jan 2010
    Location
    Gilbert, AZ
    Posts
    43
    Plugin Contributions
    0

    Default Re: Database Patch

    I had the same problem. Here are two links discussing this issue.

    http://www.zen-cart.com/forum/showth...=157128&page=2

    http://www.zen-cart.com/forum/showth...ounter+history

    The code discussed on the 2nd link worked for me. Although I would have sworn it was unrelated.

    I hope that helps!

  3. #3
    Join Date
    Jun 2010
    Posts
    6
    Plugin Contributions
    0

    Default Re: Database Patch

    I did the upgrade through fantastico and got this problem. I cant seem to get it fixed either. I ran the ZC_install and it still doesnt work right.

    Also somehow it put a bunch of default adds and headers i need help

  4. #4
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Database Patch

    Quote Originally Posted by 2kredz3 View Post
    I did the upgrade through fantastico and got this problem. I cant seem to get it fixed either. I ran the ZC_install and it still doesnt work right.

    Also somehow it put a bunch of default adds and headers i need help
    NEVER upgrade via Fantastico or other automated piece of server facility.

    See: http://www.zen-cart.com/forum/showthread.php?t=155891

  5. #5
    Join Date
    Oct 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: Database Patch

    completespray - Thanks, but that didn't seem to help me. Just to make sure I followed it correctly here's what I tried. Here's my current/changed counter.php:

    PHP Code:
    if (!defined('IS_ADMIN_FLAG')) {

      die(
    'Illegal Access');

    }

    if (isset(
    $_SESSION['session_counter']) && $_SESSION['session_counter'] == true) {

      
    $session_counter 0;

    } else {

      
    $session_counter 1;

      
    $_SESSION['session_counter'] = true;

    }
    $date_now date('Ymd');
    $sql "insert into " TABLE_COUNTER_HISTORY " (startdate, counter, session_counter) values ('" $date_now "', '1', '1')
            on duplicate key update counter = counter + 1, session_counter = session_counter + " 
    . (int)$session_counter;
    $db->Execute($sql);

    $counter_query "select startdate, counter from " TABLE_COUNTER;
    $counter $db->Execute($counter_query);
    if (
    $counter->RecordCount() <= 0) {
      
    $date_now date('Ymd');
      
    $sql "insert into " TABLE_COUNTER " (startdate, counter) values ('" $date_now "', '1')";
      
    $db->Execute($sql);
      
    $counter_startdate $date_now;
      
    $counter_now 1;
    } else {
      
    $counter_startdate $counter->fields['startdate'];
      
    $counter_now = ($counter->fields['counter'] + 1);
      
    $sql "update " TABLE_COUNTER " set counter = '" $counter_now "'";
      
    $db->Execute($sql);
    }


    $counter_query "select startdate, counter from " TABLE_COUNTER;

    $counter $db->Execute($counter_query);

    if (
    $counter->RecordCount() <= 0) {

      
    $date_now date('Ymd');

      
    $sql "insert into " TABLE_COUNTER " (startdate, counter) values ('" $date_now "', '1')";

      
    $db->Execute($sql);

      
    $counter_startdate $date_now;

      
    $counter_now 1;

    } else {

      
    $counter_startdate $counter->fields['startdate'];

      
    $counter_now = ($counter->fields['counter'] + 1);

      
    $sql "update " TABLE_COUNTER " set counter = '" $counter_now "'";

      
    $db->Execute($sql);

    }



    $counter_startdate_formatted strftime(DATE_FORMAT_LONGmktime(000substr($counter_startdate42), substr($counter_startdate, -2), substr($counter_startdate04))); 
    and I ran this:

    Code:
    DROP TABLE IF EXISTS counter_history;
    CREATE TABLE counter_history (
      startdate char(8) default NULL,
      counter int(12) default NULL,
      session_counter int(12) default NULL,
      PRIMARY KEY  (startdate)
    ) ENGINE=MyISAM;
    in the admin's Install SQL Patches. Then I ran the Upgrade Database in zc_install. Still got this:

    1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
    in:
    [CREATE TABLE counter_history_clean as SELECT * FROM counter_history WHERE 1 GROUP BY startdate COLLATE latin1_general_ci;]

    Admin still says Zen Cart 1.3.9b
    Database Patch Level: 1.3.8

    but when I ran the zc_install it says Database appears to be Zen Cart™ v1.3.9.

    Do I need to upgrade Zen Cart?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Database Patch

    Quote Originally Posted by buzzfever View Post
    1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
    Evidently you've created the table with UTF8 character set. If that's what you want to continue using, then change the DB_CHARSET in /zc_install/includes/installer_params.php to 'utf8' before using zc_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.

  7. #7
    Join Date
    Jun 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: Database Patch

    Quote Originally Posted by DrByte View Post
    Evidently you've created the table with UTF8 character set. If that's what you want to continue using, then change the DB_CHARSET in /zc_install/includes/installer_params.php to 'utf8' before using zc_install.
    Thank you DrByte! That worked for me, and I'm sure it would work for anyone else getting that same error. You saved me from doing a fresh install of my site.

  8. #8
    Join Date
    Oct 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: Database Patch

    OH MY GOSH, DrByte you are amazing! Thank you so much for your time and help. I can't believe it was so simple.

  9. #9
    Join Date
    Sep 2007
    Posts
    24
    Plugin Contributions
    0

    Default Re: Database Patch

    Quote Originally Posted by DrByte View Post
    Evidently you've created the table with UTF8 character set. If that's what you want to continue using, then change the DB_CHARSET in /zc_install/includes/installer_params.php to 'utf8' before using zc_install.
    Thank you! A very easy fix.

  10. #10
    Join Date
    Mar 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Database Patch

    Quote Originally Posted by DrByte View Post
    Evidently you've created the table with UTF8 character set. If that's what you want to continue using, then change the DB_CHARSET in /zc_install/includes/installer_params.php to 'utf8' before using zc_install.
    Thanks Heaps!!

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. 1.3.8 Database Patch Level: 1.3.9f ??
    By stefanl in forum Upgrading from 1.3.x to 1.3.9
    Replies: 9
    Last Post: 16 Sep 2010, 05:02 PM
  2. Replies: 15
    Last Post: 2 Oct 2009, 11:45 AM
  3. Database patch
    By Dihen in forum General Questions
    Replies: 1
    Last Post: 9 Jun 2008, 02:13 PM
  4. Database Patch
    By innocentyole in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 9 Jun 2008, 08:46 AM

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