Export MySQL Database

Login
mysql -u root -p

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

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 ...

Drop all tables from typo3_cms schema
DB_USER=user123
DB_PASS=pass123
for TABLE in $(echo 'select table_name from information_schema.tables where table_schema = "MY_SCHEMA"' | mysql --silent --user=${DB_USER} --password=${DB_PASS}); do
echo "drop table MY_SCHEMA.${TABLE}" | mysql --user=${DB_USER} --password=${DB_PASS}
done

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'

Report / Tuning
http://www.mysqlcalculator.com/
http://www.cyberciti.biz/faq/mysql-server-status-with-mysqlreport-report...
https://github.com/major/mysqltuner-perl

Configure connection
# listen for localhost connections only
bind-address = 127.0.0.1
# listen for connections on all interfaces
bind-address = 0.0.0.0
# listen for connections only on specific IP
bind-address = 192.168.1.2

test MySQL service
telnet 192.168.1.2 3306

Secure access to MySQL server by Iptables
http://www.panticz.de/iptables

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/