Я пытаюсь выполнить команду php artisan migrate
для создания таблицы в phpmyadmin
Но ошибка показа
"не удалось найти драйвер"
Я сделал php artisan serve
, и это сработало
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'testdb'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'xxxx'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=testdb
DB_USERNAME=root
DB_PASSWORD=xxxx
Это ошибка, отображаемая в командной строке:
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) {
> 664| throw new QueryException(
665| $query, $this->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
ожидается отображение «таблиц, успешно созданных» , а также созданных в phpmyadmin