title: How to secure database configuration file in project?
body: <p>I have created on php file for establishing connection with database server. In this file, i am using <code>mysql_connect()</code> function with parameters host, username and password of my database server.</p>
  
  <pre><code>public class DatabaseConnect
  {
  function __construct()
  {
      mysql_connect('localhost','username','password') or die('Could not connect to mysql server.');
      mysql_select_db('databasename');
  }
  
  }
  </code></pre>
  
  <p>Now in this case, username and password are visible to others.</p>
  
  <p>I found one more way to secure the value i.e. <code>mysql.default_user</code> and <code>mysql.default_password</code>. In which scenario we have to this way?</p>
  
  <p>Or how could i secure my values from others?</p>