Cara Backup Database Menggunakan Mysqldump


Image results for mysqldump images
A. Introduction
       Asalammu'alaikum Wr, Wb friends all. This time I will give a Tutorial on Backup Database Using Mysqldump to all friends. Hope can be useful.

       1. Understanding
A database  is a collection of information stored in a computer systematically so it can be checked using a computer program to obtain information from the database. The software used to manage and call queries is called database management system (DBMS). The database system can be learned in information science.

     2.Background
By using the export function in phpmyadmin that will take a lot of time if you want to export a lot of even all the existing database on the database server.

     3. Purpose and Purpose
Exporting the database using linux terminal command prompt.

B. Tools and Materials
    1.PC / Laptop
    2. Mysql Server Database 

C. Term
     3 minutes

D. Implementation Phase

Pastikan terlebih dahulu anda mempunyai database server baik itu di laptop sendiri maupun di server lain . Dan pastikan juga database sudah berjalan dengan baik. Sekarang admin ingin membackup database admin bernama moodle . Karena hanya satu database yang akan admin export , ketikkan
#mysqldump -u root -p namadatabase > namafile.sql


Sehingga menjadi 
#mysqldump -u root -p ppdb > sekolah.sql


Sekolah.sql merupakan nama file sql yang akan menampung table table dari database yang telah diexport tadi. Nah, akan muncul file bernama sekolah.sql . File tersebut dapat digunakan untuk mengimport kembali database ppdb.
Selanjutnya, yaitu mengeksport banyak database atau lebih dari satu, 
Misal admin ingin mengeksport 2 database yaitu database ppdb dan database ppdb daftar, sehinnga menggunakan
#mysqldump -u root -p -database ppdb daftar > hasil.sql


Selanjutnya yaitu untuk mengeksport semua database yang ada pada database server anda , ketikkan
#mysqldump -u root -p -all-database > hasil.sql


Now it will be easier to retrieve the database from your server. Especially if only in one type, all databases have been exported flawlessly to our laptop. This mysqldump function is very useful because it will speed up the time in exporting a database.

E. Conclusion
The result of the above configuration is the database successfully backed up by using the cli command is mysqldump. You can export one, multiple, or all databases with just a few Terminals.

Reference

Tidak ada komentar:

Posting Komentar

Pages