Homebrew, MySQL 8 support
Asked Answered
B

4

25

Anyone have the inside scoop on when Homebrew will be updated to support MySQL 8's first general release (8.0.11)? I can't seem to find it by searching, but I bet someone here knows :)

Bicapsular answered 2/5, 2018 at 2:56 Comment(1)
++ following...Parfleche
M
47

Homebrew pushed MySQL 8.0.11 as an upgrade yesterday (Wed, 13 June 2018). I thought I had it pinned, but no such luck.

It's a total disaster:

MySQL 8.0.11 uses caching_sha2_password as the default authentication method (leave it to Oracle to do something like this in a point release, but there you have it).

So far, it breaks everything I've tried: phpMyAdmin, Nextcloud, and WordPress.

I'll be rolling back to 5.7.22 later today.

Update 17 June 2018 6:50PM CDT:

Three step solution:

  1. Add to [mysqld] section of my.cnf file (found in /usr/local/etc/ for Homebrew's installation):

    default-authentication-plugin=mysql_native_password
    
  2. At shell prompt:

    mysql -u root -p
    
    > ALTER USER 'root'@'localhost'
       IDENTIFIED WITH mysql_native_password
       BY '[password]';
    
    > exit
    
  3. Reboot server

    brew services restart mysql
    

Short version solution

Long version solution

Update 18 June 2018 11:53PM CDT:

The solution provided above is partial, at best. In my experience MySQL 8.0.11 is not nearly ready for production (or even development) use.

Marplot answered 14/6, 2018 at 6:54 Comment(12)
It is complete insanity that brew rolled out 8.0 as upgrade to 5.7.Fabrication
since 8.0 cannot be downgraded to 5.7 without having backup of database prior to upgrade. also, update did not check if my database/tables can run under 8.0. as suggested in 8.0 upgrade scenarios dev.mysql.com/doc/refman/8.0/en/upgrading-strategies.html mysqlcheck -u root -p --all-databases --check-upgrade by running this, brew could easily see that my db cannot work on 8.0, before it did the upgrade.Fabrication
I had the luck to be able to roll back and keep all my databases intact with brew remove mysql and brew install [email protected].Stantonstanway
I didn't have any joy rolling back after the 8.x upgrade, but fortunately I had a Time Machine backup of /usr/local/var/mysql from which I was able to restore. After removing MySQL 8 (brew remove mysql) and then installing 5.7 again (brew install [email protected]) as directed above it's working again.Lineage
I've been dinking with this all day after everything exploded when I updated Brew. I don't want anything to do with MySQL 8 so I ran the brew remove mysql command and then brew install [email protected] which gives me 5.7 back, but when I try to log into it via the command line using mysql -uroot, I get the following error. It's maddening. Any ideas on what might be going on here? ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)Glassy
After installing [email protected], I can't run the mysql client. Seems like even when installing old versions, the binaries should stay the same.Repeated
@Lineage Can you be more specific? I have what I knew was a working /usr/local/var/mysql in a disk image that predates the upgrade. Are you saying I can brew remove everything related to mysql, brew reinstall [email protected] and then copy the working /usr/local/var/mysql from the image to the same path on my running instance. I assume mysql can't be running during the copy process. What about ownership and permissions of both the mysql directory and its contents.Dorinda
@JohnD. yes that's correct, just make sure you stop MySQL before you copy over from your disk image and then restart it afterwards. That's all I did. RE: ownership, I think it should be yourusername:admin and chmod 755 should be fine for permissions. I'm not an expert on that though so someone else might be able to advise?Lineage
@Lineage Thank you very much! That worked perfectly and I was able to dump out the tables successfully. I did a full removal of all traces of MySQL, both homebrew and some existing direct installations. I renamed the original /usr/local/var/mysql directory to mysql-old and then did brew install [email protected]. After starting and stopping the service I renamed /usr/local/var/mysql to mysql-new and then renamed the old one to the to mysql. Starting up took a long time but it worked.Dorinda
I rebuilt all my databases from dumps on a previous machine while setting up a new environment with 8.0.11, and rolling back was not smooth when the databases were created with 8.0.11. Had to scrap them to get 5.7 rolling.Controversial
Just wanted to say thank you for this, I thought I was going mad trying to get this working properly. As another possible workaround if this doesn't work (not entirely sure why, sorry), I've switched to using a docker container for 5.7.24 and had no problems, but I would never have believed that this is what Homebrew did without your answer here. I'm switching to use docker containers over brew installing things wherever possible as a result of this, it's completely ridiculous.Cravat
This gave me extra 2 days of restoring lost data.... Time Capsule saved me.Multiplechoice
B
3

I managed to overcome this without removing my all database which from mysql version 5.7.

First, simply upgrade database with this command

mysql_upgrade -u root

https://mcmap.net/q/79801/-mysql-error-1449-the-user-specified-as-a-definer-does-not-exist

Last. Install sequel-pro-nightly. I need this because i can browse my db from the command but not from sequal-pro. So, luckily the nightly sequel-pro works.

   brew cask install sequel-pro-nightly

Then, boom. Everything is back. Sigh.

Bytom answered 25/7, 2018 at 17:30 Comment(0)
P
2

It's waiting to be merged into homebrew-core.

https://github.com/Homebrew/homebrew-core/pull/27210

Precis answered 6/6, 2018 at 11:3 Comment(0)
B
2
  1. Removed MySql using the steps on this site.
  2. Do brew install [email protected].
  3. Go to this site and follow the instructions starting at step 4.
  4. Be sure to find out if the paths on step 5 actually exist on your machine. The paths listed on that site didn't work for me. I had to find them on my own. Start by looking in /usr/local and search out the mysql folder from there and dig until you find the files he has listed.

I stopped at step 7 because I was able to take it from there. Hopefully, you can as well.

Binder answered 15/11, 2018 at 14:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.