Table ‘zen_whos_online’ is marked as crashed

By Melanie Prough on Tuesday, January 5, 2010
Filed Under: Zen Cart Tips












Seen this error in your Zen Cart store?

It has yet to be determined if this is a true Zen Cart bug, most likely an SQL upgrade issue with your hosting environment. However, if you get this error, the steps below can be used to resolve it and restore your store’s functionality.

Level 1 (Best and easiest) – Use your hosting control panel to select and repair your database.

Level 2 (Moderately simple) – In PHPMyAdmin run the following command in the SQL tab. Remember to change your prefix to match your own database prefix.

repair table prefix_whos_online

Level 3 (Advanced) – You can drop and reset this table in your Zen Cart admin (if you can access Tools >> Install SQL Patches).

DROP TABLE IF EXISTS whos_online;
CREATE TABLE whos_online (
customer_id int(11) default NULL,
full_name varchar(64) NOT NULL default ”,
session_id varchar(128) NOT NULL default ”,
ip_address varchar(15) NOT NULL default ”,
time_entry varchar(14) NOT NULL default ”,
time_last_click varchar(14) NOT NULL default ”,
last_page_url varchar(255) NOT NULL default ”,
host_address text NOT NULL,
user_agent varchar(255) NOT NULL default ”,
KEY idx_ip_address_zen (ip_address),
KEY idx_session_id_zen (session_id),
KEY idx_customer_id_zen (customer_id),
KEY idx_time_entry_zen (time_entry),
KEY idx_time_last_click_zen (time_last_click),
KEY idx_last_page_url_zen (last_page_url)
) TYPE=MyISAM;

*** IF you cannot access this function in your Zen cart admin, the following SQL can be run in PHPMyAdmin after adjusting the prefix to match your own.

DROP TABLE IF EXISTS prefix_whos_online;
CREATE TABLE prefix_whos_online (
customer_id int(11) default NULL,
full_name varchar(64) NOT NULL default ”,
session_id varchar(128) NOT NULL default ”,
ip_address varchar(15) NOT NULL default ”,
time_entry varchar(14) NOT NULL default ”,
time_last_click varchar(14) NOT NULL default ”,
last_page_url varchar(255) NOT NULL default ”,
host_address text NOT NULL,
user_agent varchar(255) NOT NULL default ”,
KEY idx_ip_address_zen (ip_address),
KEY idx_session_id_zen (session_id),
KEY idx_customer_id_zen (customer_id),
KEY idx_time_entry_zen (time_entry),
KEY idx_time_last_click_zen (time_last_click),
KEY idx_last_page_url_zen (last_page_url)
) TYPE=MyISAM;

I have not seen this crash on any current customer’s shops…. So it is a fairly logical assumption that the weekly database optimization and periodic checksums we complete keep this at bay.

To optimize your database in your Zen Cart admin go to Tools >> Store Manager and click the “Optimize Database” button during a non busy time in your store.

Checksums are important, and very useful, many reasons. Including:

  • Checking that replicated/clustered databases are in sync
  • Checking that data is properly restored from backup
  • Ensuring that recovery processes did not fail, or hit a bug
  • Checking integrity of the database (for example, to see if the file has changed)

Checksumming is going to be on the advanced side and require a tool to do so. Most in shared hosting environment will not be able/allowed to run a tool such as http://mysqltuner.com/mysqltuner.pl to accomplish this.

Tags: , , , , , , , , , , ,

Comments are closed.

Template Original