質問編集履歴
1
エラー等を追記します。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
【質問】
|
1
|
+
###【質問】
|
2
2
|
|
3
3
|
1.PDOエラーの解決方法や、考え方・確認方法
|
4
4
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
【現状】
|
11
|
+
###【現状】
|
12
12
|
|
13
13
|
現在Laravelの勉強をしています。
|
14
14
|
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
|
46
46
|
|
47
|
-
【ローカル環境】
|
47
|
+
###【ローカル環境】
|
48
48
|
|
49
49
|
OS: Mac
|
50
50
|
|
@@ -59,3 +59,145 @@
|
|
59
59
|
|
60
60
|
|
61
61
|
ド素人ですみませんが、どうぞよろしくお願いいたします。
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
###【+++追記+++】
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
●ターミナルでのエラー
|
70
|
+
|
71
|
+
```ここに言語を入力
|
72
|
+
|
73
|
+
Illuminate\Database\QueryException :
|
74
|
+
|
75
|
+
SQLSTATE[HY000] [2054]
|
76
|
+
|
77
|
+
The server requested authentication method unknown to the client
|
78
|
+
|
79
|
+
(SQL: select * from information_schema.tables where table_schema =
|
80
|
+
|
81
|
+
entryLaravel and table_name = migrations)
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
at ~/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
|
86
|
+
|
87
|
+
660| // If an exception occurs when attempting to run a query, we'll format the error
|
88
|
+
|
89
|
+
661| // message to include the bindings with SQL, which will make this exception a
|
90
|
+
|
91
|
+
662| // lot more helpful to the developer instead of just the database's errors.
|
92
|
+
|
93
|
+
663| catch (Exception $e) {
|
94
|
+
|
95
|
+
> 664| throw new QueryException(
|
96
|
+
|
97
|
+
665| $query, $this->prepareBindings($bindings), $e
|
98
|
+
|
99
|
+
666| );
|
100
|
+
|
101
|
+
667| }
|
102
|
+
|
103
|
+
668|
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
Exception trace:
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
1 PDOException::("PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]")
|
112
|
+
|
113
|
+
/Users/snowdog/Desktop/04_acts/00_entryLaravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=entryLaravel", "laravel", "laravel789", [])
|
118
|
+
|
119
|
+
/Users/snowdog/Desktop/04_acts/00_entryLaravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
Please use the argument -v to see more details.
|
124
|
+
|
125
|
+
```
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
●php artisan migrationコマンドで出来たファイル
|
130
|
+
|
131
|
+
```
|
132
|
+
|
133
|
+
<?php
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
use Illuminate\Support\Facades\Schema;
|
138
|
+
|
139
|
+
use Illuminate\Database\Schema\Blueprint;
|
140
|
+
|
141
|
+
use Illuminate\Database\Migrations\Migration;
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
class CrateBookTable extends Migration
|
146
|
+
|
147
|
+
{
|
148
|
+
|
149
|
+
/**
|
150
|
+
|
151
|
+
* Run the migrations.
|
152
|
+
|
153
|
+
*
|
154
|
+
|
155
|
+
* @return void
|
156
|
+
|
157
|
+
*/
|
158
|
+
|
159
|
+
public function up()
|
160
|
+
|
161
|
+
{
|
162
|
+
|
163
|
+
Schema::create('books', function (Blueprint $table) {
|
164
|
+
|
165
|
+
$table->increments('id');
|
166
|
+
|
167
|
+
$table->string('item_name');
|
168
|
+
|
169
|
+
$table->integer('item_number');
|
170
|
+
|
171
|
+
$table->integer('item_amount');
|
172
|
+
|
173
|
+
$table->datetime('published');
|
174
|
+
|
175
|
+
$table->timestamps();
|
176
|
+
|
177
|
+
});
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
/**
|
184
|
+
|
185
|
+
* Reverse the migrations.
|
186
|
+
|
187
|
+
*
|
188
|
+
|
189
|
+
* @return void
|
190
|
+
|
191
|
+
*/
|
192
|
+
|
193
|
+
public function down()
|
194
|
+
|
195
|
+
{
|
196
|
+
|
197
|
+
Schema::dropIfExists('books');
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
```
|