如题,运行PHP artisan migrate导入数据库到Mysql时,报了错误: C:\Users\Administrator\Downloads\laravel9.38.0>php artisan migrate Illumina
如题,运行PHP artisan migrate导入数据库到Mysql时,报了错误:
C:\Users\Administrator\Downloads\laravel9.38.0>php artisan migrate Illuminate\Database\QueryException could not find driver (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE') at C:\Users\Administrator\Downloads\laravel9.38.0\vendor\laravel\framework\src\Illuminate\Database\Connection.php:760 756▕ // If an exception occurs when attempting to run a query, we'll format the error 757▕ // message to include the bindings with SQL, which will make this exception a 758▕ // lot more helpful to the developer instead of just the database's errors. 759▕ catch (Exception $e) { ➜ 760▕ throw new QueryException( 761▕ $query, $this->prepareBindings($bindings), $e 762▕ ); 763▕ } 764▕ } 1 C:\Users\Administrator\Downloads\laravel9.38.0\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70 PDOException::("could not find driver") 2 C:\Users\Administrator\Downloads\laravel9.38.0\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=laravel", "root", "", [])
这种问题实际上是php中没有配置mysql插件导致的。php连接mysql的驱动程序有两种:MySQLi 和 PDO,你只需要在配置文件php.ini中将它启用,由于上面的报错是没有启用PDO扩展导致的,这里将“;extension=pdo_mysql”一行前面的分号去掉即可。
来源地址:https://blog.csdn.net/qiuchangyong/article/details/128027473
--结束END--
本文标题: laravel9.38.0中执行php artisan migrate提示could not find driver
本文链接: https://lsjlt.com/news/395841.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0