Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.6 MySQL Server has gone away

Tags:

php

mysql

laravel

Background

I have a basic Laravel application that was working just fine. I ran a php artisan make:auth on it, migrated, registered a new user and was able to login and view the home.blade.php. I'm using valet to serve the site, and have parked it in the directory.

I'm not using Homestead, just using my local machine.

What caused the issue

I ran a brew update / brew upgrade, and now am unable to login to the application at all.

Expected outcome

Login to the application and view the home.blade.php

Errors being thrown

PDOException (2006) SQLSTATE[HY000] [2006] MySQL server has gone away shows in the browser.

PDOException(code: 0): PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109 shows up in the Laravel logs.

I suspect it has something to do with user privileges with MySQL, although I'm just at a stand-still here, so I thought I'd toss it out to the Obi-Wan's of the computer world.

What works

I can still view the welcome.blade.php in the browser, and pinging the server returns a response, so that works.

I can login to MySQL through the terminal as root no problem.

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)

My database exists

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>

My Setup

PHP Version

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

Nginx Version

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

MySQL Version

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

Valet Version

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 - Updated this, still no luck The contents of my /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

My .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}"

My 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,
        ],

    ],

];

Recent entries in the log

[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}
"} 

What I've been trying:

  • mysql> GRANT ALL PRIVILEGES ON digitalchef.* TO 'root'@'localhost'; but no dice.
  • I've restarted nginx, php, mysql.
  • I looked at this answer: Set modes in the database.php
  • And tried running through these steps: Create a new user and grant privileges
  • I've been reading up here PHP Bug 76651 and it seems like it's an issue with PHP 7.2.8.

I'd prefer not to have to roll-back to 7.2.7, but if that's the only option then I guess I'm between a rock and a hard place and don't have any choice.

Any assistance would be great. If you need some more information about anything, just ask away and I'll answer. Thank you very much in advance!

like image 784
FullStackOfPancakes Avatar asked Sep 10 '18 18:09

FullStackOfPancakes


Video Answer


3 Answers

This worked for me. I used the following command to update my password with new authentication plugin. You can use MySQL 8 now. Have fun.

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

If above doesn't work use this instead.

ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
like image 112
Ganesh Avatar answered Nov 14 '22 03:11

Ganesh


if the msyql client is normal ,only the php7 script has problem, you can check the php.ini (mysqlnd.net_read_timeout)

like image 20
Rupeng Xing Avatar answered Nov 14 '22 02:11

Rupeng Xing


Got this sorted out! Woohoo! Thank you again to everyone for all of the advice, I really appreciated the assistance.

How I Resolved:

Digging deeper into this, I noticed that I had 2 versions of MySQL installed - 5.7 & 8.0.

  • I uninstalled [email protected] via homebrew
  • Linked the correct version
  • I updated my $PATH
    • sudo nano ~/.bash_profile
    • And added the following line in place of the 5.7:
    • export PATH="/usr/local/opt/[email protected]/bin:$PATH"
  • I followed @poohbear 's answer here about altering the mysql user
  • Then, I truncated the user table on the Laravel database from the mysql prompt
    • mysql -u root -p
    • mysql> USE digitalchef;
    • mysql> TRUNCATE TABLE users;

I don't know if it accomplished anything after the fact, but I made sure to run a php artisan config:cache afterwards, just for good measure.

Hopefully this helps someone out who is struggling with this! Thank you all again for the support, and @poohbear deserves mad credit for his answer.

like image 36
FullStackOfPancakes Avatar answered Nov 14 '22 02:11

FullStackOfPancakes