Troubleshooting MySQL

How to create a blank MIFOS database?

Following steps are required:

  • Open MySQL prompt.
  • Enter password
  • Create database Mifos using command “create database MIFOS”
  • Select the database using command “Use MIFOS”
  • Execute the following file “latest-schema.sql” using command “source <path of the file name>”
  • Then execute “latest-data.sql”
  • And finally “init_mifos_password.sql”

After following the above steps, the MIFOS basic database is created.

How to take the database dump?

Execute the following command to take the database dump on command prompt.

mysqldump  --u(usernameMYSQL) --p(pwdMYSQL) (MYSQLdatabasename) > (path where to store the dump file together with the name of the file)

In order to include the routines (procedures and functions)

Add --R option for it.

mysqldump  --u(usernameMYSQL) --p(pwdMYSQL) (MYSQLdatabasename) --R  > (path where to store the dump file together with the name of the file)

Note: While taking dump, there should be no error and file size should be proper.












Note: There are two paths from where you can run the above command

  • One way is to open the command prompt and set the path to MYSQL\bin folder. Once set, you can run the above command.

e.g. in my case it is

D:\MYSQL\bin

  • The other way is to run it from mysql command line client. All you need is to set your MYSQL path in the environment variables of the system.


How to execute the SQL script files?

The SQL script files are executed by following command.

mysql  -D(database name) --u(username of MYSQL) --p(pwd of MYSQL) < (complete path where the script file is saved)

The other way is to use the source command.

Mysql>source <file path name>

How to restart the MYSQL server?

When the application is hanged or starts responding very slow (for example, when the user is unable to enter data through collection sheet due to batches or some processing at backend), try to restart the MYSQL server.

Go to Control Panel -> Administrative Tools -> Services

Stop and then start the MYSQL service.


How to run the stored procedures?

Many a times, MFI need to run certain stored procedures as they sometimes may fail to run properly.  Below is the syntax for it on command prompt.

Mysql> call procedure_name(parameter value list);

Note: the parameter value list should be in the correct sequence of the definition of procedure parameter list.

How to solve the “show trigger error” while taking database backup?

Remove the temp folder from below location

C:\windows\Temp folder

This is caused by the antivirus scan.

The other way is to remove scanning of this folder from the antivirus you are using by adding an exception for it.

How to check whether MIFOS batch jobs run properly?

The MIFOS database “scheduled_tasks” logs the status of each Mifos internal job execution status and can be used to track the status of each job for the day. If there are any errors, then the data in the   description column of the table gives the information of the entity id that is affected or has created the problem.

Apart from that, if you want to change the timings of the batches configured in Mifos, you can do so by opening the file at following location.

C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\org\mifos\config\resources\task.xml

There you can change the default timings.