title: how to access my database in cpanel server?
body: <p>The following error occur for my website: <br><br></p>
  
  <blockquote>
    <p>Warning: mysql_connect(): Access denied for user 'mydb_db'@'localhost'
    (using password: YES) in
    /home/fiveghr/public_html/don/dbconnection/connection.php on line 8
    Could not connect: Access denied for user 'mydb_db'@'localhost' (using
    password: YES)</p>
  </blockquote>
  
  <pre><code>&lt;?php
  $rpath = $_SERVER["DOCUMENT_ROOT"];
  require $rpath."/don/dbconnection/config.php"; 
  class getdbconnection {
      public function getConnection(){
          //      $con = mysql_connect("localhost","*****","******");
          $con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
          if (!$con)
          {
              return die('Could not connect: ' . mysql_error());
          } else {
              //          mysql_select_db("real_state", $con);
              mysql_select_db(DB_NAME, $con);
              //return $con;
          }
      }
  } 
  ?&gt;
  </code></pre>