Whenever connecting to a database, isolate connection and usage functions so you don't end up establishing a connection each time you need to query.
Also, this results in an error:
mysql -h 192.168.99.100 -u hgmd -p hgmd
Enter password: # I typed hgmd
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.99.100' (60)
mysql -h 192.168.99.100 -u hgmd -P 3306 -p hgmd
Enter password: # I typed hgmd
ERROR 2005 (HY000): Unknown MySQL server host '192.168.99.100:3306' (0)
Do you need special permissions to access this server?
thanks for answering