mysql

connect to remote instance

mysql -h remote.db-server.com -u remote_user

sample mysqldump

mysqldump -h remote.db-server.com -u remote_user database_name > outfile.sql

import db dump into mysql db

mysql -u user -p db_name < import_file.sql

queries!

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';