mySQL Homebrew – Couldn’t connect to host

This article was published 8 years ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

After wiping my mac and starting fresh, I was having issues trying to install mySQL via homebrew. The connection to the download server kept timing out.

$ brew install mysql
==> Downloading http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.15.tar.gz

curl: (7) couldn't connect to host
Error: Download failed: http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.15.tar.gz

As it turns out, downloads.mysql.com doesn’t exist any more, so you’ll need to grab it from somewhere else and move it to the Homebrew cache directory. The following bit of code will do it for you:

curl ftp://ftp.ntua.gr/pub/databases/mysql/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz > mysql-5.5.15.tar.gz
mv mysql-5.5.15.tar.gz `brew --cache` 
brew install mysql

This downloads the code from another location and moves it into the Homebrew cache path, meaning that the recipe can find the source. You’ll need to make sure that you’re grabbing the correct version (5.5.15 at the time of writing), or homebrew might kick up a fuss.

Thoughts on this post

Leave a comment?

Leave a Reply