web-dev-qa-db-fra.com

Laravel 5.6 Le serveur MySQL est parti

Contexte

J'ai une application de base Laravel qui fonctionnait parfaitement. J'ai couru un php artisan make:auth dessus, migré, enregistré un nouvel utilisateur et réussi à me connecter et à voir le home.blade.php. J'utilise valet pour servir le site et je l'ai parqué dans le répertoire.

Je n'utilise pas Homestead, mais simplement mon ordinateur local. 

Quelle est la cause du problème 

J'ai couru un brew update / brew upgrade, et je ne parviens plus du tout à me connecter à l'application. 

Résultat attendu 

Connectez-vous à l'application et consultez le home.blade.php 

Erreurs renvoyées 

PDOException (2006) SQLSTATE[HY000] [2006] MySQL server has gone away s'affiche dans le navigateur.

PDOException(code: 0): PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109 apparaît dans les journaux Laravel.

Je (suspect} _ cela a quelque chose à voir avec les privilèges de l'utilisateur avec MySQL, bien que je sois juste au point mort, alors j'ai pensé le jeter aux Obi-Wan du monde de l'informatique. 

Ce qui fonctionne 

Je peux toujours afficher le fichier welcome.blade.php dans le navigateur, et l'envoi d'une requête ping au serveur renvoie une réponse, ce qui fonctionne.

Je peux me connecter à MySQL via le terminal en tant que root, pas de problème. 

mysql -u root -p

mysql> SELECT user, Host FROM mysql.user;
+------------------+-----------+
| user             | Host      |
+------------------+-----------+
| jason            | %         |
| jason            | localhost |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
6 rows in set (0.00 sec)

Ma base de données existe

mysql> show tables;
+-----------------------+
| Tables_in_digitalchef |
+-----------------------+
| migrations            |
| model_has_permissions |
| model_has_roles       |
| orders                |
| password_resets       |
| permissions           |
| role_has_permissions  |
| roles                 |
| users                 |
+-----------------------+
9 rows in set (0.00 sec)

mysql>

Ma configuration 

Version PHP

jason@Jasons-MacBook-Air:~/Desktop/websites$ php -v
PHP 7.2.8 (cli) (built: Jul 19 2018 12:15:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.8, Copyright (c) 1999-2018, by Zend Technologies

Version Nginx 

jason@Jasons-MacBook-Air:~/Desktop/websites$ nginx -v
nginx version: nginx/1.15.3

Version MySQL

jason@Jasons-MacBook-Air:~$ mysql --version
mysql  Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)

Version avec voiturier

Laravel Valet 2.0.9

$ PATH 

jason@Jasons-MacBook-Air:~$ echo $PATH
/usr/local/opt/[email protected]/bin:/usr/local/sbin:/Users/jason/.composer/vendor/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin/python3:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

EDIT - Mise à jour, toujours pas de chance Le contenu de mon /etc/my.cnf:

[mysqld]
max_allowed_packet = 500M
wait_timeout = 58800
ssl-ca=/etc/mysql-ssl/ca-cert.pem
ssl-cert=/etc/mysql-ssl/server-cert.pem
ssl-key=/etc/mysql-ssl/server-key.pem

Mon .env 

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:/rKbcwAqCwbNt9XNBZq1jzvRzi7K4Jdch3k5/OtUgis=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_Host=127.0.0.1
DB_PORT=3306
DB_DATABASE=digitalchef
DB_USERNAME=root
DB_PASSWORD=root

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

REDIS_Host=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

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

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

