エラー
Laradock+MySQL マイグレーションするまで
の記事をみながら、LaradockとMySQLでマイグレーションを試みているのですが、
これ通りにしても以下のエラーが出ます。
エラー [InvalidArgumentException] Database [mysql:relaxed:] not configured.
ちなみに「php artisan」と打つと「Laravel Framework version 5.3.31」と
以下コマンドの詳細が出るので、コマンド自体は正常に動作していると思います。
またLaravelも無事、初期のwelcome.blade.phpの表示成功しています。
以下詳細情報
Laravel Framework version 5.3.31
MySQLバージョン Server version: 5.7.26 MySQL Community Server (GPL)
.envファイル (中略) ※上記参考ドキュメントでいじったとこのみ載せています DB_CONNECTION=mysql:relaxed: DB_HOST=mysql DB_PORT=3306 DB_DATABASE=test_db DB_USERNAME=root DB_PASSWORD=secret (中略)
php
1// マイグレーションファイル 2019_05_14_035737_create_test_db_table.php 2// これも上記参考ドキュメント通りに作成 + カラム内容だけこちらで仮設定 3 4use Illuminate\Support\Facades\Schema; 5use Illuminate\Database\Schema\Blueprint; 6use Illuminate\Database\Migrations\Migration; 7 8class CreateTestDbTable extends Migration 9{ 10 /** 11 * Run the migrations. 12 * 13 * @return void 14 */ 15 public function up() 16 { 17 Schema::create('test_db', function (Blueprint $table) { 18 $table->increments('id'); 19 $table->string('name'); 20 $table->timestamps(); 21 }); 22 } 23 24 /** 25 * Reverse the migrations. 26 * 27 * @return void 28 */ 29 public function down() 30 { 31 Schema::dropIfExists('test_db'); 32 } 33}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。