簡體   English   中英

Laravel 從 git 克隆后數據庫名稱不正確

[英]Laravel incorrect database name after cloning from git

我使用 ssh 密鑰從 git 克隆了我的項目,現在我的 env 文件已更改。 無論我嘗試什么工匠命令,它一直說我的數據庫名稱錯誤。

有人知道我應該填寫什么嗎? 我忘記了上一個 env 文件中的數據庫名稱是什么。 我失去了另一個項目。

SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select * from `permission`)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678
    674▕         // If an exception occurs when attempting to run a query, we'll format the error
    675▕         // message to include the bindings with SQL, which will make this exception a
    676▕         // lot more helpful to the developer instead of just the database's errors.
    677▕         catch (Exception $e) {
  ➜ 678▕             throw new QueryException(
    679▕                 $query, $this->prepareBindings($bindings), $e
    680▕             );
    681▕         }
    682▕ 

  • Database name seems incorrect: You're using the default database name `laravel`. This database does not exist.
    
    Edit the `.env` file and use the correct database name in the `DB_DATABASE` key. 

這是我的環境文件的一部分:

PP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root

檢查 config/database.php 連接一些開發人員編寫他們的數據庫配置

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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