• Hello,

    I recently cleaned up a lot of mess in my DB/PHP related to UTF-8 support. Some DB tables were using latin1, some “utf8” in MySQL parlance, which really translate to utf8mb3 . Hence, any emoticon inserted in a post were not correctly stored, and ended up displaying as any number of “?” .

    I managed to get to the point where all db tables and the db defaults cleanly use utf8mb4_unicode_ci .
    I declared define('DB_CHARSET', 'utf8mb4_unicode_ci'); in wp-config.php .
    Now, if I write a new post with emoticons, they are properly saved and displayed. Yay!
    However, MailPoet is broken !

    In the WP admin page I get (sorry, long stack trace) :

    MailPoet : PDOException: SQLSTATE[00000] [2019] Can't initialize character set utf8mb4_unicode_ci (path: compiled_in) in /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:20
    Stack trace:
    #0 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(20): PDO->__construct()
    #1 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct()
    #2 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
    #3 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect()
    #4 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection()
    #5 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery()
    #6 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
    #7 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy()
    #8 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll()
    #9 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(135): MailPoet\Doctrine\Repository->findAll()
    #10 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded()
    #11 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(107): MailPoet\Settings\SettingsController->get()
    #12 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(79): MailPoet\Util\License\Features\Subscribers->hasValidMssKey()
    #13 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(83): MailPoet\Util\License\Features\Subscribers->hasValidApiKey()
    #14 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(49): MailPoet\Util\License\Features\Subscribers->getSubscribersLimit()
    #15 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(101): MailPoet\Util\License\Features\Subscribers->check()
    #16 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(70): MailPoet\Premium\Config\Initializer->setupAutomations()
    #17 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/mailpoet_initializer.php(43): MailPoet\Premium\Config\Initializer->init()
    #18 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(308): mailpoet_premium_init()
    #19 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #20 /home/kanda/ethiqueetchiens.fr/wp-includes/plugin.php(517): WP_Hook->do_action()
    #21 /home/kanda/ethiqueetchiens.fr/wp-settings.php(480): do_action()
    #22 /home/kanda/ethiqueetchiens.fr/wp-config.php(106): require_once('/home/kanda/eth...')
    #23 /home/kanda/ethiqueetchiens.fr/wp-load.php(50): require_once('/home/kanda/eth...')
    #24 /home/kanda/ethiqueetchiens.fr/wp-admin/admin.php(34): require_once('/home/kanda/eth...')
    #25 /home/kanda/ethiqueetchiens.fr/wp-admin/edit.php(10): require_once('/home/kanda/eth...')
    #26 {main}
    
    Next MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[00000] [2019] Can't initialize character set utf8mb4_unicode_ci (path: compiled_in) in /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:10
    Stack trace:
    #0 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(24): MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception::new()
    #1 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct()
    #2 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
    #3 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect()
    #4 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection()
    #5 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery()
    #6 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
    #7 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy()
    #8 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll()
    #9 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(135): MailPoet\Doctrine\Repository->findAll()
    #10 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded()
    #11 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(107): MailPoet\Settings\SettingsController->get()
    #12 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(79): MailPoet\Util\License\Features\Subscribers->hasValidMssKey()
    #13 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(83): MailPoet\Util\License\Features\Subscribers->hasValidApiKey()
    #14 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(49): MailPoet\Util\License\Features\Subscribers->getSubscribersLimit()
    #15 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(101): MailPoet\Util\License\Features\Subscribers->check()
    #16 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(70): MailPoet\Premium\Config\Initializer->setupAutomations()
    #17 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/mailpoet_initializer.php(43): MailPoet\Premium\Config\Initializer->init()
    #18 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(308): mailpoet_premium_init()
    #19 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #20 /home/kanda/ethiqueetchiens.fr/wp-includes/plugin.php(517): WP_Hook->do_action()
    #21 /home/kanda/ethiqueetchiens.fr/wp-settings.php(480): do_action()
    #22 /home/kanda/ethiqueetchiens.fr/wp-config.php(106): require_once('/home/kanda/eth...')
    #23 /home/kanda/ethiqueetchiens.fr/wp-load.php(50): require_once('/home/kanda/eth...')
    #24 /home/kanda/ethiqueetchiens.fr/wp-admin/admin.php(34): require_once('/home/kanda/eth...')
    #25 /home/kanda/ethiqueetchiens.fr/wp-admin/edit.php(10): require_once('/home/kanda/eth...')
    #26 {main}
    
    Next MailPoetVendor\Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: SQLSTATE[00000] [2019] Can't initialize character set utf8mb4_unicode_ci (path: compiled_in) in /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:102
    Stack trace:
    #0 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(77): MailPoetVendor\Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
    #1 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(69): MailPoetVendor\Doctrine\DBAL\DBALException::wrapException()
    #2 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(16): MailPoetVendor\Doctrine\DBAL\DBALException::driverException()
    #3 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
    #4 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect()
    #5 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection()
    #6 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery()
    #7 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
    #8 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy()
    #9 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll()
    #10 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(135): MailPoet\Doctrine\Repository->findAll()
    #11 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded()
    #12 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(107): MailPoet\Settings\SettingsController->get()
    #13 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(79): MailPoet\Util\License\Features\Subscribers->hasValidMssKey()
    #14 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(83): MailPoet\Util\License\Features\Subscribers->hasValidApiKey()
    #15 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(49): MailPoet\Util\License\Features\Subscribers->getSubscribersLimit()
    #16 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(101): MailPoet\Util\License\Features\Subscribers->check()
    #17 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(70): MailPoet\Premium\Config\Initializer->setupAutomations()
    #18 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/mailpoet_initializer.php(43): MailPoet\Premium\Config\Initializer->init()
    #19 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(308): mailpoet_premium_init()
    #20 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #21 /home/kanda/ethiqueetchiens.fr/wp-includes/plugin.php(517): WP_Hook->do_action()
    #22 /home/kanda/ethiqueetchiens.fr/wp-settings.php(480): do_action()
    #23 /home/kanda/ethiqueetchiens.fr/wp-config.php(106): require_once('/home/kanda/eth...')
    #24 /home/kanda/ethiqueetchiens.fr/wp-load.php(50): require_once('/home/kanda/eth...')
    #25 /home/kanda/ethiqueetchiens.fr/wp-admin/admin.php(34): require_once('/home/kanda/eth...')
    #26 /home/kanda/ethiqueetchiens.fr/wp-admin/edit.php(10): require_once('/home/kanda/eth...')
    #27 {main}

    If I declare define('DB_CHARSET', 'utf8mb4'); in wp-config.php :

    • MailPoet feels fine
    • No emoticons are properly saved nor displayed in a post (they get replaced by “?”)

    If I I declare define('DB_CHARSET', 'utf8mb4_general_ci'); in wp-config.php , and change db encodings to utf8mb4_general_ci : (see below why this test)

    • Emoticons are properly saved and displayed
    • MailPoet is broken loading admin pages result is an Error (stack trace below),
    MailPoet : PDOException: SQLSTATE[00000] [2019] Can't initialize character set utf8mb4_general_ci (path: compiled_in) in /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:20
    Stack trace:
    #0 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(20): PDO->__construct()
    #1 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct()
    #2 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
    #3 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect()
    #4 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection()
    #5 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery()
    #6 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
    #7 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy()
    #8 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll()
    #9 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(135): MailPoet\Doctrine\Repository->findAll()
    #10 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded()
    #11 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(107): MailPoet\Settings\SettingsController->get()
    #12 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(79): MailPoet\Util\License\Features\Subscribers->hasValidMssKey()
    #13 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(83): MailPoet\Util\License\Features\Subscribers->hasValidApiKey()
    #14 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(49): MailPoet\Util\License\Features\Subscribers->getSubscribersLimit()
    #15 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(101): MailPoet\Util\License\Features\Subscribers->check()
    #16 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(70): MailPoet\Premium\Config\Initializer->setupAutomations()
    #17 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/mailpoet_initializer.php(43): MailPoet\Premium\Config\Initializer->init()
    #18 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(308): mailpoet_premium_init()
    #19 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #20 /home/kanda/ethiqueetchiens.fr/wp-includes/plugin.php(517): WP_Hook->do_action()
    #21 /home/kanda/ethiqueetchiens.fr/wp-settings.php(480): do_action()
    #22 /home/kanda/ethiqueetchiens.fr/wp-config.php(106): require_once('/home/kanda/eth...')
    #23 /home/kanda/ethiqueetchiens.fr/wp-load.php(50): require_once('/home/kanda/eth...')
    #24 /home/kanda/ethiqueetchiens.fr/wp-admin/admin.php(34): require_once('/home/kanda/eth...')
    #25 /home/kanda/ethiqueetchiens.fr/wp-admin/edit.php(10): require_once('/home/kanda/eth...')
    #26 {main}
    
    Next MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[00000] [2019] Can't initialize character set utf8mb4_general_ci (path: compiled_in) in /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:10
    Stack trace:
    #0 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(24): MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception::new()
    #1 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct()
    #2 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
    #3 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect()
    #4 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection()
    #5 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery()
    #6 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
    #7 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy()
    #8 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll()
    #9 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(135): MailPoet\Doctrine\Repository->findAll()
    #10 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded()
    #11 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(107): MailPoet\Settings\SettingsController->get()
    #12 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(79): MailPoet\Util\License\Features\Subscribers->hasValidMssKey()
    #13 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(83): MailPoet\Util\License\Features\Subscribers->hasValidApiKey()
    #14 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(49): MailPoet\Util\License\Features\Subscribers->getSubscribersLimit()
    #15 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(101): MailPoet\Util\License\Features\Subscribers->check()
    #16 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(70): MailPoet\Premium\Config\Initializer->setupAutomations()
    #17 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/mailpoet_initializer.php(43): MailPoet\Premium\Config\Initializer->init()
    #18 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(308): mailpoet_premium_init()
    #19 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #20 /home/kanda/ethiqueetchiens.fr/wp-includes/plugin.php(517): WP_Hook->do_action()
    #21 /home/kanda/ethiqueetchiens.fr/wp-settings.php(480): do_action()
    #22 /home/kanda/ethiqueetchiens.fr/wp-config.php(106): require_once('/home/kanda/eth...')
    #23 /home/kanda/ethiqueetchiens.fr/wp-load.php(50): require_once('/home/kanda/eth...')
    #24 /home/kanda/ethiqueetchiens.fr/wp-admin/admin.php(34): require_once('/home/kanda/eth...')
    #25 /home/kanda/ethiqueetchiens.fr/wp-admin/edit.php(10): require_once('/home/kanda/eth...')
    #26 {main}
    
    Next MailPoetVendor\Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: SQLSTATE[00000] [2019] Can't initialize character set utf8mb4_general_ci (path: compiled_in) in /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:102
    Stack trace:
    #0 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(77): MailPoetVendor\Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
    #1 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(69): MailPoetVendor\Doctrine\DBAL\DBALException::wrapException()
    #2 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(16): MailPoetVendor\Doctrine\DBAL\DBALException::driverException()
    #3 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
    #4 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect()
    #5 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection()
    #6 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery()
    #7 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
    #8 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy()
    #9 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll()
    #10 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(135): MailPoet\Doctrine\Repository->findAll()
    #11 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded()
    #12 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(107): MailPoet\Settings\SettingsController->get()
    #13 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(79): MailPoet\Util\License\Features\Subscribers->hasValidMssKey()
    #14 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(83): MailPoet\Util\License\Features\Subscribers->hasValidApiKey()
    #15 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet/lib/Util/License/Features/Subscribers.php(49): MailPoet\Util\License\Features\Subscribers->getSubscribersLimit()
    #16 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(101): MailPoet\Util\License\Features\Subscribers->check()
    #17 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/lib/Config/Initializer.php(70): MailPoet\Premium\Config\Initializer->setupAutomations()
    #18 /home/kanda/ethiqueetchiens.fr/wp-content/plugins/mailpoet-premium/mailpoet_initializer.php(43): MailPoet\Premium\Config\Initializer->init()
    #19 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(308): mailpoet_premium_init()
    #20 /home/kanda/ethiqueetchiens.fr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #21 /home/kanda/ethiqueetchiens.fr/wp-includes/plugin.php(517): WP_Hook->do_action()
    #22 /home/kanda/ethiqueetchiens.fr/wp-settings.php(480): do_action()
    #23 /home/kanda/ethiqueetchiens.fr/wp-config.php(106): require_once('/home/kanda/eth...')
    #24 /home/kanda/ethiqueetchiens.fr/wp-load.php(50): require_once('/home/kanda/eth...')
    #25 /home/kanda/ethiqueetchiens.fr/wp-admin/admin.php(34): require_once('/home/kanda/eth...')
    #26 /home/kanda/ethiqueetchiens.fr/wp-admin/edit.php(10): require_once('/home/kanda/eth...')
    #27 {main}


    Why testing “general” instead of “unicode” ?
    The stack trace says Can't initialize character set utf8mb4_general_ci (path: compiled_in) . I figured out it may not harm to use a charset that would be compiled_in , whatever that means.
    Andutf8mb4_general_ci is a recognized/built-in charset in the mysql db, as per the output of show character set like 'utf%' :

    Charset | Description | Default collation | Maxlen
    utf8mb3 | UTF-8 Unicode | utf8mb3_general_ci | 3
    utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4
    utf16 | UTF-16 Unicode | utf16_general_ci | 4
    utf16le | UTF-16LE Unicode | utf16le_general_ci | 4
    utf32 | UTF-32 Unicode | utf32_general_ci | 4

    However, that was just a test to see if MailPoet would be happier with utf8mb4_general_ci .

    At this stage, I would be really happy if anyone had a suggestion to make MailPoet happy (not crash) with the DB/PHP set up to use utf8mb4
    Any help appreciated, thanks in advance !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Palijn,

    We noticed that you are using an incorrect value for the DB_CHARSET config since utf8mb4_unicode_ci is a collation, not a character set. To find the acceptable values, run the “show character” command you mentioned and refer to the first column of the generated table.

    Please use the following configuration for a correct setup:

    define('DB_CHARSET', 'utf8mb4'); 
    define('DB_COLLATE', 'utf8mb4_unicode_ci');

    Also, keep in mind that changing the DB_CHARSET and DB_COLLATE configs may cause data corruption or unexpected behavior if your existing tables are not converted to the desired charset/collation combination before changing the relevant configs.

    Follow the official documentation to convert your database character sets properly.

    Thread Starter Palijn

    (@palijn)

    Thank you !
    I’ve started reviewing all that and will keep this post updated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mailpoet crash using utf8mb4_unicode_ci’ is closed to new replies.