https://laravel10.wordpress.com/2015/02/25/%E5%88%9D%E3%82%81%E3%81%A6%E3%81%AElaravel-5-6-%E3%83%9E%E3%82%A4%E3%82%B0%E3%83%AC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7db%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E7%AE%A1/
こちらのサイトを参考にLaravelの学習をしています。
前回の質問に関することは自己解決できました。
ですが今度は下記のmigrateを実行した際にタイトルのエラーが出ました。
.envもdatabase.phpも前回の質問で書き換えてあるのに
[forge]というテーブルがあるか探しに行っているようです。
sqlsrvという区画を参照しているのでしょうか・・・
何故こうなるのかがわかりません・・・ご教示ください。
migrate実行
C:\xampp\htdocs\laravel>php artisan migrate ************************************** * Application In Production! * ************************************** Do you really wish to run this command? y [PDOException] SQLSTATE[HY000] [1049] Unknown database 'forge' migrate [--bench [BENCH]] [--database [DATABASE]] [--force] [--path [PATH]] [--p ackage [PACKAGE]] [--pretend] [--seed]
.env
APP_NAME=Laravel APP_ENV=local APP_KEY=base64:eqUQ0WTmJWsutQBJhYPQ7CqxsY6pukKXmLMQ0U+oYIo= APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://localhost DB_CONNECTION=sqlite DB_HOST=localhost DB_PORT=3306 DB_DATABASE=mysql DB_USERNAME=pma DB_PASSWORD= DB_SOCKET=/Applications/XAMMP/xammpfiles/var/mysql/mysql.sock BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET=
database.php
'default' => env('DB_CONNECTION', 'mysql'), /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring each database platform that is | supported by Laravel is shown below to make development simple. | | | All database work in Laravel is done through the PHP PDO facilities | so make sure you have the driver for your particular database of | choice installed on your machine before you begin development. | */ 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', 'database' => storage_path('database.sqlite'), 'prefix' => '', ], 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'mysql'), 'username' => env('DB_USERNAME', 'pma'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', null), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, ], 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'mysql'), 'username' => env('DB_USERNAME', 'pma'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', 'sslmode' => 'prefer', ], 'sqlsrv' => [ 'driver' => 'sqlsrv', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '1433'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', ], ], /* |-------------------------------------------------------------------------- | Migration Repository Table |-------------------------------------------------------------------------- | | This table keeps track of all the migrations that have already run for | your application. Using this information, we can determine which of | the migrations on disk haven't actually been run in the database. | */ 'migrations' => 'migrations',
回答1件
あなたの回答
tips
プレビュー