簡體   English   中英

Laravel 8.6 php artisan migrate 不工作(windows)

[英]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

我按照以下步驟解決了這個問題

  1. 須藤 apt-get 安裝 php7-mysql

  2. 打開 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM