This is not a post that most of my readers will generally need to worry about, but instead this is more of a PSA for those of you that are running MacOS Sierra and are web developers. Currently, as of beta4 of the developer preview of MacOS Sierra, there are problems when downloading the latest version of MySQL server.
What We Know
I have talked to other developers running this version of MacOS and confirmed that this is an issue system wide and not isolated to my machine. Here is what I know so far:
- This problem occurs when installing via the install package distributed from the MySQL Community site
- It appears to be stalling at about the 95% mark of the install
- It prevents your computer from safely rebooting (you must force a hard reboot by holding down the power button).
- Force-quitting the installer does not kill the install process (it seems to run in the background
- It prevents you from installing older versions of MySQL or “re-installing” MySQL
It does appear that the problem is not with MySQL 5.7 itself, but rather with the install script. This assumption is made because it appears those users who had successfully installed MySQL 5.7 on previous versions of MacOS and then upgraded to MacOS Sierra are unaffected. The database itself seems to work, it is the install process that breaks. I hope this helps any Oracle tech reading this right now.
I noticed the problem because I had wiped my harddrive clean before upgrading. So a re-install was necessary for me.
Older versions of the installer also seem to work. I was able to install the “latest” version of 5.6, but not any version of 5.7.
I need MySQL, What do I do?
Right? We all need a little MySQL in our lives. For those of you that make a living by developing web apps that run off Mysql in the background (oh right, thats me!) then you still need to find a way to make this work. Luckily for you, some poor soul (that’s me again…) is about to open up the kimono and tell you all my secrets.
Hint: you and your terminal need to be BFF’s to continue.
Step 1: Kill MySQL Install Process
- Press Command + Option + Escape (all together like they are having a three-way) and kill your “installer” process.
- Close everything on your computer and then hold down the power key until the last whisper of life hisses out of your Mac.
- Pray to whatever Deity you pray to, that everything is going to be ok
- Press the power button again to awaken the beast
Ok, so that might have been drawn out, but I am getting to the point I am bored, so I had to entertain myself. I promise the next part is far more important.
Step 2: Remove (“Uninstall”) any sign of MySQL
So here is the deal, you have 98% of MySQL installed right now on your computer. The problem is that without that extra 2% you are pretty much screwed. Ok, actually that is putting it too nicely, you are completely fucked! It won’t work at all, there was even this guy once that tried to make it work and failed miserably (oh shoot, that idiot that thought it might work was me again).
Alright, now let’s perform the exorcism of MySQL 5.7!
Stop MySQL first if you can (I couldn’t my computer started to hang again)
In your terminal type these commands, in this order. One line at a time. No one likes someone who rushes through these things that need a little patience to happen (just ask your girlfriend/wife).
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
This step will open a text editor inside of your terminal, you want to delete the line that says
MYSQLCOM=-YES- if you have one. When you are done you can press Ctr+X and then Y to confirm save and then press ENTER to save again.
Yes I recognize someone will want to use vim or emacs and I really don’t give a shit. Go ahead and use them. Please don’t tell me how much better they are then Nano, because I know they are better, Nano is just simpler for those that have never used a terminal editor before.
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
That is it! You are successfully uninstalled. Those last three statements that use the term “Reciepts” in the command are especially important to do, because they are what tells the next installer we are about to use that there is already a version of MySQL installed. If you don’t delete those (thats what our commands are doing is deleting them) then the next installer won’t let you use it, thinking that MySQL is already installed. This removes it without a trace.
Step 3 – Install MySQL v5.6
So now we are going to install version 5.6 instead of 5.7. Unfortunately that means you won’t be making any JSON columns anytime soon, but then again I guess we survived (barely…) for 20 years without them. Glad Oracle finally got around to it.
Go to the MySQL Community Site and Download version 5.6 instead. This will install fine and hopefully soon, an Oracle technician will knock on my door and tell me that they got version 5.7 working and I can upgrade. Actually please don’t do that Oracle, do not knock on my door. That would be creepy. But you can leave a comment below if you like.
This is where you install version 5.6 if you missed the link above because you were too lazy to read the whole article and are skimming:
If you found this helpful, I would love the comments below letting me know that this worked and telling Oracle that this is really a problem.