Problems with database creation during dev install

Hi All,

I am Dilanka Rathnayake, final year undergraduate student of Department of Computer Engineering, Faculty of Engineering, University of Peradeniya, Sri Lanka.

I went through the all the project ideas that have been published by ‘OpenMRS’ and I think ‘Patient Flags REST API’ project is more suitable according to the knowledge that I have acquired during my undergraduate courses and the experience gained by doing various projects in my internship program. And also i strongly believe that this would be more beneficial to my future carrier development as well. Furthermore I have very good knowledge about Restful APIs, Spring, Struts2, Hibernate, HTML, JavaScript/AngularJs, CSS/Bootstrap.

I tried to install ‘OpenMRS’ according to and I did following things

  1. Installed Java 7 (jre1.7.0_79) as you told ‘‘Java 8 is not currently supported (April 7, 2014)’’
  2. Installed apache-tomcat-6.0.29
  3. installed mysql by ‘sudo apt-get install mysql-server’
  4. Downloaded ‘OpenMRS 2.3.1 Standalone Edition’ and ‘War’ file separately.

When I run standalone edition by ‘’ then first time it started sucessfully. but then when i start it It gives error like below: User initialization error. Can not connect as root with password. Can not connect as root without password. URL: jdbc:mysql://

the I deleted current ‘standalone edition’ and re ran ‘’. the it gives below error:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

and I deployed separate war file into webapp folder in tomcat and when i run ‘’ it gives this error:

Unable to find a runtime properties file at /home/dilanka/GSOC16/OpenMRS/apache-tomcat-6.0.29/bin/

Then I copied ‘’ into bin. then I get following error:

java.lang.RuntimeException: Error occurred while trying to get the updates needed for the database. Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set

what should i give to connection.username and connection.password in file.

I went through and when I check my db according to that the it says there is no db called ‘OpenMRS’

Please be kind enough to solve this errors and provide more details about the project and i really appreciate your cooperation on this matter.

Best Regards, Dilanka Rathnayake.

Please change the title of the thread and rename it to something that makes sense, pertaining to your current issue and not what project you want to undertake

All you have to do is drop the openmrs database from MySQL like drop database openmrs; and delete the local OpenMRS folder. That should solve it

1 Like

Thank you very much for your quick reply.

But there is No DB called openmrs and also already deleted .OpenMRS folder that located in `/home/YOURUSERNAME/.OpenMRS . But still I get above error when I starts .

Does your mysql db root account has a passsword for localhost or 127.x.x.x hosts ?


Thank you for your reply,

And yes of course, when installing mysql they ask for a password. So I gave that password for connection.password and gave ‘root’ for connection.username in file . But it doesn’t fix the error.

here is content of my file

#Auto generated by OpenMRS initialization wizard #Thu Mar 03 10:28:05 IST 2016 encryption.vector=J7A4UXzGMHafrOeQfL77UA== connection.url=jdbc:mysql://localhost:3306/openmrs?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8 module.allow_web_admin=true ###connection.username=openmrs_user auto_update_database=false encryption.key=EF8y1iXxZ33h62LEqr6QKQ== ###connection.password=4@OG@.JgI95L

### Database connection properties connection.username=root connection.password=*****

Have you been able to solve this issue? I am having the same problem. I am able to log into the database via workbench and cmd utility but not using startup.bat…Please help as I have tired ever “troubleshooting” tip out here. I am using Windows 10. Thank you all in advance.

@dnelson how does your error log look like?