How to get database connection details without longing to cpanel in WordPress?

both answers were great and helped me a lot ,i used the following to get to wp-config file without really Knowing all database details

      require_once('../wp-config.php');
      include_once ('../wp-load.php');
$con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD , DB_NAME);