Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

MySQL Database Setup

keithwoodlock edited this page Oct 15, 2012 · 30 revisions

Database setup

Assuming you already have a version of MySql installed. To get started quickly you can just setup the latest demo database.

Mifos X has support for hosting multiple tenants so we use two database schemas:

  1. mifosplatform-tenants: which is responsible for persisting the tenant information which is used when deciding what schema each incoming request in the platform should route to.
  2. mifostenant-default: All tenant specific schemas follow the pattern mifostenant-xxxx, out of the box the default schema is used to represent a demo

Create schema/database named mifosplatform-tenants

create database `mifosplatform-tenants`;

Then apply file; mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql

mysql -u[user] -p[password] mifosplatform-tenants < mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql

Create schema/database named mifostenant-default

create database `mifostenant-default`;

Then apply file; mifosng-db/multi-tenant-demo-backups/mifostenant-default.backup.sql to this database;

mysql -u[user] -p[password] mifostenant-default < mifosng-db/multi-tenant-demo-backups/bk_mifostenant-default.sql

Important: If Using Different MySQL User/Password than what is configured

Note: By default, the files you clone from repository for setting up mysql and launching the application from the commad line assume a database user/password of root/mysql. Its likely that you have a different database user/password on your development machine so you should do the following:

  1. Update the schema settings associated with each entry in the mifosplatform-tenants database for example:

Example of updating tenant with id 1 to use mifos/mifos as username/password for database connections.

UPDATE mifosplatform-tenants.tenants SET schema_server = 'localhost', schema_server_port = '3306', schema_username = 'mifos', schema_password = 'mifos' WHERE id=1;

see Launching platform server locally from the command line for actions required for launching platform locally from the command line.