Database Connection

Navigation:  Development > System Definition >

Database Connection

Previous pageReturn to chapter overviewNext page

Following file contain the database connection:

 

/development/definition/database.xml

 

This file automatically generate during installation.We can create multiple connection to hook in Multiple Database. In definition file there must be a connection called primary which used as a default database connection. See below example:
 
<?xml version="1.0" encoding="utf-8"?>
<database>
  <base>
      <date><![CDATA[22/12/2012]]></date>
  </base>
  <connections>
      <connection>
          <cname>primary</cname>
          <type><![CDATA[MYSQL]]></type>
          <charset><![CDATA[utf8]]></charset>
          <prefix><![CDATA[app_]]></prefix>
          <host><![CDATA[localhost]]></host>
          <dbname><![CDATA[apprain_301]]></dbname>
          <username><![CDATA[root]]></username>
          <password><![CDATA[123456]]></password>
          <active>1</active>
      </connection>
      <connection>
          <cname>conn2</cname>
          <type><![CDATA[]]></type>
          <charset><![CDATA[]]></charset>
          <prefix><![CDATA[]]></prefix>
          <host><![CDATA[]]></host>
          <dbname><![CDATA[]]></dbname>
          <username><![CDATA[]]></username>
          <password><![CDATA[]]></password>
          <active>0</active>
      </connection>
  </connections>
</database>