title: Laravel SQLSTATE[HY000] [1049] Unknown database 'previous_db_name'
body: <p>I have this error when i use <code>php artisan migrate</code> in my Laravel project.</p>
  
  <pre><code>[PDOException]
  SQLSTATE[HY000] [1049] Unknown database 'previous_db_name'
  </code></pre>
  
  <p>this is my <code>database.php</code> file :</p>
  
  <pre><code>'default' =&gt; env('DB_CONNECTION', 'mysql'),
  'connections' =&gt; [
  
      'mysql' =&gt; [
          'driver'    =&gt; 'mysql',
          'host'      =&gt; env('DB_HOST', 'localhost'),
          'database'  =&gt; env('DB_DATABASE', 'current_db_name'),
          'username'  =&gt; env('DB_USERNAME', 'root'),
          'password'  =&gt; env('DB_PASSWORD', ''),
          'charset'   =&gt; 'utf8',
          'collation' =&gt; 'utf8_unicode_ci',
          'prefix'    =&gt; '',
          'strict'    =&gt; false,
      ],
  ],
  </code></pre>
  
  <p>I saw this error in <a href="https://stackoverflow.com/questions/24119818/laravel-pdoexception-sqlstatehy000-1049-unknown-database-forge">this question</a> and <a href="https://stackoverflow.com/questions/28421626/pdoexception-sqlstatehy000-1049-unknown-database-forge-failed">this question</a> but none of them was not helpful. </p>