[MDEV-4188] Unable to migrate from MySQL due to incorrect definition of table mysql.proc and mysql.event Created: 2013-02-19  Updated: 2013-02-20  Resolved: 2013-02-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.29, 5.5.28a-galera
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bartłomiej Piotrowski (Inactive) Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: packaging
Environment:

Arch Linux i686/x86_64


Attachments: Text File pacman.log    

 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.



 Comments   
Comment by Sergei Golubchik [ 2013-02-19 ]

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.

Comment by Bartłomiej Piotrowski (Inactive) [ 2013-02-19 ]

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.

Comment by Sergei Golubchik [ 2013-02-19 ]

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.

Comment by Bartłomiej Piotrowski (Inactive) [ 2013-02-20 ]

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

Generated at Thu Feb 08 06:54:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.