cancel
Showing results for 
Search instead for 
Did you mean: 

Fresh Magento 1.9.2 install error: SQLSTATE[23000]

SOLVED

Fresh Magento 1.9.2 install error: SQLSTATE[23000]

Hi there,

 

I'm trying to install a fresh version of Magento 1.9.2, and I keep running into an error after entering my database details. The first error I got was as follows

 

a:5:{i:0;s:10802:"Error in file: "/home/dragonfieldsport/public_html/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sales_flat_order' already exists, query was: CREATE TABLE `sales_flat_order` (
  `entity_id` int UNSIGNED NOT NULL auto_increment COMMENT 'Entity Id' ,
  `state` varchar(32) NULL COMMENT 'State' ,
  `status` varchar(32) NULL COMMENT 'Status' ,
  `coupon_code` varchar(255) NULL COMMENT 'Coupon Code' ,
  `protect_code` varchar(255) NULL COMMENT 'Protect Code' ,
  `shipping_description` varchar(255) NULL COMMENT 'Shipping Description' ,
  `is_virtual` smallint UNSIGNED NULL COMMENT 'Is Virtual' ,
  `store_id` smallint UNSIGNED NULL COMMENT 'Store Id' ,
  `customer_id` int UNSIGNED NULL COMMENT 'Customer Id' ,
  `base_discount_amount` decimal(12,4) NULL COMMENT 'Base Discount Amount' ,
  `base_discount_canceled` decimal(12,4) NULL COMMENT 'Base Discount Canceled' ,
  `base_discount_invoiced` decimal(12,4) NULL COMMENT 'Base Discount Invoiced' ,
  `base_discount_refunded` decimal(12,4) NULL COMMENT 'Base Discount Refunded' ,
  `base_grand_total` decimal(12,4) NULL COMMENT 'Base Grand Total' ,
  `base_shipping_amount` decimal(12,4) NULL COMMENT 'Base Shipping Amount' ,
  `base_shipping_canceled` decimal(12,4) NULL COMMENT 'Base Shipping Canceled' ,
  `base_shipping_invoiced` decimal(12,4) NULL COMMENT 'Base Shipping Invoiced' ,
  `base_shipping_refunded` decimal(12,4) NULL COMMENT 'Base Shipping Refunded' ,
  `base_shipping_tax_amount` decimal(12,4) NULL COMMENT 'Base Shipping Tax Amount' ,
  `base_shipping_tax_refunded` decimal(12,4) NULL COMMENT 'Base Shipping Tax Refunded' ,
  `base_subtotal` decimal(12,4) NULL COMMENT 'Base Subtotal' ,
  `base_subtotal_canceled` decimal(12,4) NULL COMMENT 'Base Subtotal Canceled' ,
  `base_subtotal_invoiced` decimal(12,4) NULL COMMENT 'Base Subtotal Invoiced' ,
  `base_subtotal_refunded` decimal(12,4) NULL COMMENT 'Base Subtotal Refunded' ,
  `base_tax_amount` decimal(12,4) NULL COMMENT 'Base Tax Amount' ,
  `base_tax_canceled` decimal(12,4) NULL COMMENT 'Base Tax Canceled' ,
  `base_tax_invoiced` decimal(12,4) NULL COMMENT 'Base Tax Invoiced' ,
  `base_tax_refunded` decimal(12,4) NULL COMMENT 'Base Tax Refunded' ,
  `base_to_global_rate` decimal(12,4) NULL COMMENT 'Base To Global Rate' ,
  `base_to_order_rate` decimal(12,4) NULL COMMENT 'Base To Order Rate' ,
  `base_total_canceled` decimal(12,4) NULL COMMENT 'Base Total Canceled' ,
  `base_total_invoiced` decimal(12,4) NULL COMMENT 'Base Total Invoiced' ,
  `base_total_invoiced_cost` decimal(12,4) NULL COMMENT 'Base Total Invoiced Cost' ,
  `base_total_offline_refunded` decimal(12,4) NULL COMMENT 'Base Total Offline Refunded' ,
  `base_total_online_refunded` decimal(12,4) NULL COMMENT 'Base Total Online Refunded' ,
  `base_total_paid` decimal(12,4) NULL COMMENT 'Base Total Paid' ,
  `base_total_qty_ordered` decimal(12,4) NULL COMMENT 'Base Total Qty Ordered' ,
  `base_total_refunded` decimal(12,4) NULL COMMENT 'Base Total Refunded' ,
  `discount_amount` decimal(12,4) NULL COMMENT 'Discount Amount' ,
  `discount_canceled` decimal(12,4) NULL COMMENT 'Discount Canceled' ,
  `discount_invoiced` decimal(12,4) NULL COMMENT 'Discount Invoiced' ,
  `discount_refunded` decimal(12,4) NULL COMMENT 'Discount Refunded' ,
  `grand_total` decimal(12,4) NULL COMMENT 'Grand Total' ,
  `shipping_amount` decimal(12,4) NULL COMMENT 'Shipping Amount' ,
  `shipping_canceled` decimal(12,4) NULL COMMENT 'Shipping Canceled' ,
  `shipping_invoiced` decimal(12,4) NULL COMMENT 'Shipping Invoiced' ,
  `shipping_refunded` decimal(12,4) NULL COMMENT 'Shipping Refunded' ,
  `shipping_tax_amount` decimal(12,4) NULL COMMENT 'Shipping Tax Amount' ,
  `shipping_tax_refunded` decimal(12,4) NULL COMMENT 'Shipping Tax Refunded' ,
  `store_to_base_rate` decimal(12,4) NULL COMMENT 'Store To Base Rate' ,
  `store_to_order_rate` decimal(12,4) NULL COMMENT 'Store To Order Rate' ,
  `subtotal` decimal(12,4) NULL COMMENT 'Subtotal' ,
  `subtotal_canceled` decimal(12,4) NULL COMMENT 'Subtotal Canceled' ,
  `subtotal_invoiced` decimal(12,4) NULL COMMENT 'Subtotal Invoiced' ,
  `subtotal_refunded` decimal(12,4) NULL COMMENT 'Subtotal Refunded' ,
  `tax_amount` decimal(12,4) NULL COMMENT 'Tax Amount' ,
  `tax_canceled` decimal(12,4) NULL COMMENT 'Tax Canceled' ,
  `tax_invoiced` decimal(12,4) NULL COMMENT 'Tax Invoiced' ,
  `tax_refunded` decimal(12,4) NULL COMMENT 'Tax Refunded' ,
  `total_canceled` decimal(12,4) NULL COMMENT 'Total Canceled' ,
  `total_invoiced` decimal(12,4) NULL COMMENT 'Total Invoiced' ,
  `total_offline_refunded` decimal(12,4) NULL COMMENT 'Total Offline Refunded' ,
  `total_online_refunded` decimal(12,4) NULL COMMENT 'Total Online Refunded' ,
  `total_paid` decimal(12,4) NULL COMMENT 'Total Paid' ,
  `total_qty_ordered` decimal(12,4) NULL COMMENT 'Total Qty Ordered' ,
  `total_refunded` decimal(12,4) NULL COMMENT 'Total Refunded' ,
  `can_ship_partially` smallint UNSIGNED NULL COMMENT 'Can Ship Partially' ,
  `can_ship_partially_item` smallint UNSIGNED NULL COMMENT 'Can Ship Partially Item' ,
  `customer_is_guest` smallint UNSIGNED NULL COMMENT 'Customer Is Guest' ,
  `customer_note_notify` smallint UNSIGNED NULL COMMENT 'Customer Note Notify' ,
  `billing_address_id` int NULL COMMENT 'Billing Address Id' ,
  `customer_group_id` smallint NULL COMMENT 'Customer Group Id' ,
  `edit_increment` int NULL COMMENT 'Edit Increment' ,
  `email_sent` smallint UNSIGNED NULL COMMENT 'Email Sent' ,
  `forced_shipment_with_invoice` smallint UNSIGNED NULL COMMENT 'Forced Do Shipment With Invoice' ,
  `payment_auth_expiration` int NULL COMMENT 'Payment Authorization Expiration' ,
  `quote_address_id` int NULL COMMENT 'Quote Address Id' ,
  `quote_id` int NULL COMMENT 'Quote Id' ,
  `shipping_address_id` int NULL COMMENT 'Shipping Address Id' ,
  `adjustment_negative` decimal(12,4) NULL COMMENT 'Adjustment Negative' ,
  `adjustment_positive` decimal(12,4) NULL COMMENT 'Adjustment Positive' ,
  `base_adjustment_negative` decimal(12,4) NULL COMMENT 'Base Adjustment Negative' ,
  `base_adjustment_positive` decimal(12,4) NULL COMMENT 'Base Adjustment Positive' ,
  `base_shipping_discount_amount` decimal(12,4) NULL COMMENT 'Base Shipping Discount Amount' ,
  `base_subtotal_incl_tax` decimal(12,4) NULL COMMENT 'Base Subtotal Incl Tax' ,
  `base_total_due` decimal(12,4) NULL COMMENT 'Base Total Due' ,
  `payment_authorization_amount` decimal(12,4) NULL COMMENT 'Payment Authorization Amount' ,
  `shipping_discount_amount` decimal(12,4) NULL COMMENT 'Shipping Discount Amount' ,
  `subtotal_incl_tax` decimal(12,4) NULL COMMENT 'Subtotal Incl Tax' ,
  `total_due` decimal(12,4) NULL COMMENT 'Total Due' ,
  `weight` decimal(12,4) NULL COMMENT 'Weight' ,
  `customer_dob` datetime NULL COMMENT 'Customer Dob' ,
  `increment_id` varchar(50) NULL COMMENT 'Increment Id' ,
  `applied_rule_ids` varchar(255) NULL COMMENT 'Applied Rule Ids' ,
  `base_currency_code` varchar(3) NULL COMMENT 'Base Currency Code' ,
  `customer_email` varchar(255) NULL COMMENT 'Customer Email' ,
  `customer_firstname` varchar(255) NULL COMMENT 'Customer Firstname' ,
  `customer_lastname` varchar(255) NULL COMMENT 'Customer Lastname' ,
  `customer_middlename` varchar(255) NULL COMMENT 'Customer Middlename' ,
  `customer_prefix` varchar(255) NULL COMMENT 'Customer Prefix' ,
  `customer_suffix` varchar(255) NULL COMMENT 'Customer Suffix' ,
  `customer_taxvat` varchar(255) NULL COMMENT 'Customer Taxvat' ,
  `discount_description` varchar(255) NULL COMMENT 'Discount Description' ,
  `ext_customer_id` varchar(255) NULL COMMENT 'Ext Customer Id' ,
  `ext_order_id` varchar(255) NULL COMMENT 'Ext Order Id' ,
  `global_currency_code` varchar(3) NULL COMMENT 'Global Currency Code' ,
  `hold_before_state` varchar(255) NULL COMMENT 'Hold Before State' ,
  `hold_before_status` varchar(255) NULL COMMENT 'Hold Before Status' ,
  `order_currency_code` varchar(255) NULL COMMENT 'Order Currency Code' ,
  `original_increment_id` varchar(50) NULL COMMENT 'Original Increment Id' ,
  `relation_child_id` varchar(32) NULL COMMENT 'Relation Child Id' ,
  `relation_child_real_id` varchar(32) NULL COMMENT 'Relation Child Real Id' ,
  `relation_parent_id` varchar(32) NULL COMMENT 'Relation Parent Id' ,
  `relation_parent_real_id` varchar(32) NULL COMMENT 'Relation Parent Real Id' ,
  `remote_ip` varchar(255) NULL COMMENT 'Remote Ip' ,
  `shipping_method` varchar(255) NULL COMMENT 'Shipping Method' ,
  `store_currency_code` varchar(3) NULL COMMENT 'Store Currency Code' ,
  `store_name` varchar(255) NULL COMMENT 'Store Name' ,
  `x_forwarded_for` varchar(255) NULL COMMENT 'X Forwarded For' ,
  `customer_note` text NULL COMMENT 'Customer Note' ,
  `created_at` timestamp NULL default NULL COMMENT 'Created At' ,
  `updated_at` timestamp NULL default NULL COMMENT 'Updated At' ,
  `total_item_count` smallint UNSIGNED NOT NULL default '0' COMMENT 'Total Item Count' ,
  `customer_gender` int NULL COMMENT 'Customer Gender' ,
  `hidden_tax_amount` decimal(12,4) NULL COMMENT 'Hidden Tax Amount' ,
  `base_hidden_tax_amount` decimal(12,4) NULL COMMENT 'Base Hidden Tax Amount' ,
  `shipping_hidden_tax_amount` decimal(12,4) NULL COMMENT 'Shipping Hidden Tax Amount' ,
  `base_shipping_hidden_tax_amnt` decimal(12,4) NULL COMMENT 'Base Shipping Hidden Tax Amount' ,
  `hidden_tax_invoiced` decimal(12,4) NULL COMMENT 'Hidden Tax Invoiced' ,
  `base_hidden_tax_invoiced` decimal(12,4) NULL COMMENT 'Base Hidden Tax Invoiced' ,
  `hidden_tax_refunded` decimal(12,4) NULL COMMENT 'Hidden Tax Refunded' ,
  `base_hidden_tax_refunded` decimal(12,4) NULL COMMENT 'Base Hidden Tax Refunded' ,
  `shipping_incl_tax` decimal(12,4) NULL COMMENT 'Shipping Incl Tax' ,
  `base_shipping_incl_tax` decimal(12,4) NULL COMMENT 'Base Shipping Incl Tax' ,
  PRIMARY KEY (`entity_id`),
  INDEX `IDX_SALES_FLAT_ORDER_STATUS` (`status`),
  INDEX `IDX_SALES_FLAT_ORDER_STATE` (`state`),
  INDEX `IDX_SALES_FLAT_ORDER_STORE_ID` (`store_id`),
  UNIQUE `UNQ_SALES_FLAT_ORDER_INCREMENT_ID` (`increment_id`),
  INDEX `IDX_SALES_FLAT_ORDER_CREATED_AT` (`created_at`),
  INDEX `IDX_SALES_FLAT_ORDER_CUSTOMER_ID` (`customer_id`),
  INDEX `IDX_SALES_FLAT_ORDER_EXT_ORDER_ID` (`ext_order_id`),
  INDEX `IDX_SALES_FLAT_ORDER_QUOTE_ID` (`quote_id`),
  INDEX `IDX_SALES_FLAT_ORDER_UPDATED_AT` (`updated_at`),
  CONSTRAINT `FK_SALES_FLAT_ORDER_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `FK_SALES_FLAT_ORDER_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) COMMENT='Sales Flat Order' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci";i:1;s:1032:"#0 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.9')
