将Laravel(与代客)连接到Sequel Pro,如何解决问题?

时间:2019-09-18 01:43:31

标签: laravel laravel-valet

我已经通过git pull成功地运行了Laravel应用程序,但是事实证明连接到Sequel Pro(MAMP)数据库非常困难。

这是错误

  

compiled.php第11774行中的InvalidArgumentException:未配置数据库[]

是因为我需要在特定的laravel安装中运行SQL吗?

其次:

  在p.php第11774行中的

  在DatabaseManager-> getConfig(null)的compile.php行11739中   在Compiled.php第11702行的DatabaseManager-> makeConnection(null)处   在DatabaseManager-> connection(null)处的configure.php行11578   在Model.:resolveConnection(null)处在compiled.php第11565行   在Model。> getConnection()的compile.php行10972中   在Model-> newBaseQueryBuilder()的compile.php行10963中   在Model。> newQueryWithoutScopes()中的compiled.php 10950行   在Model。> newQuery()中的已编译.php行1026   在EloquentUserProvider-> retrieveByCredentials(array('email'=>'henry.xxx@xxx.com','password'=>'xxx'))中,在php.611行中   在SessionGuard-> attempt(array('email'=>'henry.xxx@xxx.com','password'=>'Henry1301budon7a'),false)在configure.php第2477行中   在AuthController-> login(object(Request))   在build.php行9424中的call_user_func_array(array(object(AuthController),'login'),array(object(Request)))中   在Controller .-> callAction('login',array(object(Request)))中的已编译.php行9486   在Compiler.php第9466行的ControllerDispatcher-> call(object(AuthController),object(Route),'login')中   在ControllerDispatcher-> Illuminate \ Routing {closure}(object(Request))   在Pipeline.php第52行的call_user_func(object(Closure),object(Request))中   在RedirectIfAuthenticated.php第24行的Pipeline-> Illuminate \ Routing {closure}(object(Request))   在RedirectIfAuthenticated-> handle(object(Request),object(Closure))   在build.php第9963行的call_user_func_array(array(object(RedirectIfAuthenticated),'handle'),array(object(Request),object(Closure)))中   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在管道-> Illuminate \ Routing {关闭}(对象(请求))   在comped.php第9948行的call_user_func(object(Closure),object(Request))中   在pipeline-> then(object(Closure))中的compiled.php行9467   在Controller.Dispatcher-> callWithinStack(object(AuthController),object(Route),object(Request),'login')中的代码.php第9454行   在Controller.Dispatcher-> dispatch(object(Route),object(Request),'App \ Http \ Controllers \ Auth \ AuthController','login')中,在PHP.php第8524行中   在Route .-> runController(object(Request))中的已编译.php第8511行   在Route。> run(object(Request))在comped.php第8225行   在路由器-> Illuminate \ Routing {关闭}(对象(请求))   在Pipeline.php第52行的call_user_func(object(Closure),object(Request))中   在HttpsProtocol.php第15行中的Pipeline-> Illuminate \ Routing {closure}(object(Request))   在HttpsProtocol-> handle(object(Request),object(Closure))   在comped.php第9963行中的call_user_func_array(array(object(HttpsProtocol),'handle'),array(object(Request),object(Closure)))处   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在pipeline-> Illuminate \ Routing {关闭}(对象(请求))在compiled.php第3225行   在VerifyCsrfToken-> handle(object(Request),object(Closure))   在build.php第9963行的call_user_func_array(array(object(VerifyCsrfToken),'handle'),array(object(Request),object(Closure)))中   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在pipeline-> Illuminate \ Routing {关闭}(对象(请求))在compiled.php行13474中   在ShareErrorsFromSession-> handle(object(Request),object(Closure))   在build.php第9963行的call_user_func_array(array(object(Share(ShareErrorsFromSession),'handle'),array(object(Request),object(Closure))))   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在pipeline-> Illuminate \ Routing {关闭}(对象(请求))在compiled.php 11964行中   在StartSession-> handle(object(Request),object(Closure))   在comped.php第9963行的call_user_func_array(array(object(StartSession),'handle'),array(object(Request),object(Closure)))中   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在pipeline-> Illuminate \ Routing {关闭}(对象(请求))在compiled.php行13213中   在AddQueuedCookiesToResponse-> handle(object(Request),object(Closure))处   在build.php第9963行的call_user_func_array(array(object(Add(QueuedCookiesToResponse),'handle'),array(object(Request),object(Closure))))中   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在pipeline-> Illuminate \ Routing {关闭}(对象(请求))在compiled.php行13150中   在EncryptCookies-> handle(object(Request),object(Closure))   在edit.php第9963行的call_user_func_array(array(object(EncryptCookies),'handle'),array(object(Request),object(Closure)))处   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在管道-> Illuminate \ Routing {关闭}(对象(请求))   在comped.php第9948行的call_user_func(object(Closure),object(Request))中   在pipeline-> then(object(Closure))中的已编译.php行8226   在Router-> runRouteWithinStack(object(Route),object(Request))中的已编译.php第8217行   在Router-> dispatchToRoute(object(Request))中的已编译.php第8207行   在Router-> dispatch(object(Request))中的已编译.php第2419行   在内核-> Illuminate \ Foundation \ Http {closure}(对象(请求))   在Pipeline.php第52行的call_user_func(object(Closure),object(Request))中   在pipeline-> Illuminate \ Routing {关闭}(对象(请求))在compiled.php第3286行   在CheckForMaintenanceMode-> handle(object(Request),object(Closure))   在comped.php第9963行中的call_user_func_array(array(object(Check(Main)),'handle'),array(object(Request),object(Closure))))   在Pipeline-> Illuminate \ Pipeline {closure}(object(Request))   在Pipeline.php第32行的call_user_func(object(Closure),object(Request))中   在管道-> Illuminate \ Routing {关闭}(对象(请求))   在comped.php第9948行的call_user_func(object(Closure),object(Request))中   在Pipeline-> then(object(Closure))中的已编译.php行2366中   在Kernel-> sendRequestThroughRouter(object(Request))中,在configure.php第2350行   在index.php第53行的Kernel-> handle(object(Request))   在server.php第158行的require('/ Users / henry / sites / nestdb2017 / public / index.php')中

这是我的.env文件:

APP_ENV=localwg
APP_KEY=base64:qzPgRKOqqbVN86K27CNKEPkBjPTKnXaFGs7ubsHtAYg=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://nestdb.local
APP_TIMEZONE = Asia/Hong_Kong

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nestlaravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

MY_HOST=nestdb.local
PRODUCTION_SERVER=1
HOST_ROOT=http://nestdb2017.test/

您能看到问题所在吗?

1 个答案:

答案 0 :(得分:0)

答案是我缺少config / database.php文件(奇怪的是没有从git中拉出文件-也许是安全性?)