4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【初心者】Laravelでmigrateするのに手こずった話

Last updated at Posted at 2019-07-04

#環境
・windows10
・PHP(7.3.6)
・Laravel(5.8.27)
・MariaDB

マイグレーションの設定に手こずったので記録用に
#問題
artisanでPostモデルを作成

model Post --migration

そして以下のコマンドを入力すると

php artisan migrate

エラーが発生

  Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 
'root'@'localhost' (using password: YES) (SQL: select * from information_schema.tables
 where table_schema = test and table_name = migrations and table_type = 'BASE TABLE')

#解決
こちらのサイトが参考になりました
・[「Access denied for user ‘abcd’@’localhost’」と表示される]
(https://php1st.com/433)

どうやらユーザー「root」に対するパスワードが間違ってるぽい

.envファイル内のDBパスが

そして再びmigrateすると

Migration table created successfully.

成功

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?