Accessing MySQL from Host Machine

  1. In the VM, edit /etc/mysql/my.cnf

  2. Make MySQL bind to all IPs

    #bind-address = 127.0.0.1  # old value

    bind-address = 0.0.0.0 # add this

  3. Restart MySQL
    sudo service mysql restart

  4. Login to MySQL in VM
    mysql -u root -p 

  5. Add new user
    grant all privileges on openmrs.* to 'root'@'%' identified by 'OpenMRS'; flush privileges; 

  6. Login from host machine

 

Â