The is the way to access MySQL Database from the remote location using command line.
Before you access database from the remote location, you have to grant the permission to access database . (See How to Grant Permission )
then from remote location use following command
Syntax : mysql -h [IP Address of MySQL DB] -u [UserName] -p
IP Address of MySQL DB = IP Address of MySQL Server Machine
UserName = Username which granted in MySQL Server
Ex : mysql -h 10.100.1.42 -u chamara -p
When you enter above command MySQL Server will ask Password.you have to submit password which you enter in granting permission phase.