title: "No such file or directory" or "No such host is known" when running migrations
body: <p>I deleted the <code>migrations</code> table from a Laravel 5.4 database named <code>laravel</code>. When I run <code>php artisan migrate:install</code>, I get this error:</p>
  <pre class="lang-none prettyprint-override"><code>[Illuminate\Database\QueryException]
  SQLSTATE[HY000] [2002] No such file or directory
  (SQL: select * from information_schema.tables where table_schema = laravel
      and table_name = migrations)
  </code></pre>
  <p>I deleted and recreated the database. I also ran <code>composer update</code>. No luck. I can run the command in phpMyAdmin and create the table manually.</p>
  <p>This problem sometimes also manifests itself with similar 2002 errors:</p>
  <pre class="lang-none prettyprint-override"><code>[Illuminate\Database\QueryException]
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known.
  (SQL: select * from information_schema.tables where table_schema = laravel
      and table_name = migrations and table_type = 'BASE TABLE')
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>[Illuminate\Database\QueryException]
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
  (SQL: select * from information_schema.tables where table_schema = laravel
      and table_name = migrations and table_type = 'BASE TABLE')
  </code></pre>