책 6장에서 다음 명령을 실행할 때 에러 메시지가 표시됩니다.
songwangmyeong-ui-Mac-mini:myapp2 kmson$ php artisan make:migration create_posts_tables --create=posts
Created Migration: 2019_06_30_025929_create_posts_tables
songwangmyeong-ui-Mac-mini:myapp2 kmson$ php artisan make:migration created_authors_table --create=authors
Created Migration: 2019_06_30_030042_created_authors_table
songwangmyeong-ui-Mac-mini:myapp2 kmson$ php artisan migrate
Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = myapp2 and table_name = migrations and table_type = 'BASE TABLE')
at /Users/kmson/myapp2/myapp2/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]")
/Users/kmson/myapp2/myapp2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=myapp2", "homestead", "secret", [])
/Users/kmson/myapp2/myapp2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
Please use the argument -v to see more details.
참고로 데이터베이스 명은 myapp2 이고 .env 설정은 다음과 같습니다.
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:b4w3uMB+5oYB9cESu046BcFDBGmaNeKGldRNC9BTsC0=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myapp2
DB_USERNAME=homestead
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
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
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
...