Bug #82923 OSX MySQL upgrade instructions seem to be missing
Submitted: 9 Sep 2016 12:49 Modified: 9 Sep 2016 12:58
Reporter: Simon Mudd (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.7.15 OS:MacOS (10.11.6)
Assigned to: CPU Architecture:Any
Tags: upgrade instructions OSX

[9 Sep 2016 12:49] Simon Mudd
Description:
Category is wrong, couldn't find OSX ...

I use a Mac for testing MySQL and use the dmg image which you provide. (Thanks)
If installed empty this works fine and the instructions which are referenced when the install finishes point to the manual and that's good.

(http://dev.mysql.com/doc/refman/5.7/en/osx-installation-pkg.html)

However, if I have a running MysQL daemon with data which I'm using then installing the new package seems to basically create a new instance in the new install directory and moves around the symlinks so basically I lose access to my data.

How to repeat:
Install MysQL, configure /etc/my.cnf appropriately, setup some grants, add some data.

Then install a newer version of MySQL and notice how this all gets messed up.
and you get poked about a new "use once" root password and the old datadir symlinked from mysql-5.7.14-osx10.11-x86_64 gets moved away.

Suggested fix:
It looks to me like the package install expectations are that  you're always doing a new install.
It looks like the expectations here don't bother to check if mysqld is actually running.

Clearer instructions on how to use the dmg packages to do the upgrade would be better, as otherwise I guess it may be better to download the tar balls and do things by hand.

A short description of a typical process of migrating from say 5.7.14 installed via a previous package install to 5.7.15 would be good. I know the process about doing this so the question is how to do this with the OSX package manager when you aren't creating a new setup.
[9 Sep 2016 12:58] Simon Mudd
Also given that typical setup start MySQL with these commands:

... --datadir=/usr/local/mysql/data

and the fact that /usr/local/mysql is actually a symlink of the form:

$ ls -l /usr/local/mysql
lrwxr-xr-x  1 root  wheel  28 Sep  9 14:13 /usr/local/mysql -> mysql-5.7.15-osx10.11-x86_64

then obviously any packages updates which change this break the previous setup.

Consequently suggestions on what's needed to move datadir out of this directory to prevent this would probably make things much easier for people.