Mon database.php 

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Default Database Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all database work. Of course
    | you may use many connections at once using the Database library.
    |
    */

    'default' => env('DB_CONNECTION', 'mysql'),

    /*
    |--------------------------------------------------------------------------
    | Database Connections
    |--------------------------------------------------------------------------
    |
    | Here are each of the database connections setup for your application.
    | Of course, examples of configuring each database platform that is
    | supported by Laravel is shown below to make development simple.
    |
    |
    | All database work in Laravel is done through the PHP PDO facilities
    | so make sure you have the driver for your particular database of
    | choice installed on your machine before you begin development.
    |
    */

    'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
        ],

        'mysql' => [
            'driver' => 'mysql',
            'Host' => env('DB_Host', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],

        'pgsql' => [
            'driver' => 'pgsql',
            'Host' => env('DB_Host', '127.0.0.1'),
            'port' => env('DB_PORT', '5432'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],

        'sqlsrv' => [
            'driver' => 'sqlsrv',
            'Host' => env('DB_Host', 'localhost'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Migration Repository Table
    |--------------------------------------------------------------------------
    |
    | This table keeps track of all the migrations that have already run for
    | your application. Using this information, we can determine which of
    | the migrations on disk haven't actually been run in the database.
    |
    */

    'migrations' => 'migrations',

    /*
    |--------------------------------------------------------------------------
    | Redis Databases
    |--------------------------------------------------------------------------
    |
    | Redis is an open source, fast, and advanced key-value store that also
    | provides a richer set of commands than a typical key-value systems
    | such as APC or Memcached. Laravel makes it easy to Dig right in.
    |
    */

    'redis' => [

        'client' => 'predis',

        'default' => [
            'Host' => env('REDIS_Host', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => 0,
        ],

    ],

];

Entrées récentes dans le journal

[2018-09-10 18:15:26] local.ERROR: SQLSTATE[HY000] [2006] MySQL server has gone away {"exception":"[object] (PDOException(code: 2006): SQLSTATE[HY000] [2006] MySQL server has gone away at /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68, PDOException(code: 0): PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109 at /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68)
[stacktrace]
#0 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(68): PDO->__construct('mysql:Host=127....', 'root', 'root', Array)
#1 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(98): Illuminate\\Database\\Connectors\\Connector->createPdoConnection('mysql:Host=127....', 'root', 'root', Array)
#2 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(48): Illuminate\\Database\\Connectors\\Connector->tryAgainIfCausedByLostConnection(Object(PDOException), 'mysql:Host=127....', 'root', 'root', Array)
#3 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\\Database\\Connectors\\Connector->createConnection('mysql:Host=127....', Array, Array)
#4 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(182): Illuminate\\Database\\Connectors\\MySqlConnector->connect(Array)
#5 [internal function]: Illuminate\\Database\\Connectors\\ConnectionFactory->Illuminate\\Database\\Connectors\\{closure}()
#6 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func(Object(Closure))
#7 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(248): Illuminate\\Database\\Connection->getPdo()
#8 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(234): Illuminate\\Database\\DatabaseManager->refreshPdoConnections('mysql')
#9 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(168): Illuminate\\Database\\DatabaseManager->reconnect('mysql')
#10 [internal function]: Illuminate\\Database\\DatabaseManager->Illuminate\\Database\\{closure}(Object(Illuminate\\Database\\MySqlConnection))
#11 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): call_user_func(Object(Closure), Object(Illuminate\\Database\\MySqlConnection))
#12 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connection.php(735): Illuminate\\Database\\Connection->reconnect()
#13 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connection.php(717): Illuminate\\Database\\Connection->tryAgainIfCausedByLostConnection(Object(Illuminate\\Database\\QueryException), 'select * from `...', Array, Object(Closure))
#14 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connection.php(627): Illuminate\\Database\\Connection->handleQueryException(Object(Illuminate\\Database\\QueryException), 'select * from `...', Array, Object(Closure))
#15 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\\Database\\Connection->run('select * from `...', Array, Object(Closure))
#16 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1963): Illuminate\\Database\\Connection->select('select * from `...', Array, true)
#17 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1951): Illuminate\\Database\\Query\\Builder->runSelect()
#18 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2435): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#19 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1952): Illuminate\\Database\\Query\\Builder->onceWithColumns(Array, Object(Closure))
#20 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(481): Illuminate\\Database\\Query\\Builder->get(Array)
#21 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(465): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)
#22 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(77): Illuminate\\Database\\Eloquent\\Builder->get(Array)
#23 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php(128): Illuminate\\Database\\Eloquent\\Builder->first()
#24 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php(352): Illuminate\\Auth\\EloquentUserProvider->retrieveByCredentials(Array)
#25 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php(79): Illuminate\\Auth\\SessionGuard->attempt(Array, false)
#26 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php(44): App\\Http\\Controllers\\Auth\\LoginController->attemptLogin(Object(Illuminate\\Http\\Request))
#27 [internal function]: App\\Http\\Controllers\\Auth\\LoginController->login(Object(Illuminate\\Http\\Request))
#28 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#29 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('login', Array)
#30 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Route.php(212): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\Auth\\LoginController), 'login')
#31 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Route.php(169): Illuminate\\Routing\\Route->runController()
#32 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Router.php(665): Illuminate\\Routing\\Route->run()
#33 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#34 /Users/jason/Desktop/websites/restaurant/digitalchef/app/Http/Middleware/RedirectIfAuthenticated.php(24): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#35 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): App\\Http\\Middleware\\RedirectIfAuthenticated->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#38 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#40 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(68): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#41 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#42 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#43 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#44 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#47 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#50 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#53 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#56 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#57 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Router.php(642): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#58 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Router.php(608): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#59 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Router.php(597): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#60 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#61 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#62 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#63 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#64 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#65 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#66 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#67 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#68 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#69 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#70 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#71 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#72 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#73 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#74 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#75 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#76 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#77 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#78 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#79 /Users/jason/Desktop/websites/restaurant/digitalchef/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#80 /Users/jason/Desktop/websites/restaurant/digitalchef/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#81 /Users/jason/.composer/vendor/laravel/valet/server.php(147): require('/Users/jason/De...')
#82 {main}
"} 

Ce que j'ai essayé:

Je préférerais ne pas avoir à revenir à la version 7.2.7, mais si c'est la seule option, alors je suppose que je suis entre le marteau et l'enclume et que je n'ai pas le choix.

Toute aide serait formidable. Si vous avez besoin de plus d’informations sur quelque chose, il suffit de demander et je vous répondrai. Merci beaucoup d'avance!

5

J'ai réglé ça! Woohoo! Merci encore à tous pour tous les conseils, j'ai vraiment apprécié l'aide.

Comment j'ai résolu:

En approfondissant cela, j'ai remarqué que j'avais 2 versions de MySQL installées - 5.7 et 8.0.

  • J'ai désinstallé [email protected] via homebrew .____.
  • Lié la bonne version
  • J'ai mis à jour mon $ PATH
    • Sudo nano ~/.bash_profile
    • Et ajouté la ligne suivante à la place du 5.7: 
    • export PATH="/usr/local/opt/[email protected]/bin:$PATH"
  • J'ai suivi la réponse de @poohbear ici à propos de la modification de l'utilisateur mysql 
  • Ensuite, j'ai tronqué la table utilisateur de la base de données Laravel à partir de l'invite mysql
    • mysql -u root -p
    • mysql> USE digitalchef;
    • mysql> TRUNCATE TABLE users;

Je ne sais pas si cela a permis d'accomplir quoi que ce soit après coup, mais je me suis assuré de lancer un php artisan config:cache après, juste pour faire bonne mesure. 

Espérons que cela aide quelqu'un qui se bat avec ça! Merci encore à tous pour votre soutien, et @poohbear mérite un crédit fou pour sa réponse. 

0

Cela a fonctionné pour moi. J'ai utilisé la commande suivante pour mettre à jour mon mot de passe avec le nouveau plugin d'authentification. Vous pouvez utiliser MySQL 8 maintenant. S'amuser.

ALTER USER `username`@`localhost` IDENTIFIED WITH caching_sha2_password BY 'password';

Si ci-dessus ne fonctionne pas, utilisez ceci à la place.

ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
1
Ganesh

Installer mysql et désinstaller mysql/maria db ne résoudra pas le problème. Cela peut arriver pour plusieurs raisons.

Cela indique généralement des problèmes de connexion au serveur MySQL ou des délais d'attente. 

Vous pouvez ajuster les paramètres dans my.cnf en ajustant wait_timeout et max_allowed_packet.

Essayez de le régler à un niveau plus élevé, continuez à ajuster les paramètres jusqu'à ce que vous obteniez la bonne réponse. Assurez-vous de redémarrer mysql après avoir apporté ces modifications. 

wait_timeout = 28800

max_allowed_packet = 8M

Voici une bonne explication de ce que vous devez changer 

https://www.digitalocean.com/community/questions/mysql-server-has-gone-away

0
unixmiah