前提・実現したいこと
laravelで掲示板を作っています。
参照しているのはこのサイトです(https://manablog.org/laravel_bulletin_board/)
①マイグレーションを下記のコードで実行しようとしたところ
php artisan migrate
以下のエラーメッセージが出ました。
発生している問題・エラーメッセージ
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = bbc and table_name = migrations) at /Users/yoshiharukaneko/bbc/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) { > 664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668| Exception trace: 1 PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /Users/yoshiharukaneko/bbc/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 2 PDO::__construct("mysql:host=localhost;port=33060;dbname=bbc", "root", "root", []) /Users/yoshiharukaneko/bbc/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 Please use the argument -v to see more details.
発生している問題、エラーメッセージ
②LaravelのSeed機能を使ってDBにダミーデータの送信を下記のコードで行おうとしたところ
php artisan db:seed --class= PostCommentSeeder
ReflectionException : Class PostCommentSeeder does not exist at /Users/yoshiharukaneko/bbc/vendor/laravel/framework/src/Illuminate/Container/Container.php:767 763| if ($concrete instanceof Closure) { 764| return $concrete($this, $this->getLastParameterOverride()); 765| } 766| > 767| $reflector = new ReflectionClass($concrete); 768| 769| // If the type is not instantiable, the developer is attempting to resolve 770| // an abstract type such as an Interface of Abstract Class and there is 771| // no binding registered for the abstractions so we need to bail out. Exception trace: 1 ReflectionClass::__construct("PostCommentSeeder") /Users/yoshiharukaneko/bbc/vendor/laravel/framework/src/Illuminate/Container/Container.php:767 2 Illuminate\Container\Container::build("PostCommentSeeder") /Users/yoshiharukaneko/bbc/vendor/laravel/framework/src/Illuminate/Container/Container.php:646 Please use the argument -v to see more details.
###その他
laravelのバージョンは5.5です。
よろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/17 07:23
2018/04/17 08:04 編集