# MySQL error upgrading to 4.2

**URL:** <https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [March 1, 2022, 5:29pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867 "2022-03-01T17:29:15Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![cwmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cwmarketing/32/2567_2.png) [@cwmarketing](https://forum.mautic.org/u/cwmarketing)\
**Post date:** [March 1, 2022, 11:48pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/9 "2022-03-01T23:48:27Z")

</div>

> [@mzagmajster](#):
>
> You can triy to drop the index in question manually and then run the migration again

So now I’m getting an error when trying to view a segment because of the missing segment:

`mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'SELECT DATE_FORMAT(t.date_added, '%Y-%m-%d') AS date, COUNT(*) AS count FROM ma_lead_event_log t USE INDEX (ma_IDX_SEARCH) WHERE (t.object = ?) AND (t.bundle = ?) AND (t.action = ?) AND (t.object_id = ?) AND (t.date_added BETWEEN ? AND ?) GROUP BY DATE_FORMAT(t.date_added, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.date_added, '%Y-%m-%d') ASC LIMIT 29' with params ["segment", "lead", "added", "52", "2022-02-01 00:00:00", "2022-03-01 23:59:59"]: SQLSTATE[42000]: Syntax error or access violation: 1176 Key 'ma_IDX_SEARCH' doesn't exist in table 't'" at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 128 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing 'SELECT DATE_FORMAT(t.date_added, '%Y-%m-%d') AS date, COUNT(*) AS count FROM ma_lead_event_log t USE INDEX (ma_IDX_SEARCH) WHERE (t.object = ?) AND (t.bundle = ?) AND (t.action = ?) AND (t.object_id = ?) AND (t.date_added BETWEEN ? AND ?) GROUP BY DATE_FORMAT(t.date_added, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.date_added, '%Y-%m-%d') ASC LIMIT 29' with params [\"segment\", \"lead\", \"added\", \"52\", \"2022-02-01 00:00:00\", \"2022-03-01 23:59:59\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1176 Key 'ma_IDX_SEARCH' doesn't exist in table 't' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128, Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1176 Key 'ma_IDX_SEARCH' doesn't exist in table 't' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1176 Key 'ma_IDX_SEARCH' doesn't exist in table 't' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112)"} []`

How can I re-create this index?

---

_[View the full topic](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867)._
