Backup isi database MySQL

From OnnoWiki
Revision as of 05:16, 28 May 2020 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

Dump isi database MySQL

/usr/bin/mysqldump -u usernamemysql -ppasswordmysql namadb -c
/usr/bin/mysqldump -u usernamemysql -ppasswordmysql namadb -c > isidatabase.sql

jika kita menginginkan agar file yang di hasilkan langsung di gz, kita dapat menggunakan perintah

/usr/bin/mysqldump -u usernamemysql -ppasswordmysql namadb -c | /bin/gzip -9 > isidatabse.sql.gz

Database akan tersimpan di file

isidatabase.sql.gz

Restore Database

gunzip isidatabase.sql.gz
mysql -u usernamemysql -ppasswordmysql namedb < isidatabase.sql



Referensi

Pranala Menarik