# Docker Image Ignoring db\_table\_prefix setting

**URL:** <https://forum.mautic.org/t/docker-image-ignoring-db-table-prefix-setting/32556>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [June 26, 2024, 4:29pm UTC](https://forum.mautic.org/t/docker-image-ignoring-db-table-prefix-setting/32556 "2024-06-26T16:29:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [June 26, 2024, 4:29pm UTC](https://forum.mautic.org/t/docker-image-ignoring-db-table-prefix-setting/32556/1 "2024-06-26T16:29:30Z")

</div>

**Your software**  
My Mautic version is: Docker image tag 5-apache  
My Database type and version is: MariaDB 10.11.4

**Your problem**  
I’ve updated a container from Mautic V4 to V5 using the 5-apache tagged image on Docker Hub and I’m getting error in the log about tables not being found and I noticed that the table prefix is missing. I’ve checked it is in the `local.php` and it is:

```auto
'db_table_prefix' => 'myprefix_',

```

and I’ve also tried adding it as an environment variable like this:

```auto
MAUTIC_DB_TABLE_PREFIX=myprefix_

```

but the same errors are shown in the log after restarting the container.

This is an example of the errors that are showing in the log:

```auto
[2024-06-26T16:00:28.869346+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist" at /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 49 {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 1146): An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist at /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:49)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1146): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist at /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist at /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)"} {"hostname":"fdcf5c6c813f","pid":24}

```

It’s multiple different tables but all are missing the prefix.

I’m also seeing this “PHP Notice” in the Docker log for the container:

```auto
[Wed Jun 26 15:59:07.969962 2024] [php:notice] [pid 24] [client 10.0.1.211:35546] PHP Deprecation - fnmatch(): Passing null to parameter #2 ($filename) of type string is deprecated - in file /var/www/html/docroot/app/middlewares/CORSMiddleware.php - at line 107

```

But I don’t think that is relevant to the missing table prefix, but I’ve included incase it is.

Is there something else I need to do with Mautic 5 for the prefix?

Also, is there any sort of upgrade guide for V4 to V5 with Docker? Are there other things I need to change? From reading the page on Docker Hub, there didn’t really seem to be anything that needed doing apart from changing the image.

Thanks.

---

<div class="post-metadata">

**Author:** ![nachichuri](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nachichuri/32/14121_2.png) [@nachichuri](https://forum.mautic.org/u/nachichuri)\
**Post date:** [June 18, 2025, 1:20pm UTC](https://forum.mautic.org/t/docker-image-ignoring-db-table-prefix-setting/32556/2 "2025-06-18T13:20:35Z")

</div>

Hey there! Were you able to find a fix for this? Thanks

---

<div class="post-metadata">

**Author:** ![murray10001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/murray10001/32/14285_2.png) [@murray10001](https://forum.mautic.org/u/murray10001)\
**Post date:** [September 28, 2025, 9:46am UTC](https://forum.mautic.org/t/docker-image-ignoring-db-table-prefix-setting/32556/3 "2025-09-28T09:46:21Z")

</div>

Looks like prefixes don’t work properly. I had migrations fail because the migration did not take account of the prefix and I have this error message on the cron process:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mautic3.campaigns’ doesn’t exist.

my feeling is that the docker version with a prefix is not stable. Same with 5.28 and 6.\*.

And when the prefixes break the migrations, I tried to switch automatic migration on restart of the contain off and this didn’t work either.
