Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Grant Thomas
Grant Thomas
13,705 Points

Windows | php artisan migrate command throws QueryException

 Illuminate\Database\QueryException  : could not find driver (SQL: select * from information_schema.tables where table_schema = treehouse and table_name = migrations and table_type = 'BASE TABLE')

  at C:\...\treehouse\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|

  Exception trace:

  1   PDOException::("could not find driver")
      C:\...\treehouse\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70

  2   PDO::__construct()
      C:\...\treehouse\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70

  Please use the argument -v to see more details.

I'm on Windows 10 using MAMP and getting this error when I enter the php artisan migrate command. I checked the php.ini to make sure extension=php_pdo_mysql.dll is uncommented and it already was. Double checked my MAMP mysql port to my DB_port in my .env file as well. Any ideas how I can resolve this issue?

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Grant Thomas! I would suggest checking your php_info for other php.ini files. I know on my Windows 10 system MAMP has access to three separate ones. So while it may be active in the file you found, it may be commented out in others.

Hope you get it worked out! :sparkles: