# Using Chart Search module with DB other than "openmrs"

**URL:** <https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625>\
**Category:** Add-on Modules\
**Tags:** chart-search\
**Created:** [July 29, 2015, 5:52pm UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625 "2015-07-29T17:52:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Post date:** [July 29, 2015, 5:52pm UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625/1 "2015-07-29T17:52:22Z")

</div>

Hello all–

After playing around with the chart search module on the opemrs demo server and being impressed, I attempted to install it on my local instance of the PIH system and ran into an issue because (I believe) my local instance uses a non-standard database name (ie, openmrs\_haiti instead of openmrs).

The module is not working for me, and I see the following in the logs:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: SELECT command denied to user ‘openmrs\_hai\_user’@‘localhost’ for table ‘obs’

I confirmed that the module is loading my DB connection properties properly from my runtime properties (including the url referencing the DB “openmrs\_haiti”), but elsewhere in the error message I see queries that are referencing the DB name directly using “openmrs”:

Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT o.uuid as id, obs\_id, person\_id, obs\_datetime, obs\_group\_id, cn1.name as concept\_name, cn2.name as coded, value\_boolean, value\_datetime, value\_numeric, value\_text, cc.concept\_class\_name, cn3.name AS concept\_synonym FROM openmrs.obs o INNER JOIN (SELECT \* FROM openmrs.concept\_name c WHERE c.locale = ‘en’ AND concept\_name\_type = ‘FULLY\_SPECIFIED’) AS cn1 ON cn1.concept\_id = o.concept\_id LEFT JOIN (SELECT \* FROM openmrs.concept\_name c WHERE c.locale = ‘en’ AND concept\_name\_type = ‘FULLY\_SPECIFIED’) AS cn2 ON cn2.concept\_id = o.value\_coded LEFT JOIN (SELECT \* FROM openmrs.concept\_name c WHERE c.locale = ‘en’ AND concept\_name\_type IS NULL) AS cn3 ON cn3.concept\_id = o.concept\_id LEFT JOIN (SELECT DISTINCT o.concept\_id, class.name AS concept\_class\_name FROM concept\_class class JOIN concept c ON c.class\_id = class.concept\_class\_id JOIN obs o ON o.concept\_id = c.concept\_id) AS cc ON cc.concept\_id = o.concept\_id WHERE person\_id=‘8’ AND o.voided=0 AND cn1.voided=0 Processing Document # 1

I’m assuming this is why I’m getting the access issues.

Thoughts? Thanks!

---

<div class="post-metadata">

**Author:** ![k.joseph](https://talk.openmrs.org/user_avatar/talk.openmrs.org/k.joseph/32/8097_2.png) [@k.joseph](https://talk.openmrs.org/u/k.joseph)\
**Post date:** [July 29, 2015, 6:18pm UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625/2 "2015-07-29T18:18:42Z")

</div>

Thanks @mogoodrich for noticing and reporting this issue, i have created [https://issues.openmrs.org/browse/CSM-114](https://issues.openmrs.org/browse/CSM-114) which is soon going to fix this issue, for a better chartsearch overview upto somehow current stuff, i recommend testing using [http://uat01.openmrs.org:8080/openmrs/](http://uat01.openmrs.org:8080/openmrs/)

---

<div class="post-metadata">

**Author:** ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Post date:** [July 29, 2015, 7:11pm UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625/3 "2015-07-29T19:11:46Z")

</div>

Thanks, I look forward to exploring further!

---

<div class="post-metadata">

**Author:** ![k.joseph](https://talk.openmrs.org/user_avatar/talk.openmrs.org/k.joseph/32/8097_2.png) [@k.joseph](https://talk.openmrs.org/u/k.joseph)\
**Post date:** [July 30, 2015, 6:57am UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625/4 "2015-07-30T06:57:13Z")

</div>

Now pulling from master and testing with 1.4-SNAPSHOT should clear this issue

---

<div class="post-metadata">

**Author:** ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Post date:** [July 30, 2015, 1:17pm UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625/5 "2015-07-30T13:17:06Z")

</div>

Great Joseph, I will test!

---

<div class="post-metadata">

**Author:** ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Post date:** [July 30, 2015, 8:26pm UTC](https://talk.openmrs.org/t/using-chart-search-module-with-db-other-than-openmrs/2625/6 "2015-07-30T20:26:40Z")

</div>

@k\_joseph I had add in one other small fix (to escape the json) but now this works great!

I created a ticket about the additional change I made to escape the json:

> <https://issues.openmrs.org/browse/CSM-115>

One other question–I’m not sure how the module and solr works, but is there any automated or behind-the-scenes processing that happens, or does the processing just happen when you actual access the chart search section? I was wondering if I could roll the module out on the production server but only allow a few select users to user it (while we are testing) without having to worry about an overall performance impact.

Thanks!
