Magento shopping cart errors

Started by Administrator, March 26, 2014, 07:35:40 PM

Previous topic - Next topic

Administrator

Hi Members,

Recently, I have had this strange issue where one of the table under the database was missing. Here is the error which kept flashing on the website.

QuoteSQLSTATE[42S02]: Base table or view not found: 1146 Table '.log_visitor' doesn't exist

I was fortunate that the backups were configured & I restored the database table. But, what if you do not have the backup ? Below is the SQL query you should execute to fix it.

Access phpMyAdmin and select the database. Click on the SQL tab and enter the query below under Run SQL query/queries on database

QuoteCREATE TABLE IF NOT EXISTS `log_visitor` (
  `visitor_id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Visitor ID',
  `visitor_type` varchar(1) NOT NULL COMMENT 'Visitor Type',
  `remote_addr` bigint(20) NOT NULL COMMENT 'Remote Address',
  `first_visit_at` timestamp NULL default NULL COMMENT 'First Visit Time',
  `last_visit_at` timestamp NULL default NULL COMMENT 'Last Visit Time',
  `customer_id` int(10) unsigned default NULL COMMENT 'Customer ID',
  `last_url` varchar(255) default NULL COMMENT 'Last URL',
  PRIMARY KEY  (`visitor_id`),
  KEY `IDX_LOG_VISITOR_ONLINE_VISITOR_TYPE` (`visitor_type`),
  KEY `IDX_LOG_VISITOR_ONLINE_FIRST_VISIT_AT_LAST_VISIT_AT` (`first_visit_at`,`last_visit_at`),
  KEY `IDX_LOG_VISITOR_ONLINE_CUSTOMER_ID` (`customer_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Log Visitor Online Table'

Click on Go and you table gets created. You should be able to access the website now.

Now that's the reason we say backup plans are important. They come handy if you land in such a mess.

QuoteLooking for quality Magento hosting? Look no further than MilesWeb Magento Hosting.
MilesWeb - Your Hosting, Our Responsibility!
Buy Web Hosting Plans | Managed VPS with 50% Discount