Ad Widget

Collapse

cannot set MySQL character set to "utf8"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • V-Test
    Junior Member
    • Feb 2022
    • 18

    #1

    cannot set MySQL character set to "utf8"

    On my first run of installing Zabbix, I was able to get the server up and I started to configure the front end when I got an error that the character set was set to Latin. I had missed that step in the setup. When I went back to change it, the server would always error out with "cannot set MySQL character set to "utf8"'. I completely uninstalled and started over, and followed the exact steps from the installation and I keep getting the same error. I uninstalled and erased the /var/lib/mysql directory and /etc/zabbix, re-installed MariaDB and Zabbix and still keep getting the same error over and over again.

    I've gone through the steps of Repairing Zabbix database character set and collation and my database is shown as utf8mb3. It doesn't change over to utf8 after the command though.

    I have gone through the installation steps over 10 times and I can't get pass this error. Does anyone have an idea of what this could be?

    RHEL7
    MariaDB 10.7.3
    Zabbix 5.0
    php 7.2.34
    Apache/2.4.6 (Red Hat Enterprise Linux)
    Attached Files
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Originally posted by V-Test
    Does anyone have an idea of what this could be?

    RHEL7
    MariaDB 10.7.3
    Zabbix 5.0
    php 7.2.34
    Apache/2.4.6 (Red Hat Enterprise Linux)
    MariaDB 10.7 is very new, and Zabbix 5.0 was probably never tested with it. I know that there have been plans in the works for MariaDB to fix MySQL's "original sin" of making "utf8" not be true utf8, and it might be that 10.7 finally implemented the planned changes.

    My guess is that if you try a fresh install of MariaDB 10.5.x, you won't have the same issue. Make sure you clear out the existing databases before installing and starting MariaDB 10.5.x.

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #3
      It seems "UTF8" is an alias for "utf8mb3" on MariaDB 10.7, unless you unset the "OLD_MODE".
      V-Test, since this is your first run with Zabbix, I would suggest dropping the database and recreating it with "utf8mb4" character set. Or just change it.
      Code:
      alter database zabbix character set utf8mb4 collate utf8mb4_bin;
      Check if that does the job.
      Last edited by markfree; 25-02-2022, 02:06.

      Comment

      • V-Test
        Junior Member
        • Feb 2022
        • 18

        #4
        Originally posted by tim.mooney

        MariaDB 10.7 is very new, and Zabbix 5.0 was probably never tested with it. I know that there have been plans in the works for MariaDB to fix MySQL's "original sin" of making "utf8" not be true utf8, and it might be that 10.7 finally implemented the planned changes.

        My guess is that if you try a fresh install of MariaDB 10.5.x, you won't have the same issue. Make sure you clear out the existing databases before installing and starting MariaDB 10.5.x.

        I moved to another server and installed MariaDB 10.5.15 and went through the install steps and I'm not getting the UTF8 error, but now it's erroring out on the zabbix.sock and mysql.sock file permissions. Now I'm investigating that error. I saw a couple of forum threads of people with the same issue, but haven't been able to get that now.
        Attached Files

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          That sounds like it might be SELinux in enforcing mode.

          If you're going to run Zabbix with SELinux, you probably need to add a bunch of labels, to allow Zabbix and the web front end to access certain paths.

          Comment

          • V-Test
            Junior Member
            • Feb 2022
            • 18

            #6
            Thank you guys for your help, both of your suggestions worked out. I had to downgrade to MariaDB 10.5 and SELinix was turned on. After I fixed both of those, I was able to get the server up and configure the front end on my second server. I went back to my first server and made the same changes and both are now up! Thanks again.
            Last edited by V-Test; 01-03-2022, 09:02.

            Comment

            Working...