Here are the steps that worked for me after logging into the box:
Locate MySQL configuration file:
$ mysql --help | grep -A 1 "Default options"
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
On Ubuntu 16, the path is typically /etc/mysql/mysql.conf.d/mysqld.cnf
Change configuration file for bind-address:
If it exists, change the value as follows. If it doesn't exist, add it anywhere in the [mysqld] section.
bind-address = 0.0.0.0
Save your changes to the configuration file and restart the MySQL service.
service mysql restart
Create / Grant access to database user:
Connect to the MySQL database as the root user and run the following SQL commands:
mysql> CREATE USER 'username'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON mydb.* TO 'username'@'%';