解决方法: 1.在.env中加上UNIX_SOCKET,首先要找到mysql.sock的路径 2.在config/database.php中加上'unix_socket' => env('UNIX_SOCKET'),