简体   繁体   中英

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!

编辑/etc/mysql/my.cnf并添加配置选项skip-name-resolve成功了!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM