XAMPの環境の中にcomposerを入れてlaravel5.6をインストールしました。
そこでhttp://localhost/sample/public/をブラウザで叩くとlaravelが動くことを確認出来たので、今度はphpmyadminでデータベースtestを作成し、config/databaseのenvに以下のように設定しました。
lang
1 2 'mysql' => [ 3 'driver' => 'mysql', 4 'host' => env('DB_HOST', '127.0.0.1'), 5 'port' => env('DB_PORT', '3306'), 6 'database' => env('DB_DATABASE', 'test'), 7 'username' => env('DB_USERNAME', 'root'), 8 'password' => env('DB_PASSWORD', ''), 9 'unix_socket' => env('DB_SOCKET', ''), 10 'charset' => 'utf8mb4', 11 'collation' => 'utf8mb4_unicode_ci', 12 'prefix' => '', 13 'strict' => true, 14 'engine' => null, 15 ],
そのあとにdatabase/migrationsに最初から入っているusers_tableを使ってユーザーテーブルを作成しようと、php artisan migrateのコマンドを打ったところエラーが出て実行出来ませんでした。
lang
1C:\xampp\htdocs\sample>php artisan migrate 2 3 Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied fo 4r user 'homestead'@'localhost' (using password: YES) (SQL: select * from informa 5tion_schema.tables where table_schema = homestead and table_name = migrations) 6 7 at C:\xampp\htdocs\oasis\vendor\laravel\framework\src\Illuminate\Database\Conn 8ection.php:664 9 660| // If an exception occurs when attempting to run a query, we'll 10 format the error 11 661| // message to include the bindings with SQL, which will make th 12is exception a 13 662| // lot more helpful to the developer instead of just the databa 14se's errors. 15 663| catch (Exception $e) { 16 > 664| throw new QueryException( 17 665| $query, $this->prepareBindings($bindings), $e 18 666| ); 19 667| } 20 668|
どのように対処したらmigrateのコマンドが正常に打てるようになるか教えてください。
お願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/06 10:48
2018/05/06 11:03 編集
2018/05/06 11:13