# Base table or view not found

**URL:** <https://forum.mautic.org/t/base-table-or-view-not-found/3926>\
**Category:** Product Support\
**Created:** [July 6, 2016, 5:47pm UTC](https://forum.mautic.org/t/base-table-or-view-not-found/3926 "2016-07-06T17:47:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsadnick](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@dsadnick](https://forum.mautic.org/u/dsadnick)\
**Post date:** [July 6, 2016, 5:47pm UTC](https://forum.mautic.org/t/base-table-or-view-not-found/3926/1 "2016-07-06T17:47:39Z")

</div>

Im trying to Install Mautic 2.0 and during the DB setup process I keep getting this error,  
  
  
  
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mauticbd.lead\_fields’ doesn’t exist  
  
  
  
Any ideas how to fix this?

---

<div class="post-metadata">

**Author:** ![dsadnick](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@dsadnick](https://forum.mautic.org/u/dsadnick)\
**Post date:** [July 6, 2016, 7:22pm UTC](https://forum.mautic.org/t/base-table-or-view-not-found/3926/2 "2016-07-06T19:22:24Z")

</div>

Clean Install.

---

<div class="post-metadata">

**Author:** ![dsadnick](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@dsadnick](https://forum.mautic.org/u/dsadnick)\
**Post date:** [July 6, 2016, 5:47pm UTC](https://forum.mautic.org/t/base-table-or-view-not-found/3926/3 "2016-07-06T17:47:39Z")

</div>

Im trying to Install Mautic 2.0 and during the DB setup process I keep getting this error,

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mauticbd.lead\_fields’ doesn’t exist

Any ideas how to fix this?

---

<div class="post-metadata">

**Author:** ![glen206](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@glen206](https://forum.mautic.org/u/glen206)\
**Post date:** [August 15, 2016, 1:53pm UTC](https://forum.mautic.org/t/base-table-or-view-not-found/3926/4 "2016-08-15T13:53:47Z")

</div>

I get a similar error after I did an upgrade from 2.0.1 to 2.1 through the web interface. I am running php 7.0.9

[2016-08-15 14:18:54] mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionTableNotFoundException: “An exception occurred while executing ‘SELECT es.id as id, es.device as device FROM lead\_devices es WHERE es.lead\_id = 1119’: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.lead\_devices’ doesn’t exist” at /directory/to/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 53 {“exception”:"[object] (Doctrine\DBAL\Exception\TableNotFoundException(code: 0): An exception occurred while executing ‘SELECT es.id as id, es.device as device FROM lead\_devices es WHERE es.lead\_id = 1119’:nnSQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.lead\_devices’ doesn’t exist at /directory/to/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:53, Doctrine\DBAL\Driver\PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.lead\_devices’ doesn’t exist at /directory/to/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.lead\_devices’ doesn’t exist at /directory/to/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104)"} []

---

<div class="post-metadata">

**Author:** ![glen206](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@glen206](https://forum.mautic.org/u/glen206)\
**Post date:** [August 15, 2016, 3:48pm UTC](https://forum.mautic.org/t/base-table-or-view-not-found/3926/5 "2016-08-15T15:48:51Z")

</div>

Looking through the documentation I failed to update the database schema. I did this with the following command after which everything is working so far:

$ php app/console doctrine:migrations:migrate --env=prod

reference:  
[https://github.com/mautic/mautic](https://github.com/mautic/mautic)
