We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24041
    • 7 Posts
    Not sure if this is a bug or whether something is wrong with my server compatibility - I’m getting this error in Revo 2.1 RC4 traditional when testing the database server connection:

    (ERROR in xPDO::connect @ /var/www/html/core/xpdo/xpdo.class.php : 342) SQLSTATE[HY000] [2019] Can’t initialize character set (path: /usr/share/mysql/charsets/)

    The Apache error log shows:

    Character set ’’ is not a compiled character set and is not specified in the ’/usr/share/mysql/charsets/Index.xml’ file

    I tried installing 2.0.8-pl and that installs fine. Any help much appreciated, thank you.


    PHP version 5.3.6
    MySQL 5.1.56
    pdo_MySQL 5.1.56
    Apache 2.0 Handler

    CentOS 5 on server

    Testing with Safari 5 for Mac

      • 24865
      • 289 Posts
      Strange. Perhaps you should try a different charset when updating/installing MODx. When you install it, you can select it when you get to that step. When you update, select the advanced update option and try another DB encoding scheme. You should savely backup your data (MySQL) before you do so.
        @MarkGHErnst

        Developer at Adwise Internetmarketing, the Netherlands.
        • 24041
        • 7 Posts
        Hi, thanks for your reply. The problem is that this is happening during the connection phase - I never actually get to the part where you can select the collation and charset.

        Sorry, I forgot to add this error which comes up first:


        Connecting to mysql server:
        Could not connect to the database server. Check the connection properties and try again.

        I’ve tried various different addresses for the server (it’s on localhost) - added ports, tried a direct IP address etc and double/triple checked the login details. The strange thing is that 2.0.8 installs no problem on the exact same host.

        Someone else was having this same issue with RC3: http://modxcms.com/forums/index.php/topic,63518.msg362844.html#msg362844
          • 10169
          • 24 Posts
          Yep, that was me. Same exact issue today attempting a clean install of RC4 on a brand new server.
            • 10169
            • 24 Posts
            Update: Like pumkin, I was also able to install 2.0.8 without a hitch on both of my servers.

            The commonalities is see here are php 5.3.6 and Apache2 on CentOS (I’m running 5.5 final). Should I report this as a bug?
            • If your character set is blank in the config file, you need to fix that before upgrading. That is an old bug and the $database_connection_charset variable should never be blank. This is revealed as a bug only in recent updates to PHP (i.e. 5.3.6) where a bug in PDO_mysql driver was fixed to actually send the charset from the DSN to the driver. Now that it does this, a blank value is invalid, even though the error never appeared before because the charset was not being set by the driver.
                • 24041
                • 7 Posts
                Hi Jason

                Thanks for the reply, may I just clarify whether you’re talking about the MODx config file or a config file for my sql / php settings on the server? Just to be clear, I am installing a new version in a totally clean db, not upgrading.
                  • 10169
                  • 24 Posts
                  In both of my cases, it was a fresh install... not an upgrade. Does this mean I have to create a partial config file to define the character set before running a 2.1.0 setup? Why was I able to install 2.0.8pl on the same servers without error?

                  Quote from: OpenGeek at May 11, 2011, 03:50 PM

                  If your character set is blank in the config file, you need to fix that before upgrading. That is an old bug and the $database_connection_charset variable should never be blank. This is revealed as a bug only in recent updates to PHP (i.e. 5.3.6) where a bug in PDO_mysql driver was fixed to actually send the charset from the DSN to the driver. Now that it does this, a blank value is invalid, even though the error never appeared before because the charset was not being set by the driver.
                  • Quote from: fretless at May 17, 2011, 07:31 PM

                    In both of my cases, it was a fresh install... not an upgrade. Does this mean I have to create a partial config file to define the character set before running a 2.1.0 setup? Why was I able to install 2.0.8pl on the same servers without error?
                    Since I cannot replicate this, I would have to know why you are getting a blank character set to know why this is happening.
                      • 24041
                      • 7 Posts
                      I’m a bit out of my depth here so forgive me if I’m asking silly questions. I’m just wondering, how does the installer ascertain the character set in the first place?

                      I’m used to the modx install process being: 1. Enter db host, username, pwd etc., test connection and get character sets/collations. Then step 2. Select char set and collation.

                      I’m not getting as far as step 2, it’s failing on 1, at which point there is no config file in core/config, and I haven’t told it which char set to use- so I guess my question is what defines the char set in step 1?