Share Article To

Developers often want to do some work related to database, like backups, database edits, etc. But clients don’t even know what is MySQL database and where to get the database access details, they usually give just FTP and/or hosting control panel access.

Even if you have access to hosting cPanel, there might be a number of databases and you might need just one database responsible for your website/application. For example: magento.

So, let’s assume that we have FTP access and we don’t have the database credentials yet, but we need to perform a database related job directly accessing the database. Now the question is where do we find the database access details?

Go to ‘/app/etc/’ directory and open the file ‘local.xml’.


<default_setup>
  <connection>
    <host><![CDATA[localhost]]></host>
    <username><![CDATA[magento]]></username>
    <password><![CDATA[magento]]></password>
    <dbname><![CDATA[magento]]></dbname>
    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
    <model><![CDATA[mysql4]]></model>
    <type><![CDATA[pdo_mysql]]></type>
    <pdoType><![CDATA[]]></pdoType>
    <active>1</active>
  </connection>
</default_setup>

One thought on “Where to find magento DB config details

Leave a Reply

Your email address will not be published. Required fields are marked *