openmrs tables in mysql workbench


(barnabas owusu) #1

Hello guys, Am running Bahmni 0.91 on cent OS and i want to know the configuration to link openmrs tables to mysql workbench to enable me write some custom queries.


(Ramashish Joshi) #2

mysql Workbench connection from Windows machine to AWS (or other server)

  1. Install mysql workbench
  2. On Windows Command prompt go to C:\Program Files\MySQL\MySQL Workbench 6.3 CE

mysql --host=<serverip> --user=<openmrsdbuser> --password=<openmrsdbpassword> openmrs

  1. If this throws error it means @localip does not have access. In this case either grant all for the existing opnemrsdbuser OR create a new user in mysql to grant access to all databases and from remote machine by

login to mysql from AWS, To Grant permissions to the existing user

GRANT ALL ON *.* TO '<opnemrsdbuser>'@'%' IDENTIFIED BY <openmrsdbpassword>;

To Create new user and gran access

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpass';
CREATE USER 'newuser'@'%' IDENTIFIED BY 'newpass';

GRANT ALL ON *.* TO 'newuser'@'localhost';
GRANT ALL ON *.* TO 'newuser'@'%';

Check if the user is created by login to mysql with the new user.

  1. Repeat 3. If successful then open workbench and use Standard TCP/IP connection with the same parameters as above and Connect.

Default Bahmni installation sets mysql user id=root and password=password for openmrs db.

If you do not wish to use workbench

  1. From CentOS prompt

mysql -uroot -ppassword openmrs


(barnabas owusu) #3

Thanks for the prompt response, but am having little issue here am not really strong in these. With step 2. kindly throw more light on what to do please