We can change or view MySQL database connection details such as hostname, database name, username etc of a Magento
from the file in the location /app/etc/local.xml
find the below lines in the file
<connection>
<host><![CDATA[hostname]]></host>
<username><![CDATA[DB username]]></username>
<password><![CDATA[DB pwd]]></password>
<dbname><![CDATA[DB name]]></dbname>
<active>1</active>
</connection>