[英]Laravel 8.6 php artisan migrate not working (windows)
我运行了命令 php artisan 并返回了这个。
PS C:\Users\15715\OneDrive\Desktop\laravel-tutorial\links> php artisan migrate
Illuminate\Database\QueryException
could not find driver (SQL: select * from information_schema.tables where table_schema = links_development and table_name = migrations and table_type = 'BASE TABLE')
at C:\Users\15715\OneDrive\Desktop\laravel-tutorial\links\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671
667▕ // If an exception occurs when attempting to run a query, we'll format the error
668▕ // message to include the bindings with SQL, which will make this exception a 669▕ // lot more helpful to the developer instead of just the database's errors.
670▕ catch (Exception $e) {
➜ 671▕ throw new QueryException(
672▕ $query, $this->prepareBindings($bindings), $e
673▕ );
674▕ }
675▕
1 C:\Users\15715\OneDrive\Desktop\laravel-tutorial\links\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
PDOException::("could not find driver")
2 C:\Users\15715\OneDrive\Desktop\laravel-tutorial\links\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
PDO::__construct()
当我检查 PDO 时,它会在 PDO 上显示这一点。 不确定这是否有帮助。
您最近是否升级了 php 版本,因为这看起来更像是 php 扩展错误。 例如sudo apt-get install php7-mysql
我按照以下步骤解决了这个问题
须藤 apt-get 安装 php7-mysql
打开 php.ini 文件并取消注释以下几行
;扩展名=php_pdo_mysql.dll
;扩展=pdo_mysql.so
然后,重启Apache服务器
只需做简单的事情将您的 php 版本从 7.2 更新到 7.3 或 7.4,因为 laravel 7 需要 php 7.3 或更高版本并更新 mysql
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.