We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48272
    • 24 Posts
    I get some strange errors in de modx error log. I don't know when these errors occur or what is causing them.

    [2015-03-30 15:51:38] (ERROR @ /index.php) Error HY000 executing query: SELECT `modSnippet`.`id` AS `modSnippet_id`, `modSnippet`.`source` AS `modSnippet_source`, `modSnippet`.`property_preprocess` AS `modSnippet_property_preprocess`, `modSnippet`.`name` AS `modSnippet_name`, `modSnippet`.`description` AS `modSnippet_description`, `modSnippet`.`editor_type` AS `modSnippet_editor_type`, `modSnippet`.`category` AS `modSnippet_category`, `modSnippet`.`cache_type` AS `modSnippet_cache_type`, `modSnippet`.`snippet` AS `modSnippet_snippet`, `modSnippet`.`locked` AS `modSnippet_locked`, `modSnippet`.`properties` AS `modSnippet_properties`, `modSnippet`.`moduleguid` AS `modSnippet_moduleguid`, `modSnippet`.`static` AS `modSnippet_static`, `modSnippet`.`static_file` AS `modSnippet_static_file`, `Source`.`id` AS `Source_id`, `Source`.`name` AS `Source_name`, `Source`.`description` AS `Source_description`, `Source`.`class_key` AS `Source_class_key`, `Source`.`properties` AS `Source_properties`, `Source`.`is_stream` AS `Source_is_stream` FROM `modx_site_snippets` AS `modSnippet` LEFT JOIN `modx_media_sources` `Source` ON `modSnippet`.`source` = `Source`.`id` WHERE `modSnippet`.`name` = ? ORDER BY `modSnippet`.`id` ASC  - Array
    (
        [0] => HY000
        [1] => 1267
        [2] => Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
    )


    I am using MODX Revolution 2.3.3-pl (traditional).

    Any idea what is wrong and how I can fix this? If extra information is required please let me know.

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      It means that you have a mismatch between the character sets and/or collations in your database and the character set specified in your MODX config file. Often, people have a mismatch within the database, with some tables or fields in one character set and others in some other character set, usually latin1 vs. utf8.

      If you look at the database in PhpMyAdmin and examine the tables with the structure tab you can see the character sets and collations. The odds are that you have Latin1 and latin1_swedish_ci in the DB (that's the MySQL default) and utf8 in the MODX config file.

      If *everything* in the database is Latin1. You can switch the character set in the MODX config file to latin1 and possibly solve the problem, though MODX recommends the use of utf8. Unfortunately, it's not safe to modify them yourself in the DB.

      If you want to change the db to utf8 to match the config file (or if there are mismatches *within* the db), see this: http://bobsguides.com/convert-db-utf8.html.

      SiteCheck isn't free, but it will examine the entire DB for you and report on any mismatches. It's a comfort to know for sure that you've fixed all of them and SiteCheck will report on lots of other potential problems as well.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 48272
        • 24 Posts
        Thanks. I will check my DB and let you know the result. (Strange; I didn't know that you replied my post because the number of unread replies stayed 0. Have to check it manually.....)
          • 3749
          • 24,544 Posts
          Quote from: egraaf at Apr 10, 2015, 08:33 AM
          Thanks. I will check my DB and let you know the result. (Strange; I didn't know that you replied my post because the number of unread replies stayed 0. Have to check it manually.....)

          I think that happens if the forum server crashes before you leave. It happens to me pretty regularly, but since I always have replies, I know when it happens.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting