To connect to a server running on some other machine, it's necessary to specify the hostname using an -h option.
% mysql -h yourDomain.com -p -u sampadm