Backup Database MYSQL

backup database mysql

Mengecek dulu isi database yang sudah terdaftar

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 782 to server version: 5.0.22

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show database;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| postfix |
| test |
+——————–+
4 rows in set (0.00 sec)
mysql>
mysql> exit
Bye

Selanjutnya keluar dari mysql dan lakukan command dibawah ini untuk melakukan backup database

#mysqldump -u root -p postfix > /home/backupdb-27082015/db-27082015.sql
Enter password:
#

selesai sudah, maka db-27082015.sql disimpan dalam folder /home/backupdb-27082015/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s