mysql compress backup

There are several strategies for backup, snapshot, dump, dump binlog, it all depends on your need and the size of your database. I indicate this tool for databases that have 10G or more than that, the probability that you have problems to restore a backup and long delay, make it unfeasible. I’ll explain a little about the tool provides by MySQL, which is the mysqldump.

Making backup all databases:
mysqldump --all-databases > dump.sql

Making backup only one database:
mysqldump --databases db1 > dump.sql

Making backup many databases:
mysqldump --databases db1 db2 db... > dump.sql

Making backup with triggers:
mysqldump --triggers --all-databases > dump.sql

Making backup with procedures and functions:
mysqldump --routines --all-databases > dump.sql

Now let’s compress our dump in real time with gzip:
mysqldump --all-databases | gzip > dump.sql.gz

We can still reach a higher compression ratio using the bzip2:
mysqldump --all-databases | bzip2 > dump.sql.bz2

And how do I restore the dump?

mysql < dump.sql

gunzip < dump.sql.gz | mysql

bunzip2 < dump.sql.bz2 | mysql

More details about mysqldump can be found on MySQL Online Documentation.

Thats all folks

Reset Your Linux Password In Single Mode

This step will work on especially on CentOS, RedHat, and Fedora. Make sure you didn’t put any password for your GRUB during installation or this tutorial won’t be any help.

1) Turn on the server until the loading screen appears.

2) While on countdown, press any key to cancel the countdown

3) Select your current Linux kernel:

Read the rest of this entry »

How to install mytop

Mytop adalah solusi open source yang membantu memantau aktivitas dan kinerja database MySQL. Untuk menginstal Mytop, pastikan bahwa instalasi berada di server yang sama dengan server MySQL.
Langkah pertama tambahkan repositori EPEL dengan perintah:
yum -y install epel-release

Kemudian install mytop dengan perintah:
yum -y install mytop

Selanjutnya buat file konfigurasi di folder root dengan perintah:
nano /root/.mytop
Read the rest of this entry »