Export MySQL Database

Login
mysql -u root -p

Optimize all databases
mysqlcheck --host=localhost --password=${DB_PASS} --user=${DB_USER} -o --all-databases

Links
phpMyAdmin - phpMyAdmin downloads

GUI
apt-get install -y mysql-admin

Allow access from outsice
sed -i 's|bind-address|#bind-address|g' /etc/mysql/my.cnf
/etc/init.d/mysql restart

Allow access to database magento for user dbo_magento from any host
GRANT ALL PRIVILEGES ON magento.* TO dbo_magento@'%' IDENTIFIED BY 'your_pass'

# dont LOCK TABLE on export / import
mysqldump --single-transaction --quick --skip-trigger ...

SSL
http://mysqlserverteam.com/ssltls-and-rsa-improvements-for-openssl-linke...

SSH tunnel
ssh -C -L 3306:db.example.com:3306 foo@gw.example.com -N
echo "show databases;" | mysql --host=127.0.0.1 --port=3306 --user='user' --password='pass'

Links
http://www.greensql.net/ - open source database firewall for MySQL and PostgreSQL
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-dat...
http://www.igvita.com/2007/10/10/hands-on-mysql-backup-migration/