connection.password in how to set?


I am attempting an install of openmrs on my local computer to learn how to work with it. Doing this on a Windows 10 computer, with tomcat 6.0.29, mysql 5.5, and jdk 1.6.0_45.

Previously, I had openmrs running and was trying to install some modules (specifically openhmis modules). After leaving it for a while and coming back I can’t access openmrs and instead get this message:

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

I can’t remember exactly what I had done in terms of setting up connection.password before. What this line was previously was something like (changed in case it was sensitive):


But I’ve since changed the openmrs_user password directly through mysql.

I can’t find online any good info about this field, since I believe I saw somewhere that it is now hashed, rather than a raw password.

My question:

  • Am I looking at the right fields? connection.username for openmrs database user, connection.password for associated password
  • Is this password hashed? If so, how do I generate the hashed password? Is this something that is only supposed to be modified from within the openmrs web interface? Or is this something that is initialized by the setup wizard and shouldn’t be changed?

Hi @mdg583,

Yes, connection.username and connection.password are the credentials for the MySQL user that is granted rights on the database specified in the connection.url.

No, that’s just the actual password.

Assuming the password for openmrs_user is mypass, could you try this in your shell:

mysql -u openmrs_user --pmypass openmrs

Of course you must replace the password by the one that you have set in MySQL for openmrs_user. (Note the -p directly followed by the password.)

Does that get you to the MySQL prompt on the openmrs database?

Hello, thanks for the help.

Actually, it just started working this morning. So I have the actual password in the .properties file, as you say. I’m not sure why I couldn’t seem to get it to work yesterday.

Thanks anyway.