Magento Install Problem + Solution 'sales_flat_quote' already exists

Trying to do a clean install of Magento 1.2.1.2 I kept hitting this SQL error.

Base table or view already exists: 1050 Table ‘sales_flat_quote’ already exists

In the end I opted to manually edit the related install file and add DELETE IF EXISTS statements before each CREATE TABLE statement.

The file in question is located here:

/app/code/core/Mage/Sales/sql/sales_setup

and the problem file is

mysql4-install-0.9.0.php

The solution is to edit the file and add DROP TABLE IF EXISTS statements before each CREATE TABLE statement

eg

DROP TABLE IF EXISTS  `{$installer->getTable('sales_flat_quote')}`;

CREATE TABLE `{$installer->getTable('sales_flat_quote')}` (.....

I have created an issue on their bug tracker here.


Tags: magento installmagento problem