title: Storing PDO details in php.ini
body: <p>According to the <a href="http://www.php.net/manual/en/pdo.construct.php" rel="nofollow noreferrer">PDO documentation</a>, you can store database login details in php.ini, away from the php file (example 3). But it does not explain how to store username and password, only the database and host. How would you do that?</p>
  
  <p>This is the method used in the documentation:</p>
  
  <pre><code>[PDO]
  pdo.dsn.mydb="mysql:dbname=testdb;host=localhost"
  </code></pre>
  
  <p>I've tried adding the username and password to the host, but it does not like : between the username and password, and it does not recognize an address with only a username as a real address:</p>
  
  <pre><code>[PDO]
  pdo.dsn.mydb="mysql:dbname=testdb;host=username:password@localhost"
  </code></pre>
  
  <p>I've also tried putting the username and password as separate arguments, but it does not.s</p>
  
  <pre><code>[PDO]
  pdo.dsn.mydb="mysql:dbname=testdb;host=localhost;username:username;password:secret"
  pdo.dsn.mydb="mysql:dbname=testdb;host=localhost;uid:username;pwd:secret"
  pdo.dsn.mydb="mysql:dbname=testdb;host=localhost;UID:username;PWD:secret"
  </code></pre>