I am executing magento 2 install command but it show error

Base table not found

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento_saas.store_website' doesn't exist, query was: SELECT main_table.* FROM store_website AS main_table WHERE (main_table.website_id > 0) ORDER BY main_table.sort_order ASC, main_table.name ASC

installation command

php bin/magento setup:install --base-url=http://magento2.com/ --db-host=localhost --db-name=magento_saas --db-user=root --db-password=qwerty321 --admin-firstname=Magento --admin-lastname=User [email protected] --admin-user=admin --admin-password=admin@123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200

  • Make sure db name and details are proper. May 28, 2021 at 8:28
  • I have checked db details are fine May 28, 2021 at 9:03
  • are you trying to install it on top of an existing magento installation?
    – Diana
    May 28, 2021 at 9:22
  • I have got a git repo copy of project with minimum file base in app and composer.json May 28, 2021 at 9:27
  • Try to install with composer or download source file from here magento.com/tech-resources/download and then try to install.
    – Mital Shah
    May 28, 2021 at 9:32

1 Answer 1


Found Solution for issue db need to be clean using --cleanup-database attribute in installation command

php bin/magento setup:install --base-url=http://magento2.com/ --db-host=localhost --db-name=magento_saas --db-user=root --db-password=qwerty321 --admin-firstname=Magento --admin-lastname=User [email protected] --admin-user=admin --admin-password=admin@123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200 --cleanup-database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.