Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38698

mysql_upgrade does not fix charset and collation for mysql.user

    XMLWordPrintable

Details

    • Related to install and upgrade
    • Q1/2026 Server Development

    Description

      It seems we had a bug in mariadb-install-db in 10.6.

      I edited /etc/my.cnf as follows:

      [mysqld]
      ...
      character-set-server=utf8mb3
      collation-server=utf8mb3_general_ci
      ...
      

      and run mariadb-install-db. Then started the server and run the following query:

      show create view mysql.user\G
      

      It returned this result

      *************************** 1. row ***************************
                      View: user
               Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `mysql`.`user` AS select 
      .....
      character_set_client: utf8mb3
      collation_connection: utf8mb3_general_ci
      1 row in set (0.003 sec)
      

      If I remove the character set and collation lines and remove and install the database directory from scratch, I get:

      *************************** 1. row ***************************
                      View: user
               Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `mysql`.`user` AS select 
      .....
      character_set_client: latin1
      collation_connection: latin1_swedish_ci
      

      Problem in mariadb-upgrade in 11.8

      Furthermore, after upgrade to 11.8 and runnung mariadb-upgrade the fields character_set_client and collation_connecton do not get fixed to the expected latin1 and latin1_swedish_ci.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.