Bug #96981 Uninstalling MySQL Server deleted /usr/local/*
Submitted: 23 Sep 2019 16:58 Modified: 18 Oct 2019 14:03
Reporter: John Boker Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:8.0.17 OS:MacOS
Assigned to: CPU Architecture:x86
Tags: MYSQL SERVER, osx, preferences pane

[23 Sep 2019 16:58] John Boker
Description:
MySQL Server crashed on my dev system (as it's done in the past) so instead of trying to figure out the problem with InnoDB corruption I just went to the System Preferences and Clicked "Uninstall."

After I did that there was still a red dot in the system preferences for where an instance should have shown if it were installed.  That should not have been there and I thought it was just having trouble uninstalling.  So i clicked uninstall again.

This must have been a mistake.  The contents of /usr/local were deleted.

It looks like I'm not the only one who ran into a problem like this:  https://apple.stackexchange.com/questions/365322/uninstalling-a-homebrew-formula-deleted-t...

Any ideas how to get /usr/local back?  I'm hoping this gets fixed and doesn't happen again.

Here's a screencast of the problem:

https://youtu.be/zR5GDQDxZnY

How to repeat:
Uninstall mysql twice from the preferences pane in macos.
[27 Sep 2019 14:28] MySQL Verification Team
Hi Mr. Boker,

Thank you for your bug report.

However, this is not MySQL bug.

This is how macOS function. That dot represents the location where MySQL binaries have been installed, which in your case is /usr/local. Hence, you instructed macOS to remove that directory (with all of its contents) too.

We can not help you with that.

Not a bug.
[27 Sep 2019 15:05] John Boker
Thank you for your response.

Are you saying apple manages the MySQL preferences pane and they are the ones who wrote the uninstall script?
[30 Sep 2019 11:57] MySQL Verification Team
Hi,

In short term, our uninstaller calls API for that function that manages the whole process. That API is written by Apple, so write to them.
[18 Oct 2019 14:03] MySQL Verification Team
Hi,

It turns out that this bug is a duplicate of the bug:

https://bugs.mysql.com/bug.php?id=97201