laravel - php artisan migrate 命令错误:找不到驱动程序
问题描述
我的操作系统是windows
Illuminate\Database\QueryException : 找不到驱动程序 (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations)
at E:\Programme\Laravel Lab\blog\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")
E:\Programme\Laravel Lab\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:68
2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=blog", "root", "root", [])
E:\Programme\Laravel Lab\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:68
Please use the argument -v to see more details.
解决方案
首先你需要启动你的mysql服务器然后检查你的mysql的env配置,我认为你的密码不是root,但是你把root输入密码。有时密码为空。请检查一下。
推荐阅读
- visual-studio-code - VSCode:在定义的文本之间切换
- arrays - 用 3 个参数减少调用,中间有一个奇怪的参数
- python - 将模块文件夹名而不是文件名添加到 Tortoise ORM config_file
- html - 如何使用 Bootstrap(我猜)让 iframe 填充剩余屏幕区域的宽度和高度?
- python - Kubernetes 集群中使用 Python 套接字的服务器-客户端连接
- c# - ASP.NET Core - IServiceProvider 何时处置?
- docker - 在 Container-Optimized OS 中保存持久性可执行文件的位置
- python - 计数符号更改
- sql - 对于类目录应用程序,如何避免使用多个多对多联结的多个 SQL 联结
- c# - 如何修复 Visual Studio 2022 警告 CA1416“所有平台均可访问的呼叫站点”但“仅支持:'windows'”?