当你在macOS下通过DMG文件安装MySQL 之后。。。。
你可能会遇到这两个头疼的提示:
error1
Unable to connect to host 127.0.0.1 because access was denied.
Double-check your username and password and ensure that access from your current location is permitted.
MySQL said: Access denied for user 'root'@'localhost' (using password: YES)
复制代码
error2
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: Your password has expired. To log in you must change it using a client that supports expired passwords.
复制代码
不是每个人都会碰到这个问题,但是我确实都碰到了,这里面坑也比较多,独立解决这些问题,也是对你本身基础知识的一次检查,所以我更倾向于大家先独立排查,如果还是没解决再来看下文。另外说一句,如果你是在laravel官方推荐的Homestead环境中的话,可能不会碰到这几个问题。