#2 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.9')
#3 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /home/dragonfieldsport/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/dragonfieldsport/public_html/index.php(83): Mage::run('', 'store')
#8 {main}";s:3:"url";s:36:"/index.php/install/wizard/installDb/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I've search around on various forums, and tried deleting the tables in question, or deleting the whole database and site files, and starting again, but I keep getting stuck on the same issue. After running the install script again I get stuck on the following error

 

a:5:{i:0;s:3016:"Error in file: "/home/dragonfieldsport/public_html/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'AD' for key 'PRIMARY', query was: INSERT INTO `directory_country` (`country_id`,`iso2_code`,`iso3_code`) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)";i:1;s:921:"#0 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(391): Mage_Core_Model_Resource_Setup->_modifyResourceDb('data-install', '', '1.6.0.3')
#2 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(289): Mage_Core_Model_Resource_Setup->_installData('1.6.0.3')
#3 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(269): Mage_Core_Model_Resource_Setup->applyDataUpdates()
#4 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/App.php(362): Mage_Core_Model_Resource_Setup::applyAllDataUpdates()
#5 /home/dragonfieldsport/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home/dragonfieldsport/public_html/index.php(83): Mage::run('', 'store')
#7 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Can anyone help me work out what might be causing this problem?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

FYI - the only script which will run for the checkout module is install-1.6.0.0.php.

 

