This is how I did it with my friend. I used navicat (he uses SQLyog) so I will teach you how to do this using navicat.
Ok the first your friend (or you) has to reconfigure mySQL. Make SURE he checks "Enable root access from remote machines." Without this it WILL NOT work. He must tell you the username, port, and password (to mySQL) also.
After he does that you must open navicat and open a new connection (if u have another one) and here's how it's going to be.
Connection name: whatever you like
Host Name/IP adress: The realmlist for you to connect. (I believe this works for hamachi as well just make sure it's the right IP and that you are connected to it)
Port: the port he told you (usually 3306)
User Name: The username he gave you
Password: The password he gave you
Check "Save Password" if you don't want to enter it everytime you want to get on.
Now double click on the connection you just made and you should see your friends databases and be able to access them.
*This is my first guide so please tell me how I can be better*
*I will try to add pictures in my next guide*
*Post if you need any help*