質問編集履歴

1

2022/02/13 00:19

投稿

test
test

スコア2

test CHANGED
File without changes
test CHANGED
@@ -1,103 +1,44 @@
1
1
  ### 前提・実現したいこと
2
-
3
2
  使っているパソコンはwindows。MAMPを使っています。
4
-
5
3
  PHP(Laravel) コマンドプロンプトでphp artisan migrateと打ってテーブルを作りたいです。
6
4
 
7
-
8
-
9
5
  php artisan migrateと入力して以下のエラーが出ました。
10
-
11
6
  ### 発生している問題・エラーメッセージ
12
7
 
13
-
14
-
15
8
  ```
16
-
17
9
  Illuminate\Database\QueryException
18
-
19
-
20
10
 
21
11
  could not find driver (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations and table_type = 'BASE TABLE')
22
12
 
23
-
24
-
25
13
  at C:\MAMP\htdocs\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671
26
-
27
14
  667| // If an exception occurs when attempting to run a query, we'll format the error
28
-
29
15
  668| // message to include the bindings with SQL, which will make this exception a
30
-
31
16
  669| // lot more helpful to the developer instead of just the database's errors.
32
-
33
17
  670| catch (Exception $e) {
34
-
35
18
  > 671| throw new QueryException(
36
-
37
19
  672| $query, $this->prepareBindings($bindings), $e
38
-
39
20
  673| );
40
-
41
21
  674| }
42
-
43
22
  675|
44
23
 
45
-
46
-
47
24
  1 C:\MAMP\htdocs\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
48
-
49
25
  PDOException::("could not find driver")
50
26
 
51
-
52
-
53
27
  2 C:\MAMP\htdocs\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
54
-
55
28
  PDO::__construct("mysql:unix_socket=C:\MAMP\tmp\mysql\mysql.sock;dbname=blog", "root", "root", [])
56
-
57
29
  ```
58
-
59
-
60
30
 
61
31
  ### 該当のソースコード
62
32
 
63
-
64
-
65
33
  ```
66
-
67
34
  cd C:/MAMP/htdocs/blog
68
-
69
35
  dir
70
-
71
36
  php artisan migrate
72
-
73
37
  ```
74
-
75
-
76
38
 
77
39
  ### 試したこと
78
40
 
79
- youtubeでLaravelを学んでいてエラーが発生しました。
80
-
81
- youtubeのリンク↓
82
-
83
- https://www.youtube.com/watch?v=plDBsStXuO4&t=684s(マイグレーションでテーブル作成)
84
-
85
-
86
-
87
- 11:10のphp artisan migrateでエラー。
88
41
 
89
42
  ### 補足情報(FW/ツールのバージョンなど)
90
43
 
91
44
 
92
-
93
- 試したことの動画の一つ前の動画です。この動画でLaravelの環境構築をしました。
94
-
95
- https://www.youtube.com/watch?v=yaitzPzBzuI(環境構築)
96
-
97
-
98
-
99
- ・コマンドでcomposerインストールできなかったためサイトからインストールしました。
100
-
101
- ・chmod -R 777 storage と chmod -R 777 bootstrap/cache のコマンドは使ってないです。
102
-
103
- ・11:05において、私のMAMPにはSocketが書いてなかったので入力してないです