title: Where should I store my database username and password in a PHP application?
body: <p>This is probably true for other languages as well. I've created several websites by now, many of which use databases (usually mySQL). I need to store the database password somewhere in the sourcecode, but this seems like a security problem, and a a bit like a hack. Is there a better way to store the password, apart from a config file which is included everywhere I need to use the database?</p>
  
  <p><strong>Duplicate: <a href="https://stackoverflow.com/questions/97984/how-to-secure-database-passwords-in-php">How to secure database passwords in PHP?</a></strong> </p>