It seems like the install is timing out. If you are installing using the browser-based wizard, what are your PHP execution time settings? You mention that you've successfully installed Magento on this same server before; what is the latest version which successfuly installed?

-----
@benmarks, Senior Manager, Strategy & Growth

View solution in original post

10 REPLIES 10

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

Yeah this is really pissing me off, I tried install the quickstart that came with my theme get the error, I tried installing just magento 1.9.2 by downloading the files and uploading it to the server got the error, tried using the downloader got the error, everything I do I get the same error, Ive deleted the databases made fresh ones and each time it keeps coming up with the error, proper pissing me off.

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

just drop your database, create it again and install magento...

Base table or view already exists: 1050 Table 'sales_flat_order' already exists, query was: CREATE TABLE `sales_flat_order`

 

------------
MagenX - Magento and Server optimization

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

I've tried dropping the database and rerunning a fresh install, but it keep running into the same problem.

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

As far as I can tell, these are the only two instances of this happening; however, there have been similar issues in the past and there are a couple of things you can try here:

 

  1. Make sure your MySQL server has InnoDB support enabled. 

  2. Let me emphasize it is NOT recommended to edit core code. However, since this is for a fresh install, you can try to the following. Edit your /app/code/core/Mage/Sales/sql/sales_setup/mysql4-install-1.4.0.0.php file on line 32 to add a
    DROP TABLE IF EXISTS  `{$installer->getTable('sales_flat_order')}`;
    statement before 
    CREATE TABLE `{$installer->getTable('sales_flat_order')}` (
    as well as /app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php and again add the DROP TABLE statement on line 53 before the CREATE TABLE line.

Let me know if either of those work for you!

--

Developer Relations, Adobe Experience Cloud
Problem solved? Click Accept as Solution!
Still stuck? Check out our documentation: https://magento.com/resources/technical

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

Hi Sherrie,

 

Thanks for your suggestions!

 

1. InnoDB support is enabled on my server, but it's not the default engine, so could this possibly be the issue? It would be strange if it was however, as I've installed Magento on this server before without having this issue...

 

2. I tried adding the code you recommended - so the install seems to have made it past the 'sales_flat_order' table creation, but now has a similar error with the table 'checkout_agreement'. (error included at the bottom)

 

I had a look in /app/code/core/Mage/Checkout/sql/checkout_setup/ to see if I could do something similar to what you suggested with the previous 'sales_flat_order' table, and modified the files mysql4-install-0.9.1php, and mysql4-upgrade-0.9.0-0.9.1.php to drop the 'checkout_agreement' table if it exists. However I'm still getting the same error.

 

The error is being reported in the install-1.6.0.0.php file in the directory, but it doesn't look like there's similar code there to make this change... although I somewhat suspect that if I do, it'll just move the problem on to the next table to be created.

 

Any other ideas??

 

 

 

a:5:{i:0;s:790:"Error in file: "/home/dragonfieldsport/public_html/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'checkout_agreement' already exists, query was: CREATE TABLE `checkout_agreement` (
  `agreement_id` int UNSIGNED NOT NULL auto_increment COMMENT 'Agreement Id' ,
  `name` varchar(255) NULL COMMENT 'Name' ,
  `content` text NULL COMMENT 'Content' ,
  `content_height` varchar(25) NULL COMMENT 'Content Height' ,
  `checkbox_text` text NULL COMMENT 'Checkbox Text' ,
  `is_active` smallint NOT NULL default '0' COMMENT 'Is Active' ,
  `is_html` smallint NOT NULL default '0' COMMENT 'Is Html' ,
  PRIMARY KEY (`agreement_id`)
) COMMENT='Checkout Agreement' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci";i:1;s:1032:"#0 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.0')
#2 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.0')
#3 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/dragonfieldsport/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /home/dragonfieldsport/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/dragonfieldsport/public_html/index.php(83): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

 

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

Hi @RobertMulvaney, if you've installed it on that server before without having the issue, then you're right, it shouldn't be the InnoDB. You could try adding a similar statement in mysql4-install-0.9.1php and mysql4-upgrade-0.9.0-0.9.1.php to drop the checkout_agreement table, but you're right, you may just end in a loop. 

 

Have you tried installing 1.9.2 with sample data? I'm curious if everything runs fine on your server with the sample data installed since I'm unable to reproduce your error on my end. 

--

Developer Relations, Adobe Experience Cloud
Problem solved? Click Accept as Solution!
Still stuck? Check out our documentation: https://magento.com/resources/technical

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

Hi @sherrie 

 

I tried modifying those files to drop the table, but that didn't seem to get me past this table creation. It may be that I was doing something wrong though, so I could go back and check that, but in the mean time I've just installed Magento with the sample data and that works fine, I get through the installation steps and can navigate around the front and backend of site.

 

So it seems it's just without it that I'm having a problem... not sure if this gives you any clues as to what the issue might be?

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

FYI - the only script which will run for the checkout module is install-1.6.0.0.php.

 

It seems like the install is timing out. If you are installing using the browser-based wizard, what are your PHP execution time settings? You mention that you've successfully installed Magento on this same server before; what is the latest version which successfuly installed?

-----
@benmarks, Senior Manager, Strategy & Growth

Re: Fresh Magento 1.9.2 install error: SQLSTATE[23000]

Hi @Ben Marks

 

Thanks for you help - you were on the right track with the install timing out.

 

I'd tried increasing the php max execution time for my server already without success, but it seems like there is a seperate timout for the FCGI PHP handler, and after increasing that the install went through fine.

 

Regarding previous versions - the latest version I had previously installed was 1.9.1.0, however we were using a different PHP handler when I did that, so I guess that's why it wasn't an issue previously.

 

Cheers!

 

Rob