Openmrs not connecting with DB.

mysql
Tags: #<Tag:0x00007efd19eae620>

(Riyad Sarker) #1

Openmrs Showing this error: "Unable to create the database. The password might be incorrect or the database is not started.

???Error executing sql: create database if not exists ? default character set utf8 - Could not create connection to database server. Attempted reconnect 3 times. Giving up.???"

Please note: DB creadentials is good. I double checked it. Tomcat Version: Apache Tomcat/8.5.27 JVM: 9.0.4+11 Widows: 10

Any Ideas?


(Juliet Wamalwa) #2

Do you remember your MySQL “root password”? type it where you are asked for a password.


(Riyad Sarker) #3

Tried. Same result


(Juliet Wamalwa) #4

you are using which version of mysql ? 5.6 version is recommended


(Daniel Kayiwa) #5

Even higher versions of MySQL should work fine.


(Moses Mutesasira) #6

u must first set a password for your mysql root account. and then use it as a password . make sure u start the mysql databse before u do the installation.

u can probably try the standalone wc comes wih every thing packaged and set for u
u can also try the sdk


(Riyad Sarker) #7

mysql server version 8.0.11


(Nurudeen Lawal) #8

Same issue with me here. Standalone 2.1.3, tomcat 9, mysql 8.0.1. I have entered the root password but not way. I even reinstalled mysql and made sure I set another password still same result. Its either the standalone has inherent issues or the mysql or the tomcat.


(Juliet Wamalwa) #9

What is the username for the “root” password?


(Daniel Kayiwa) #10

The standalone version has an embedded mysql and tomcat. Try unzip a fresh version of the standalone and run it again.


(Herbert Yiga) #11

which set up type are you running for your standalone?


(Nurudeen Lawal) #12

I want to use the enterprise war so as to deployed over the wireless network for client computers to access without starting an instance of the application on the server. For the embedded tomcat and SQL in the standalone version, they can’t be accessed by client PCs unless the application has been started on the server for it to invoke the embedded tomcat and SQL.


(Nurudeen Lawal) #13

Something is definitely wrong. I spent 2 whole nights and can’t get around the issue of password.


(Nurudeen Lawal) #14

Uninstalled the mysql 8.0.13 and deleted related folders in program files and program data. Restarted and installed mysql 5.6.42. Now its working… after 48hrs of non night sleep though. My hypothesis is that the components mysql 8, tomcat 9 and OMRS 2.x do not mix.


(Irene Nyakate) #15

sorry about that blocker but still it’s great that you have overcome it. Please could you share the steps you took to get unblocked to help someone out there who may be having the same problem. :smile:


(Sarah Elder) #16

MySQL 8 updated the authentication mechanism: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password

Unfortunately I haven’t figured out how to make it work without downgrading the authentication mechanism in MySQL.

I created a separate user in MySQL identified with mysql_native_password (from the openmrs-core repo) using something like: CREATE USER ‘’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘;’

I then granted appropriate privileges, and using the Advanced setup to have openMRS use the “new” user.

The most secure route would be to also create the OpenMRS database and ONLY grant the user privileges on that database (in the Advanced Setup you still create the tables automatically).

I am new to the forum, so apologies if I am breaking any rules.


(Nurudeen Lawal) #17

Well I tried downgrading the authentication but still ran into issues. The most definite fix to this is downgrading the mysql version.


(Juliet Wamalwa) #18

Once you join this community your are a member whose opinion counts. Feel free to contribute and make openmrs the best open source.


(Juliet Wamalwa) #19

Was the issue sorted out? if not share the output on the pastebin


(Nurudeen Lawal) #20

Yes the issue was resolved after downgrading to mysql 5.x. Installation was successful.