php artisan migrate error could not find driver
I’m running into a IlluminateDatabaseQueryException : could not find driver
error when trying to run php artisan migrate
.
I looked around but couldn’t find a solution to this exception.
I am running Laravel 5.6 with PHP 7.2 and MySQL 5.7 on a windows computer.
Here is the .env file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=larabiz
DB_USERNAME=root
DB_PASSWORD=root
And there is the detailed error log:
php artisan migrate -v
IlluminateDatabaseQueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = larabiz and table_name = migrations)
at C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.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) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 DoctrineDBALDriverPDOException::("could not find driver")
C:UsersCyrilProjectslarabizvendordoctrinedballibDoctrineDBALDriverPDOConnection.php : 47
2 PDOException::("could not find driver")
C:UsersCyrilProjectslarabizvendordoctrinedballibDoctrineDBALDriverPDOConnection.php : 43
3 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=larabiz", "root", "root", [])
C:UsersCyrilProjectslarabizvendordoctrinedballibDoctrineDBALDriverPDOConnection.php : 43
4 DoctrineDBALDriverPDOConnection::__construct("mysql:host=127.0.0.1;port=3306;dbname=larabiz", "root", "root", [])
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnectorsConnector.php : 65
5 IlluminateDatabaseConnectorsConnector::createPdoConnection("mysql:host=127.0.0.1;port=3306;dbname=larabiz", "root", "root", [])
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnectorsConnector.php : 44
6 IlluminateDatabaseConnectorsConnector::createConnection("mysql:host=127.0.0.1;port=3306;dbname=larabiz", [])
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnectorsMySqlConnector.php : 24
7 IlluminateDatabaseConnectorsMySqlConnector::connect()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnectorsConnectionFactory.php : 183
8 IlluminateDatabaseConnectorsConnectionFactory::IlluminateDatabaseConnectors{closure}()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 915
9 call_user_func(Object(Closure))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 915
10 IlluminateDatabaseConnection::getPdo()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 940
11 IlluminateDatabaseConnection::getReadPdo()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 399
12 IlluminateDatabaseConnection::getPdoForSelect()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 325
13 IlluminateDatabaseConnection::IlluminateDatabase{closure}("select * from information_schema.tables where table_schema = ? and table_name = ?")
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 657
14 IlluminateDatabaseConnection::runQueryCallback("select * from information_schema.tables where table_schema = ? and table_name = ?", Object(Closure))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 624
15 IlluminateDatabaseConnection::run("select * from information_schema.tables where table_schema = ? and table_name = ?", Object(Closure))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConnection.php : 333
16 IlluminateDatabaseConnection::select("select * from information_schema.tables where table_schema = ? and table_name = ?")
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseSchemaMySqlBuilder.php : 18
17 IlluminateDatabaseSchemaMySqlBuilder::hasTable("migrations")
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseMigrationsDatabaseMigrationRepository.php : 169
18 IlluminateDatabaseMigrationsDatabaseMigrationRepository::repositoryExists()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseMigrationsMigrator.php : 545
19 IlluminateDatabaseMigrationsMigrator::repositoryExists()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConsoleMigrationsMigrateCommand.php : 97
20 IlluminateDatabaseConsoleMigrationsMigrateCommand::prepareDatabase()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateDatabaseConsoleMigrationsMigrateCommand.php : 63
21 IlluminateDatabaseConsoleMigrationsMigrateCommand::handle()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateContainerBoundMethod.php : 29
22 call_user_func_array([])
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateContainerBoundMethod.php : 29
23 IlluminateContainerBoundMethod::IlluminateContainer{closure}()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateContainerBoundMethod.php : 87
24 IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Object(Closure))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateContainerBoundMethod.php : 31
25 IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), [])
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateContainerContainer.php : 564
26 IlluminateContainerContainer::call()
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateConsoleCommand.php : 183
27 IlluminateConsoleCommand::execute(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
C:UsersCyrilProjectslarabizvendorsymfonyconsoleCommandCommand.php : 252
28 SymfonyComponentConsoleCommandCommand::run(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateConsoleCommand.php : 170
29 IlluminateConsoleCommand::run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
C:UsersCyrilProjectslarabizvendorsymfonyconsoleApplication.php : 865
30 SymfonyComponentConsoleApplication::doRunCommand(Object(IlluminateDatabaseConsoleMigrationsMigrateCommand), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
C:UsersCyrilProjectslarabizvendorsymfonyconsoleApplication.php : 241
31 SymfonyComponentConsoleApplication::doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
C:UsersCyrilProjectslarabizvendorsymfonyconsoleApplication.php : 143
32 SymfonyComponentConsoleApplication::run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateConsoleApplication.php : 88
33 IlluminateConsoleApplication::run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
C:UsersCyrilProjectslarabizvendorlaravelframeworksrcIlluminateFoundationConsoleKernel.php : 121
34 IlluminateFoundationConsoleKernel::handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
C:UsersCyrilProjectslarabizartisan : 37
Thank you for your help!
from Laravel Questions and Answers https://laravelquestions.com/laravel/php-artisan-migrate-error-could-not-find-driver/
via Lzo Media
No comments:
Post a Comment