# 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:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![patrickeidemiller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/patrickeidemiller/32/511_2.png) [@patrickeidemiller](https://forum.mautic.org/u/patrickeidemiller)\
**Post date:** [March 11, 2022, 5:54am UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/21 "2022-03-11T05:54:36Z")

</div>

> [@cwmarketing](#):
>
> hp bin/console doctrine:migration

I ran into a similar issue going from 4.1.x to 4.2. on MariaDB

The process failed at bin/console mautic:update:apply.

The log indicated :Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: "An exception occurred while executing ‘ALTER TABLE `maup6_lead_event_log` RENAME INDEX `IDX_SEARCH` TO `maup6_IDX_SEARCH`’:

I manually created maup6\_IDX\_SEARCH using the same values as IDX\_SEARCH, then deleted IDX\_SEARCH.

I then reran at received a new error:

console.CRITICAL: Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: “An exception occurred while executing ‘ALTER TABLE `maup6_email_stats` CHANGE COLUMN `tokens` `tokens` LONGTEXT CHARACTER SET ‘utf8mb4’ COLLATE ‘utf8mb4\_unicode\_ci’ NULL DEFAULT NULL COMMENT ‘(DC2Type:array)’;’: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘`danianim_maut458`.`parcr`.`date_sent`’ in ‘GENERATED ALWAYS’” {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0):

Reran apply and received the happy congratulations 4.2 message, but the site 403s.

 ![SS 2022-03-10 at 9.01.55 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2c13b8016800d9b69d965cb6fb6b9b82b328b3ec.png)

then ran the dump sql script that returned 155 updates:

 ![SS 2022-03-10 at 9.50.30 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ad680420a2ef9c631fe0902b1265d0a5fdb7d892.png)

Took a back up, then ran the same script with --force which returned the FK errors above.

Not sure why my db is so far out of wack as every previous upgrade as executed successfully.

I can start stepping thru each update and debugging, but not sure that’s best approach.

---

<div class="post-metadata">

**Author:** ![patrickeidemiller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/patrickeidemiller/32/511_2.png) [@patrickeidemiller](https://forum.mautic.org/u/patrickeidemiller)\
**Post date:** [March 12, 2022, 7:11pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/22 "2022-03-12T19:11:28Z")

</div>

Solved with commenting out

```auto
    <FilesMatch "\.php$">
        Require all denied
    </FilesMatch>

```

per this: [403 Error after Mautic 3.3.5 update - #5 by rcheesley](https://forum.mautic.org/t/403-error-after-mautic-3-3-5-update/22859/5)

---

<div class="post-metadata">

**Author:** ![modifiedcontent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/modifiedcontent/32/511_2.png) [@modifiedcontent](https://forum.mautic.org/u/modifiedcontent)\
**Post date:** [May 21, 2022, 3:12pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/23 "2022-05-21T15:12:11Z")

</div>

Where did you “solve” this @patrickeidemiller? Where did you “comment out” these lines? Looks like .htaccess. How is this connected with the SQL error?

I have the [exact same problem](https://forum.mautic.org/t/as-usual-upgrade-to-4-2-2-this-time-effed-up-my-installation/24106/5) as the start of this thread and don’t see a clear solution here.

---

<div class="post-metadata">

**Author:** ![crozilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/crozilla/32/2054_2.png) [@crozilla](https://forum.mautic.org/u/crozilla)\
**Post date:** [May 23, 2022, 1:47pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/24 "2022-05-23T13:47:33Z")

</div>

Yeah, it’s in the .htaccess file. Commenting out this bit solved my problem of nothing showing (blank page) when I went to my Mautic directory URL. It’s not related to our larger issue of foreign key constraints. ☹

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [February 18, 2023, 7:59pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/25 "2023-02-18T19:59:05Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.

[Previous page](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867.md?page=1)
