Fixing MySQL Connection Issues on macOS Sequoia 15.0 After Upgrading to MySQL 9

If you’ve recently upgraded to macOS Sequoia 15.0 and encountered issues with MySQL not connecting, you’re not alone! MySQL 9 introduces architectural changes that can disrupt connections, especially when upgrading directly from older MySQL versions. After some troubleshooting, I found a solution that resolved my issues quickly, and I hope it helps you, too.

Problem: MySQL Not Running After Upgrade

When trying to connect, you might see an error like this:

ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)

The core issue often arises from direct upgrades from pre-8.4 MySQL versions, as compatibility steps may be bypassed. To fix this, follow these steps:

Solution: Downgrade and Re-upgrade to Smooth Out Compatibility

  1. Stop MySQL 9.x
    First, stop any running MySQL 9.x service:
   brew services stop mysql
  1. Install MySQL 8.4
    Downgrade temporarily to MySQL 8.4:
   brew install [email protected]
  1. Start and Stop MySQL 8.4
    Start and stop MySQL 8.4 to handle database migrations and prep the system:
   brew services start [email protected]
   brew services stop [email protected]
  1. Restart MySQL 9.x
    With the migrations done, start MySQL 9.x:
   brew services start mysql
  1. Clean Up
    Finally, remove MySQL 8.4 since it’s no longer needed:
   brew remove [email protected]

Following these steps resolved the connection issues I faced on macOS Sequoia 15.0. If you’re experiencing similar issues, give it a try and get back to coding!


This streamlined guide should help others on similar paths!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *