Search code examples
mysqlmacoshomebrewdatagrip

Can't connect to MySQL @127.0.0.1 installed via Homebrew


Trying to set up my local database in DataGrip. I installed mysql@5.7 via Homebrew. I did brew services list and it confirmed that mysql@5.7 is started.

I try to add this database with the following settings:

host: 127.0.0.1
port: 3306
user: root
pass: (null)

It keeps telling me connection refused. I'm not sure why. I've installed the most recent MySQL driver in DataGrip as well, which did not correct the issue.

I've also checked my.cnf and the IP is set to 127.0.0.1.


Solution

  • Turns out I had old files from a previous MySQL install that was conflicting with @5.7.

    I had to just uninstall all versions, rm all of leftover files, then re-install @5.7 and it worked great.