user101289
user101289

Reputation: 10422

Laravel Homestead / mysql on El Capitan fails to connect

Since upgrading to El Capitan, I've been unable to connect to mysql on a Homestead instance. This happens on both a Macbook Air and a Macbook Pro, and on both machines I've updated Vagrant, VirtualBox and Homestead to the latest versions.

I've deleted my .vagrant-d directory and destroyed / re-upped my Homestead box.

I've tried using SQLPro and mysql workbench-- both fail to connect.

The error from SQLPro is:

Unable to connect to host 127.0.0.1, or the request timed out.

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).

MySQL said: Can't connect to MySQL server on '127.0.0.1' (4)

From the command line I also fail to connect, with the following error:

➜  ~  mysql -h 127.0.0.1 -u homestead -psecret -P 33060
Warning: Using a password on the command line interface can be insecure.
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0

This issue has basically killed my productivity for almost a week. I've tried pretty much everything I can think of. My SSH keys are fine, since I can SSH into the Homestead box, and I know mysql is running there since I can connect to mysql from within the SSH session.

Does anyone have any idea how to connect or at least troubleshoot this?

Thanks!

Upvotes: 2

Views: 479

Answers (1)

user101289
user101289

Reputation: 10422

Editing /etc/mysql/my.cnf and adding the configuration option skip-name-resolve did the trick!

Upvotes: 2

Related Questions