title: How to fix migrate Laravel error 'PDOException and PDO::__construct'
body: <p>I'm trying to execute the <code>php artisan migrate</code> command to create a table in phpmyadmin </p>
  
  <p>But its showing error of </p>
  
  <blockquote>
    <p>"could not find driver"</p>
  </blockquote>
  
  <p>I have made the <code>php artisan serve</code> and it worked  </p>
  
  <pre><code> 'mysql' =&gt; [
                  'driver' =&gt; 'mysql',
                  'host' =&gt; env('DB_HOST', '127.0.0.1'),
                  'port' =&gt; env('DB_PORT', '3306'),
                  'database' =&gt; env('DB_DATABASE', 'testdb'),
                  'username' =&gt; env('DB_USERNAME', 'root'),
                  'password' =&gt; env('DB_PASSWORD', 'xxxx'),
                  'unix_socket' =&gt; env('DB_SOCKET', ''),
                  'charset' =&gt; 'utf8mb4',
                  'collation' =&gt; 'utf8mb4_unicode_ci',
                  'prefix' =&gt; '',
                  'prefix_indexes' =&gt; true,
                  'strict' =&gt; true,
                  'engine' =&gt; null,
                  'options' =&gt; extension_loaded('pdo_mysql') ? array_filter([
                  PDO::MYSQL_ATTR_SSL_CA =&gt; env('MYSQL_ATTR_SSL_CA'),
              ]) : [],
          ],
  </code></pre>
  
  <p></p>
  
  <pre><code> DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=testdb
   DB_USERNAME=root
   DB_PASSWORD=xxxx
  </code></pre>
  
  <p><strong>This is the error showing in the command line:</strong></p>
  
  <pre><code> Illuminate\Database\QueryException  : could not find driver 
     (SQL: select * from information_schema.tables where table_schema = 
      testdb and table_name = migrations)
  
    at C:\AppServ\www\laravel2\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) {
    &gt; 664|             throw new QueryException(
      665|                 $query, $this-&gt;prepareBindings($bindings), $e
      666|             );
      667|         }
      668|
  
    Exception trace:
  
    1   PDOException::("could not find driver")
        C:\AppServ\www\laravel2\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
  
    2   PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=testdb", "root", "xxxx", [])
        C:\AppServ\www\laravel2\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
  </code></pre>
  
  <p>it's expected to show <strong>"tables created successfully"</strong> and also created in phpmyadmin</p>