# ???Unable to connect to database??????

**URL:** <https://talk.openmrs.org/t/unable-to-connect-to-database/33513>\
**Category:** Uncategorized\
**Created:** [May 20, 2021, 12:42pm UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513 "2021-05-20T12:42:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bahagt](https://talk.openmrs.org/user_avatar/talk.openmrs.org/bahagt/32/14255_2.png) [@bahagt](https://talk.openmrs.org/u/bahagt)\
**Post date:** [May 20, 2021, 12:42pm UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/1 "2021-05-20T12:42:23Z")

</div>

Hi everyone I am new to openMrs. I have been trying to install openMrs by using OpenMRS SDK for many days because i want to start contributing and i have been facing many issues and I have been reading many answers but no answer has helped me to solve my issue. I have followed the instructions in the SDK development installation and every thing has worked well until the last stage. problem description. First step: I install SDK by using command ‘mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk’. and it worked fine. Second step: I set up the server by using command ‘mvn openmrs-sdk:setup’ and it worked fine

 ![1](https://talk.openmrs.org/uploads/default/original/2X/e/e00010537bfde280b4a805d0b97f1a41d50fa161.png)Third step: I run the server using command ‘mvn openmrs-sdk:run’ and it worked fine. ![2](https://talk.openmrs.org/uploads/default/original/2X/7/7908a0ab8cfc2c6a6ceaffd4f1daf532599c5df4.png)Fourth step: The problem occurs here when i open [http://localhost:8091/openmrs/](http://localhost:8091/openmrs/) in a browser. it is saying ???Unable to connect to database???. ![3](https://talk.openmrs.org/uploads/default/original/2X/e/ef8ff5b0d163aba010b73a30c7fb54a6eb16ad4f.png)error details: ![4](https://talk.openmrs.org/uploads/default/original/2X/f/f5f3c65533160044eff61307f29b48fea04140f0.png)

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [May 20, 2021, 7:38pm UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/2 "2021-05-20T19:38:31Z")

</div>

Are you able to connect to your database, with the same account, using any other client?

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 21, 2021, 4:36am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/3 "2021-05-21T04:36:50Z")

</div>

@bahagt on top of @dkayiwa 's question, which MySQL version are you running?

---

<div class="post-metadata">

**Author:** ![bahagt](https://talk.openmrs.org/user_avatar/talk.openmrs.org/bahagt/32/14255_2.png) [@bahagt](https://talk.openmrs.org/u/bahagt)\
**Post date:** [May 21, 2021, 8:45am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/4 "2021-05-21T08:45:46Z")

</div>

@dkayiwa I am very sorry but i don’t fully understand your question because maybe it is my first time to interact with database

---

<div class="post-metadata">

**Author:** ![bahagt](https://talk.openmrs.org/user_avatar/talk.openmrs.org/bahagt/32/14255_2.png) [@bahagt](https://talk.openmrs.org/u/bahagt)\
**Post date:** [May 21, 2021, 8:46am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/5 "2021-05-21T08:46:15Z")

</div>

@herbert24 I am using MySQl 8.0

---

<div class="post-metadata">

**Author:** ![piumal1999](https://talk.openmrs.org/user_avatar/talk.openmrs.org/piumal1999/32/13557_2.png) [@piumal1999](https://talk.openmrs.org/u/piumal1999)\
**Post date:** [May 21, 2021, 8:55am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/6 "2021-05-21T08:55:17Z")

</div>

I also had the same issue when reinstalling openmrs sdk. It worked fine with the `Reference Application 2.12.0 - SNAPSHOT` version of the distribution. But the `Unable to connect to database` error occurred when running the older versions. (I am using mysql 8.0)

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [May 21, 2021, 10:26am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/7 "2021-05-21T10:26:56Z")

</div>

For MySQL 8 you need to select platform 2.4 and above or reference application 2.12.0-SNAPSHOT

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 21, 2021, 10:54am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/9 "2021-05-21T10:54:01Z")

</div>

@bahagt the above comment from @dkayiwa should get you moving ☝

---

<div class="post-metadata">

**Author:** ![bahagt](https://talk.openmrs.org/user_avatar/talk.openmrs.org/bahagt/32/14255_2.png) [@bahagt](https://talk.openmrs.org/u/bahagt)\
**Post date:** [May 21, 2021, 11:59am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/10 "2021-05-21T11:59:38Z")

</div>

@dkayiwa @piumal1999 @herbert24. I don’t know how to thank you all. Thank you very much. I have spent alot of time on this issue without any progress but you solved it in a day. Thank you very much and i appreciate your time and efforts

---

<div class="post-metadata">

**Author:** ![bahagt](https://talk.openmrs.org/user_avatar/talk.openmrs.org/bahagt/32/14255_2.png) [@bahagt](https://talk.openmrs.org/u/bahagt)\
**Post date:** [May 21, 2021, 12:02pm UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/11 "2021-05-21T12:02:17Z")

</div>

@dkayiwa Aside from this issue. I wan to start contributing. I know java, object oriented programming, data strucutres and algorithms, and sql. My question is. Should i spent some time learning hibernate and spring and then start contributing or it is better to start now. I want to contribute to the core

---

<div class="post-metadata">

**Author:** ![atiq](https://talk.openmrs.org/user_avatar/talk.openmrs.org/atiq/32/14179_2.png) [@atiq](https://talk.openmrs.org/u/atiq)\
**Post date:** [August 18, 2021, 9:44am UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/12 "2021-08-18T09:44:14Z")

</div>

By the way how you solved this database connectivity issue? @bahagt

---

<div class="post-metadata">

**Author:** ![bahagt](https://talk.openmrs.org/user_avatar/talk.openmrs.org/bahagt/32/14255_2.png) [@bahagt](https://talk.openmrs.org/u/bahagt)\
**Post date:** [August 18, 2021, 1:12pm UTC](https://talk.openmrs.org/t/unable-to-connect-to-database/33513/13 "2021-08-18T13:12:22Z")

</div>

I have followed Daniel Kayiwa advice which is ( For MySQL 8 you need to select platform 2.4 and above or reference application 2.12.0-SNAPSHOT )
