Answers.Body: <p>Does the table prefix value in you <code>.env</code> file need to be in quotes? eg</p>
  <pre><code>DB_TABLE_PREFIX=&quot;craft&quot;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-15T06:43:18.013Z
Answers.Text: However - this sounds to me more like an issue with the credentials. Generally if the table prefix value is wrong Craft will just think it is not installed and try a new installation …
Answers.UserDisplayName: Cole Henley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-15T15:16:40.650Z
Answers.Text: Thanks for the response. As noted above, the table prefix between Craft 2 and 3 is the same. The prefix wrapped in quotes wasn't the solution.
Answers.UserDisplayName: Shad
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T16:05:08.093Z
Answers.Text: In Craft 3 I think you need to add the underscore for the prefix value so Craft 2 is `craft` but for Craft 3 would be `craft_`
Answers.UserDisplayName: Cole Henley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T19:15:26.897Z
Answers.Text: Tried that yesterday, but still no luck. Thanks for checking back in though!
Answers.UserDisplayName: Shad
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-12T08:30:55.753Z
Answers.Text: When the error message reads "can't connect to the database with the credentials" then you have a permissions error. Its not even reaching the db server thus it cannot be a problem with the table prefixes.
  
  In a .env file, you do not need to use quotes unless there are spaces or other "special chars" in your term.
Answers.UserDisplayName: MisterMike
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-15T06:42:30.107Z
Answers.LastActivityDate: 2020-09-15T06:42:30.107Z
Answers.UserDisplayName: Cole Henley
Body: <p>Good evening all,</p>
  <p>I am updating a small site from Craft 2 to 3, and after <a href="https://craftcms.com/docs/3.x/upgrade.html#preparing-for-the-upgrade" rel="nofollow noreferrer">following the instructions</a> in the documents, I loaded up the backend of my site and was greeted with the install screen.</p>
  <p>I know that this typically means that the <code>DB_TABLE_PREFIX</code> is improperly set, but I triple-checked and I'm 99% certain that it's correct. I double-checked with my Craft 2, which looks like</p>
  <pre><code>// The prefix to use when naming tables. This can be no more than 5 characters.
      'tablePrefix' =&gt; 'craft',
  </code></pre>
  <p>And matched it to my <code>.env</code> file:</p>
  <pre><code># The prefix that should be added to generated table names (only necessary if multiple things are sharing the same database)
  DB_TABLE_PREFIX=craft
  </code></pre>
  <p>I also checked for a <code>craft_info</code> table, and that is present. The version listed in the version column is 2.9.2, if that makes a difference.</p>
  <p>I am unable to login to my admin panel, or view my website now. I get the following when viewing my website:</p>
  <pre><code>Database Connection Error – craft\errors\DbConnectException
  Craft CMS can’t connect to the database with the credentials in config/db.php.
  ↵
  Caused by: Database Exception – yii\db\Exception
  
  </code></pre>
  <p>Any help is greatly appreciated!</p>
  <p>-Shad</p>
  
Tags: <database><updating>
Title: Database Connection Error after updating from Craft 2 to 3
ThreadText: # Database Connection Error after updating from Craft 2 to 3
  
  (Asked by: username_0 on 2020-09-15)
  
  Good evening all,
  
  I am updating a small site from Craft 2 to 3, and after [following the instructions](https://craftcms.com/docs/3.x/upgrade.html#preparing-for-the-upgrade) in the documents, I loaded up the backend of my site and was greeted with the install screen.
  
  I know that this typically means that the `DB_TABLE_PREFIX` is improperly set, but I triple-checked and I'm 99% certain that it's correct. I double-checked with my Craft 2, which looks like
  
  ```
  // The prefix to use when naming tables. This can be no more than 5 characters.
      'tablePrefix' => 'craft',
  
  ```
  
  And matched it to my `.env` file:
  
  ```
  # The prefix that should be added to generated table names (only necessary if multiple things are sharing the same database)
  DB_TABLE_PREFIX=craft
  
  ```
  
  I also checked for a `craft_info` table, and that is present. The version listed in the version column is 2.9.2, if that makes a difference.
  
  I am unable to login to my admin panel, or view my website now. I get the following when viewing my website:
  
  ```
  Database Connection Error – craft\errors\DbConnectException
  Craft CMS can’t connect to the database with the credentials in config/db.php.
  ↵
  Caused by: Database Exception – yii\db\Exception
  
  ```
  
  Any help is greatly appreciated!
  
  -username_0
  
  **Tags:** database, updating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-15. Score: 0
  
  Does the table prefix value in you `.env` file need to be in quotes? eg
  
  ```
  DB_TABLE_PREFIX="craft"
  
  ```
  
  > **Comments:**
  > **username_1**: However - this sounds to me more like an issue with the credentials. Generally if the table prefix value is wrong Craft will just think it is not installed and try a new installation …  
  > **username_0**: Thanks for the response. As noted above, the table prefix between Craft 2 and 3 is the same. The prefix wrapped in quotes wasn't the solution.  
  > **username_1**: In Craft 3 I think you need to add the underscore for the prefix value so Craft 2 is `craft` but for Craft 3 would be `craft_`  
  > **username_0**: Tried that yesterday, but still no luck. Thanks for checking back in though!  
  > **username_2**: When the error message reads "can't connect to the database with the credentials" then you have a permissions error. Its not even reaching the db server thus it cannot be a problem with the table prefixes.  In a .env file, you do not need to use quotes unless there are spaces or other "special chars" in your term.  
  
  ---
  
  