magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.57k stars 9.32k forks source link

[ERROR] exception 'PDOException' with message 'SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'store_website' already exists' #1140

Closed alihalabyah closed 9 years ago

alihalabyah commented 9 years ago

I'm getting the following error however the database I'm using is a new empty one:


Starting Magento installation:
File permissions check...

Enabling Maintenance Mode...

Installing deployment configuration...

Installing database schema:
Schema creation/updates:
Module 'Magento_Store':
Installing schema.. 
[ERROR] exception 'PDOException' with message 'SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'store_website' already exists' in /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/html/magento2/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `s...', Array)
#5 /var/www/html/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(427): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `s...', Array)
#6 /var/www/html/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(1977): Magento\Framework\DB\Adapter\Pdo\Mysql->query('CREATE TABLE `s...')
#7 /var/www/html/magento2/app/code/Magento/Store/Setup/InstallSchema.php(88): Magento\Framework\DB\Adapter\Pdo\Mysql->createTable(Object(Magento\Framework\DB\Ddl\Table))
#8 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(899): Magento\Store\Setup\InstallSchema->install(Object(Magento\Setup\Module\Setup), Object(Magento\Setup\Model\ModuleContext))
#9 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(833): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\Setup), 'schema')
#10 [internal function]: Magento\Setup\Model\Installer->installSchema()
#11 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(329): call_user_func_array(Array, Array)
#12 /var/www/html/magento2/setup/src/Magento/Setup/Controller/Install.php(86): Magento\Setup\Model\Installer->install(Array)
#13 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/Controller/AbstractActionController.php(83): Magento\Setup\Controller\Install->startAction()
#14 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#16 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#19 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#20 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#21 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#22 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#23 /var/www/html/magento2/setup/index.php(25): Zend\Mvc\Application->run()
#24 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'store_website' already exists, query was: CREATE TABLE `store_website` (
`website_id` smallint UNSIGNED NOT NULL auto_increment COMMENT 'Website Id' ,
`code` varchar(32) NULL COMMENT 'Code' ,
`name` varchar(64) NULL COMMENT 'Website Name' ,
`sort_order` smallint UNSIGNED NOT NULL default '0' COMMENT 'Sort Order' ,
`default_group_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Default Group Id' ,
`is_default` smallint UNSIGNED NULL default '0' COMMENT 'Defines Is Website Default' ,
PRIMARY KEY (`website_id`),
UNIQUE `UNQ_STORE_WEBSITE_CODE` (`code`),
INDEX `IDX_STORE_WEBSITE_SORT_ORDER` (`sort_order`),
INDEX `IDX_STORE_WEBSITE_DEFAULT_GROUP_ID` (`default_group_id`)
) COMMENT='Websites' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci' in /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/html/magento2/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#2 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `s...', Array)
#4 /var/www/html/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(427): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `s...', Array)
#5 /var/www/html/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(1977): Magento\Framework\DB\Adapter\Pdo\Mysql->query('CREATE TABLE `s...')
#6 /var/www/html/magento2/app/code/Magento/Store/Setup/InstallSchema.php(88): Magento\Framework\DB\Adapter\Pdo\Mysql->createTable(Object(Magento\Framework\DB\Ddl\Table))
#7 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(899): Magento\Store\Setup\InstallSchema->install(Object(Magento\Setup\Module\Setup), Object(Magento\Setup\Model\ModuleContext))
#8 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(833): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\Setup), 'schema')
#9 [internal function]: Magento\Setup\Model\Installer->installSchema()
#10 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(329): call_user_func_array(Array, Array)
#11 /var/www/html/magento2/setup/src/Magento/Setup/Controller/Install.php(86): Magento\Setup\Model\Installer->install(Array)
#12 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/Controller/AbstractActionController.php(83): Magento\Setup\Controller\Install->startAction()
#13 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#18 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#19 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#20 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#21 /var/www/html/magento2/vendor/zendframework/zend-mvc/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#22 /var/www/html/magento2/setup/index.php(25): Zend\Mvc\Application->run()
#23 {main}
mazhalai commented 9 years ago

Hello @alihalabyah, can you please tell me what Magento version did you get this error on?

alihalabyah commented 9 years ago

@mazhalai it's Version 0.74.0-beta2

mazhalai commented 9 years ago

@alihalabyah Please try clearing your DB and related var\generation and cache folders using the uninstall tool php setup/index.php uninstall and try again.

vpelipenko commented 9 years ago

@alihalabyah, do you still have this issue?

alihalabyah commented 9 years ago

@mazhalai @vpelipenko this issue has been solved, thank you!

ahmadalkaid commented 9 years ago

@alihalabyah , @mazhalai thx guys, I had the same issue.