Install and Configure MySQL

 

Download MySQL

  •  Double click the downloaded file to begin running the Installer. Select Typical installation and click Next.

 

Install MySQL - Typical Installation

 

  • Click Install. 

 

Install MySQL - Typical

  • Continue clicking Next as prompted.

3_install_db_install.jpg

  • Select Configure the MySQL Server now and click Finish.

Detailed Configuration

  • Click Next and then select Detailed Configuration for Instance Configuration Wizard and click Next.

Configure MySQL

Install DB - Detailed

  • Keep the selection for Developer Machine Under Server Type and click Next.

Configure MySQL - Developer

  • Select Multifunctional Database for Database Usage and click Next.

Configure MySQL - Multifunctional

 

  •   Select C: Installation Path for InnoDB Tablespace Settings and click Next.

 

 

Configure MysQL - installation path

  • Select Decision Support (DSS)/OLAP for Number of Concurrent Users and click Next.

Configure MySQL - OLAP

  • Select Enable TCP/IP Networking, choose Port Number: 3306, select Enable Strict Mode and click Next.

Configure MySQL - Port

  • Select  Best Support for Multilingualism for Default Character Set.

Configure MySQL - Language

  • Install as Windows Service. Check to included bin directory in Windows PATH.

Configure MySQL - Windows Service

  • Set up your root password under security options. Select Modify Security Settings. Enter your root password and confirm it.   You can leave the password as its default, mysql, if you like.  Please note if you make any changes. 

Install DB - Password - new

*If you'd previously installed a Mifos database, your window will look like this and you'll need to enter your current root password.

Configure MySQL - Password

  • Press Execute to start configuration.

Configure MySQL - Execute

  • Once all configuration settings have been successfully applied, click Finish to close the Wizard.

Configure MySQL - Finished.

Go back to top of the page.

 

Configure MySQL

Configuring MySQL can be done in a number of different ways:

  • By directly editing values in the my.ini file.
  • Using MySQL GUI Tools or MySQL Workbench 
  • Using MySQL Workbench

In this example, we're going to configure the MySQL database by directly editing the my.ini file.  MySQL GUI Tools have been phased out and MySQL Workbench can be used if you're administering multiple databases. 

Configuration by directly editing my.ini file

  • Locate your my.ini file in the folder where MySQL Server has been installed.  My location is: C:\Program Files\MySQL\MySQL Server 5.1

    my.ini_location_small.png

     

  • Open this file to edit it in a text editor like Notepad. 
  • There are six parameters we'll configure:
         max_connections=300
	         innodb_buffer_pool_size=1024M
	         innodb_file_per_table
	         log-error=mysql_error.log
	         log-slow-queries=mysql_slow_query.log
	         long_query_time=1
  • Search for max_connections and edit the value to 300.
     
    my.ini_max_connections.png
     
     
  • Search for innodb_buffer_pool_size and edit the value to be set to 1024M

my.ini_innodb_buffer.size.png

 

  • Scroll to the bottom of the file and enter the following 4 entries on separate lines:
    • innodb_file_per_table
    • long_query_time = 1
    • log-error = mysql_error.log
    • log-slow-queries = mysql_slow_query.log

my.ini_long_query.png

  • Save changes and close out the my.ini file.  Open up the file one more time to ensure the changes were saved.

Go back to top of the page.

Create Mifos Database and Mifos User

We're now going to enter into the command line to create a MySQL database called mifos and a user for the database called mifos.  This mifos user must exist for the mifos.war file to connect to MySQL
  • Enter the DOS command line. This can be done by entering cmd in the Run window.
 
initiate_db_cmd.JPG
  • Log in to MySQL using root account.  By default password will be mysql unless you changed it while installing MySQL.  
    • To log in, type:
mysql -uroot -p 
  •  
    • Press enter and you'll be prompted for your password (this is the password you set defined for root while configuring MySQL).  
login to sql admin.png
 
  •  
    • Once successfully logged in, you should see a screen as follows: 
successful login.png 
  • Now let's enter the first command to create the database called mifos.  
    • Type the following and press enter (make sure to include semi-colons):
CREATE DATABASE mifos;
 
create database.png
  •  
    • You should see a message that states Query OK, 1 row affected... To confirm the database was successfully created, type the following and press enter:
show databases;

successful create databases.png

  • Now let's create the user, mifos, its password, and grant it necessary privileges.
    • The password is determined by the string that follows identified by. For this example, I've made my password nonsecure but you should choose a secure password.  All commands would be different according to which password you select. So the command works like this: GRANT ALL on '<DATABASE NAME>'.* to '<USER ID>'@'<HOST NAME>' identified by '<PASSWORD>'; 
    • Type the following (making necessary change for your password after "identified by") and press enter:
		GRANT ALL on mifos.* to 'mifos'@'localhost' identified by '<PASSWORD>';

 

create usere and grant privileges.png
  •  
    • Execute this last command to complete the user creation process. Type the following and press enter:
		FLUSH PRIVILEGES;
flush privileges.png
  •  
    • Now let's exit out of MySQL command line by typing exit and pressing enter. 
exit.png

Initiate MySQL

Next we need to initialize the Mifos database, by running the three commands below from the directory that contains this INSTALL file.  These commands assume a database username of "mifos" and in my case I'm using the password "nonsecure".  Adjust them if your database password is different.  

mysql -D mifos -u mifos -p<PASSWORD> < db/sql/base-schema.sql
mysql -D mifos -u mifos -p<PASSWORD> < db/sql/base-data.sql
mysql -D mifos -u mifos -p<PASSWORD> < db/sql/init_mifos_password.sql
  • We're still in the DOS command line but will need to cd (change directory) into the directory that contains the INSTALL file.  In my case this was Mifos Install.

navigate back to directory.png

 

  • Execute the first command (you'll know the command is successfully executed when the command line prompt appears again below). Replace <PASSWORD> with your password:
    • mysql -D mifos -u mifos -p<PASSWORD> < db/sql/base-schema.sql

intitiate_1.png

  • Execute the second command:
    • mysql -D mifos -u mifos -p<PASSWORD> < db/sql/base-data.sql

intitiate_1.png

  • Execute the third command:
    • mysql -D mifos -u mifos -p<PASSWORD> < db/sql/init_mifos_password.sql

intitiate_4.png

  • You can now exit out of the command line window by clicking x.  

Update local.properties file if you changed mysql password for user id mifos.

  • In my example, I used the password of nonsecure for my mysql database.  By default, Mifos expects a database called Mifos with the user id of mifos and password mifos. Since I set my password to to mysql to a different one, unique from mifos, you'll need to customize your local.properties file to specify this new password.
  • Open your local.properties file. It is located in the config folder which is in the same directory where INSTALL is located. 
  • Location of local.properties
  • Highlight the current password of mifos and replace it with your actual password. Save the changes.
  • Local Properties
  • Change Local.Properties
  •  

Go back to top of the page.

0
Your rating: None