0
0

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したときのエラー対処方法

0
Last updated at Posted at 2021-02-10

php artisan migrateコマンドを実行した際に、
SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: NO)というエラーが発生。

内容としては、
ユーザー ‘root’ @ ‘localhost’のアクセスが拒否されました。という内容です。

解決した方法

 .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=データベース名
DB_USERNAME=root
DB_PASSWORD=root

キャッシュをクリア

//下記コマンドを実行

$ php artisan cache:clear

//▼実行結果

Cache cleared successfully.

//下記コマンドを実行

$ php artisan config:cache

//▼実行結果

Configuration cache cleared!

Configuration cached successfully!
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?