mysqldump Untuk Backup Database

Using mysqldump, you can backup a local database and restore it on a remote database at the same time, using a single command. In this article, let us review several practical examples on how to use mysqldump to backup and restore.

For the impatient, here is the quick snippet of how backup and restore MySQL database using mysqldump:

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
        # mysqldump -u root -p database_name > namafile.sql
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql
        # mysql -u root -p database_name < namafile.sql