title: PHP Laravel Framework Database Connection Error
body: <p>I created a database called learning-laravel and I created a table which is users I want to get data from that table I wrote this code block:</p>
  
  <pre><code>Route::get('/',function()
  {   
      $users = DB::table('users')-&gt;get();
      return $users;
  });
  </code></pre>
  
  <p>but I'm getting this type of error:</p>
  
  <pre><code>PDOException
  SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:3306' (2)
  
  
  
    */
      public function createConnection($dsn, array $config, array $options)
      {
          $username = array_get($config, 'username');
  
          $password = array_get($config, 'password');
  
          return new PDO($dsn, $username, $password, $options);
      }
  </code></pre>