connect to remote instance

mysql -h -u remote_user

sample mysqldump

mysqldump -h -u remote_user database_name > outfile.sql

import db dump into mysql db

mysql -u user -p db_name < import_file.sql


count of emails by TLD

select count(\*), substring_index(email,'@',-1) from table group by substring_index(email, '@',-1) order by count(\*) desc;

Grant priviliges on a db to a user

grant all privileges on db_name.* to 'db-user'@'db-host' identified by 'password';