How to revert from mysql 8.0.11 to a specific older version such as 5.7.21?

(Seju) #1

I recently updated mysql through brew upgrade to the newest version:

$ mysql -V
mysql Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)
Now my Ruby on Rails mysql connection stopped working.

With 5.7.21 everything was working fine

How do I switch back to 5.7.21 since 5.7.22 does not seam to work either.

(Jonatan Anriquez) #2

Try this brew install mysql@5.7

(John D.) #3

Check out this post.

I did the following:

  • completely removed all traces of MySQL from my system
  • move /usr/local/var/mysql to a /usr/local/var/mysql-old
  • brew install mysql@5.7
  • start and stop the server
  • rename the newly formed /usr/local/var/mysql to /usr/local/var/mysql-new
  • rename /usr/local/var/mysql-old to /usr/local/var/mysql
  • start the server

(Seju) #4

Thank you both so much! I lost a whole day figuring out why my development system stopped working and how to get it running back again!

Thank you Jonatan for you hind. I already had 5.7 installed.
Thank’s John for your link and suggestion.

In the end it was enough to:

$ brew info mysql (to get info about the installed versions)
$ brew switch mysql 5.7.21 (to switch to a stable version)

I just could not believe that a full release could screw up my system.

Now the server, the mysql gems as well as connection are working again…

There was no need to uninstall mysql 8 in my case.

The point with MySQL is that I have to configure it so seldomly that when there is a problem I have always to start from scratch …