LoginSignup
5
4

More than 5 years have passed since last update.

laravelでpowershellからmigrateしようとしたらcould not find driverが出る

Posted at

初投稿です。
よくわからないところで詰まってしまったので覚書に

症状

  • xamppからshellを使うと普通にmigrateできた
  • powershellでphp artisan migrateしたら次のようなエラーが出た
Illuminate\Database\QueryException  : could not find driver (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations)

原因

C:\phpphp.iniphp_pdo_mysql.dllを読む設定になっていなかった。
そのため、php.ini内のextension=pdo_mysqlのコメントアウトを外した。

C:\xampp\phpphp.iniはデフォルトで読み込むようになっていたので問題なくmigrateできていた。

結論

環境が汚いのはよくない

5
4
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
5
4