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

Unable to migrate from MySQL due to incorrect definition of table mysql.proc and mysql.event

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.29, 5.5.28a-galera
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Arch Linux i686/x86_64

      Description

      After installation MySQL and initialization its data directory using mysql_install_db, I removed MySQL packages and installed MariaDB counterparts. Then I ran MariaDB's mysql_install_db again, but scripts threw out that mysql.proc and mysql.event have incorrect definitions (full log in attachment).

      I'm aware that I should run mysql_upgrade first and do not run mysql_install_db second time, but I want to make migration straighforward for Arch users. As far as I know there is no safe and sure way to check if calling the script is required. MariaDB's mysql_install_db worked fine until 5.5.28 release, and now user have to intervene manually. (However clean MariaDB installs are working fine.)

      I wouldn't even report that, but you "advertise" that as long as MySQL and Maria have same base version, the migration should be flawless. If you won't fix this obvious regression, it will make Arch migration to MariaDB much slower.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Where did you get the suggestion to run mysql_install_db on upgrade? The rule always was - after every upgrade run mysql_upgrade. While mysql_install_db was always supposed to be run only on fresh installs.

            No matter whether you upgrade from one MySQL version to another MySQL version, or from MySQL to MariaDB, or between different MariaDB version, the rule is always the same - run mysql_upgrade afterwards.

            Show
            serg Sergei Golubchik added a comment - Where did you get the suggestion to run mysql_install_db on upgrade? The rule always was - after every upgrade run mysql_upgrade. While mysql_install_db was always supposed to be run only on fresh installs. No matter whether you upgrade from one MySQL version to another MySQL version, or from MySQL to MariaDB, or between different MariaDB version, the rule is always the same - run mysql_upgrade afterwards.
            Hide
            barthalion Bartłomiej Piotrowski added a comment -

            Our package manager doesn't recognize thing like "migration". It's simple boolean that package was not - but - is going to be installed, and then mysql_install_db is run. Is it possible to check if mysql_install_db should be executed? As far as I understood, it won't be possible to avoid manual intervention anyway.

            Show
            barthalion Bartłomiej Piotrowski added a comment - Our package manager doesn't recognize thing like "migration". It's simple boolean that package was not - but - is going to be installed, and then mysql_install_db is run. Is it possible to check if mysql_install_db should be executed? As far as I understood, it won't be possible to avoid manual intervention anyway.
            Hide
            serg Sergei Golubchik added a comment - - edited

            in the rpm post-install script, I run mysql_install_db only when the datadir did not exist and was created:

            if [ ! -e $mysql_datadir ]; then

            1. Create data directory
              mkdir -p $mysql_datadir/ {mysql,test}
            1. Initiate databases
              %{_bindir}/mysql_install_db --rpm --user=% {mysqld_user}

              fi

            yes, and our rpm scriptlets never run mysql_upgrade, they only recommend the user to do it. It's a manual process to run mysql_upgrade, and generally it's only needed when upgrading to another major version, minor version upgrades are usually safe without mysql_upgrade.

            Show
            serg Sergei Golubchik added a comment - - edited in the rpm post-install script, I run mysql_install_db only when the datadir did not exist and was created: if [ ! -e $mysql_datadir ]; then Create data directory mkdir -p $mysql_datadir/ {mysql,test} Initiate databases %{_bindir}/mysql_install_db --rpm --user=% {mysqld_user} fi yes, and our rpm scriptlets never run mysql_upgrade, they only recommend the user to do it. It's a manual process to run mysql_upgrade, and generally it's only needed when upgrading to another major version, minor version upgrades are usually safe without mysql_upgrade.
            Hide
            barthalion Bartłomiej Piotrowski added a comment -

            I adapted these lines to our post_install function. Thank you! Sorry for unnecessary noise – issue can be closed.

            Show
            barthalion Bartłomiej Piotrowski added a comment - I adapted these lines to our post_install function. Thank you! Sorry for unnecessary noise – issue can be closed.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                barthalion Bartłomiej Piotrowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: