0
0

More than 3 years have passed since last update.

heroku run php artisan migrate した時のエラー

Posted at

heroku run php artisan migrateした際のエラー

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables

上記のエラーが発生しました。

下記コマンドで、環境変数を確認します。

$ heroku run php artisan tinker

>>> config('database.connections.mysql')
=> [
     “driver” => “mysql”,
     “url” => null,
     “Host” => “ホスト名”,
     “Port” => “ポート番号”,
     “database” => “データベース名”,
     “username” => “ユーザ名”,
     “password” => “パスワード”,
     “unix_socket” => “/Applications/MAMP/tmp/mysql/mysql.sock”,
     “charset” => “utf8mb4”,
     “collation” => “utf8mb4_unicode_ci”,
     “prefix” => “”,
     “prefix_indexes” => true,
     “strict” => true,
     “engine” => null,
     “options” => [],
   ]

herokuの環境では、
unix_socketセットする必要がないので下記のように変更したら、デプロイ完了しました。

"unix_socket" => ""
0
0
1

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
0
0