#mac #terminal #tools

A while ago, MySQL version 9 was released and I wanted to keep using version 8 to stay in sync with our production systems.

I found out that Homebrew allows you to pin packages to a specific version so that won't accidentally get upgraded when running brew upgrade. Here's how you can do it:

1brew pin mysql

Once you've pinned a package, it won't be upgraded when running brew upgrade:

1brew upgrade
Warning: Not upgrading 1 pinned package:
mysql 9.0.1_1

To unpin a package, you can use the unpin command:

1brew unpin mysql

You can also list all pinned packages:

1brew list --pinned