# Fehler bei Ausführung der Medienbereinigung im Cron ( Illegal mix of collations )

**URL:** <https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382>\
**Category:** Allgemein\
**Created:** [16. November 2016 um 08:40 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382 "2016-11-16T08:40:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![klxm](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@klxm](https://forum.shopware.com/u/klxm)\
**Post date:** [16. November 2016 um 08:40 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/1 "2016-11-16T08:40:58Z")

</div>

Anscheinend stimmt was mit der Datenbank nicht. &nbsp;Gibt es ein Skript, ein Tool dass die DB überprüft und die Einstellungen korrekt setzt?&nbsp;

&nbsp;

Ups! Ein Fehler ist aufgetreten!

Die nachfolgenden Hinweise sollten Ihnen weiterhelfen.

An exception occurred while executing ‚INSERT INTO s\_media\_used SELECT DISTINCT NULL, m.id FROM s\_media m INNER JOIN s\_emotion\_element\_value ON s\_emotion\_element\_value.value = m.path‘: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8\_general\_ci,IMPLICIT) and (utf8\_unicode\_ci,IMPLICIT) for operation ‚=‘ in vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php on line 119

Stack trace:

> #0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1027): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(PDOException), ‚INSERT INTO s\_m…‘) #1 engine/Shopware/Bundle/MediaBundle/GarbageCollector.php(241): Doctrine\DBAL\Connection-\>exec(‚INSERT INTO s\_m…‘) #2 engine/Shopware/Bundle/MediaBundle/GarbageCollector.php(139): Shopware\Bundle\MediaBundle\GarbageCollector-\>handleTable(Object(Shopware\Bundle\MediaBundle\Struct\MediaPosition)) #3 engine/Shopware/Bundle/MediaBundle/GarbageCollector.php(83): Shopware\Bundle\MediaBundle\GarbageCollector-\>find(Object(Shopware\Bundle\MediaBundle\Struct\MediaPosition)) #4 engine/Shopware/Bundle/MediaBundle/Subscriber/ServiceSubscriber.php(129): Shopware\Bundle\MediaBundle\GarbageCollector-\>run() #5 [internal function]: Shopware\Bundle\MediaBundle\Subscriber\ServiceSubscriber-\>runCronjob(Object(Shopware\_Components\_Cron\_CronJob)) #6 engine/Library/Enlight/Event/Handler/Default.php(91): call\_user\_func(Array, Object(Shopware\_Components\_Cron\_CronJob)) #7 engine/Library/Enlight/Event/EventManager.php(251): Enlight\_Event\_Handler\_Default-\>execute(Object(Shopware\_Components\_Cron\_CronJob)) #8 engine/Library/Enlight/Components/Cron/Manager.php(258): Enlight\_Event\_EventManager-\>notifyUntil(‚Shopware\_CronJo…‘, Object(Shopware\_Components\_Cron\_CronJob)) #9 engine/Shopware/Plugins/Default/Core/Cron/Cron.php(52): Enlight\_Components\_Cron\_Manager-\>runJob(Object(Enlight\_Components\_Cron\_Job)) #10 engine/Library/Enlight/Controller/Action.php(159): Shopware\_Controllers\_Backend\_Cron-\>indexAction() #11 engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight\_Controller\_Action-\>dispatch(‚indexAction‘) #12 engine/Library/Enlight/Controller/Front.php(223): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_ResponseHttp)) #13 engine/Shopware/Kernel.php(177): Enlight\_Controller\_Front-\>dispatch() #14 vendor/symfony/http-kernel/HttpCache/HttpCache.php(487): Shopware\Kernel-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #16 vendor/symfony/http-kernel/HttpCache/HttpCache.php(258): Shopware\Components\HttpCache\AppCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true) #17 engine/Shopware/Components/HttpCache/AppCache.php(103): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>pass(Object(Symfony\Component\HttpFoundation\Request), true) #18 shopware.php(113): Shopware\Components\HttpCache\AppCache-\>handle(Object(Symfony\Component\HttpFoundation\Request)) #19 {main}
> 
> &nbsp;

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [16. November 2016 um 08:48 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/2 "2016-11-16T08:48:14Z")

</div>

Du müsstest manuell die Coallations prüfen. Da gibt es kein Script zu.

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [16. November 2016 um 08:56 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/3 "2016-11-16T08:56:50Z")

</div>

Deine Tabellen verwenden utf8\_general\_ci und&nbsp;utf8\_unicode\_ci - dies müsstest Du vereinheitlichen --\> google

---

<div class="post-metadata">

**Author:** ![klxm](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@klxm](https://forum.shopware.com/u/klxm)\
**Post date:** [16. November 2016 um 08:57 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/4 "2016-11-16T08:57:06Z")

</div>

Alle Tabellen sind auf&nbsp;&nbsp;utf\_unicode\_ci …&nbsp;

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [16. November 2016 um 08:58 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/5 "2016-11-16T08:58:13Z")

</div>

ja offensichtlich nicht, sonst gäbe es die Meldung nicht.

---

<div class="post-metadata">

**Author:** ![klxm](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@klxm](https://forum.shopware.com/u/klxm)\
**Post date:** [16. November 2016 um 09:40 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/6 "2016-11-16T09:40:28Z")

</div>

Bevor jemand auf die Idee kommt, alle Tabellen einzeln zu überarbeiten:&nbsp;

Das hat geholfen

&nbsp;

> \<?php   
> // Datenbankverbindung mysql\_connect("localhost","Benutzer","Passwort"); mysql\_select\_db("Datenbank); &nbsp; // Konvertieren $res = mysql\_query("SHOW TABLES"); while ($row = mysql\_fetch\_array($res)) { &nbsp; &nbsp; foreach ($row as $key =\\> $table) &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; mysql\_query("ALTER TABLE " . $table . " CONVERT TO CHARACTER SET utf8 COLLATE unicode\_ci"); &nbsp; &nbsp; &nbsp; &nbsp; echo $key . " =\\> " . $table . " wurde umgewandelt "; &nbsp; &nbsp; } } ?\\>&nbsp;

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [16. November 2016 um 09:41 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/7 "2016-11-16T09:41:30Z")

</div>

nice

---

<div class="post-metadata">

**Author:** ![klxm](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@klxm](https://forum.shopware.com/u/klxm)\
**Post date:** [16. November 2016 um 09:44 UTC](https://forum.shopware.com/t/fehler-bei-ausfuhrung-der-medienbereinigung-im-cron-illegal-mix-of-collations/41382/8 "2016-11-16T09:44:14Z")

</div>

Ja da waren noch ein paar Tabellen die falsch definiert waren. Ich habe jetzt alle konvertiert, hoffe dass es keine Probleme bei den Plugins verursacht.&nbsp;
