Fix jdbc error - Caused by: java.sql.SQLException: null,  message from server: "Host 'XXX.XXX.XXX.XXX' is not allowed to connect to this MySQL server"
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root';
    flush privileges;

Ref: http://serverfault.com/questions/486710/access-to-mysql-server-via-virtualbox