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

MariaDB 10.2 cannot start on MySQL 5.7 datadir: Fatal error: mysql.user table is damaged or in unsupported 3.20 format

Details

    • 10.2.4-1, 10.2.4-1, 10.2.4-2

    Description

      An attempt to start MariaDB 10.2 (as of 39d2c7b18d, Oct 27) on a simple MySQL 5.7 datadir ends with the error:

      2016-10-29 12:45:31 140477392623488 [ERROR] Fatal error: mysql.user table is damaged or in unsupported 3.20 format.
      

      I tried to start the server with --skip-grant-tables and run mysql_upgrade to see if we can work around the problem this way if it comes to it; the server starts, but mysql_upgrade throws all kinds of errors. At this point I'm not sure whether it's because of skip-grant-tables (I doubt that), or it will be the next problem on the way of fixing MySQL 5.7 => MariaDB 10.2 upgrade.

      Attachments

        Issue Links

          Activity

            This is something that Debian introduced in their MariaDB packages to avoid cross-grade failures which can leave the installation in inconsistent state.

            If it discovers that an upgrade from MySQL 5.7 to 10.0 is performed, it backs up the old (5.7) datadir somewhere, and installs 10.0 on a clean datadir, so that the data could be converted/imported later if needed. I can't say off the top of my head which name it gives to the 5.7 datadir, but it should be easy to find.

            elenst Elena Stepanova added a comment - This is something that Debian introduced in their MariaDB packages to avoid cross-grade failures which can leave the installation in inconsistent state. If it discovers that an upgrade from MySQL 5.7 to 10.0 is performed, it backs up the old (5.7) datadir somewhere, and installs 10.0 on a clean datadir, so that the data could be converted/imported later if needed. I can't say off the top of my head which name it gives to the 5.7 datadir, but it should be easy to find.
            own3mall OwN-3m-All added a comment -

            Yeah, a dialog stated I should create a backup of all the databases first and then re-import it, but when I do that, MariaDB states the users table has issues and won't start, which would make sense based on MySQL 5.7.x changes. So, is there anyway to get the all of the databases re-imported along with the users table? I could have thousands of MySQL users...

            own3mall OwN-3m-All added a comment - Yeah, a dialog stated I should create a backup of all the databases first and then re-import it, but when I do that, MariaDB states the users table has issues and won't start, which would make sense based on MySQL 5.7.x changes. So, is there anyway to get the all of the databases re-imported along with the users table? I could have thousands of MySQL users...
            faust Faustin Lammler added a comment - - edited

            Hi,
            the following script permits to rollback to mysql-server-5.7 for users that are not able to import their DB into mariadb-server-10.0.
            rollback_mysql5.7.sh

            May I suggest that the installation of mariadb-server-10.0 do not overwrite the '/etc/mysql/debian-start' script and instead rename it to '/etc/mysql/debian-start-5.7' as it does for '/etc/mysql/debian.cnf' ?
            This way we could remove the part in the script that need to download and extract the original '/etc/mysql/debian-start' script.

            faust Faustin Lammler added a comment - - edited Hi, the following script permits to rollback to mysql-server-5.7 for users that are not able to import their DB into mariadb-server-10.0. rollback_mysql5.7.sh May I suggest that the installation of mariadb-server-10.0 do not overwrite the '/etc/mysql/debian-start' script and instead rename it to '/etc/mysql/debian-start-5.7' as it does for '/etc/mysql/debian.cnf' ? This way we could remove the part in the script that need to download and extract the original '/etc/mysql/debian-start' script.

            I just noticed the line

            alter table mysql.user add column `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' after `user`

            in https://github.com/MariaDB/server/commit/ad4239cc3dc7ad5f6f264e1fb3cf6d24084bda90#diff-e5e5c9a25c77f21cce4305ecb13c1524 (added to scripts/mysql_to_mariadb.sql)
            looks very similar to the line

            ALTER TABLE user ADD Password char(41) character set latin1 collate latin1_bin NOT NULL default '' AFTER User;

            in https://github.com/mariadb/server/commit/fdfdea40f1b9d029de59131f54096c1b044ffdfa#diff-31d16d61530087cf04e29a2667c5bda0 (added to scripts/mysql_system_tables_fix.sql)

            cvicentiu Can you check if either one is a duplicate and should be cleaned away?

            otto Otto Kekäläinen added a comment - I just noticed the line alter table mysql.user add column `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' after `user` in https://github.com/MariaDB/server/commit/ad4239cc3dc7ad5f6f264e1fb3cf6d24084bda90#diff-e5e5c9a25c77f21cce4305ecb13c1524 (added to scripts/mysql_to_mariadb.sql) looks very similar to the line ALTER TABLE user ADD Password char(41) character set latin1 collate latin1_bin NOT NULL default '' AFTER User; in https://github.com/mariadb/server/commit/fdfdea40f1b9d029de59131f54096c1b044ffdfa#diff-31d16d61530087cf04e29a2667c5bda0 (added to scripts/mysql_system_tables_fix.sql) cvicentiu Can you check if either one is a duplicate and should be cleaned away?

            Related downstream issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926231

            Currently upgrading from MySQL 5.7 to MariaDB 10.3 requires and extra mysql_upgrade run.

            otto Otto Kekäläinen added a comment - Related downstream issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926231 Currently upgrading from MySQL 5.7 to MariaDB 10.3 requires and extra mysql_upgrade run.

            People

              cvicentiu Vicențiu Ciorbaru
              elenst Elena Stepanova
              Votes:
              1 Vote for this issue
              Watchers:
              7 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.