Friday, November 15, 2024

.:: Extract backup mysqldump to convert only table specify (Sample Pembelian) in MySQL MariaDB :::.

A. Extract backup from file backup

1. Backup full database

mysqldump -u root -p teguhth  > table_teguhth.sql ;

2. extract table only specific table (example barang)

sed -n -e '/DROP TABLE.*`barang`/,/UNLOCK TABLES/p' table_teguhth.sql > /data/pertable/barang_only.sql

3. check result
 

4. now you have backup full only one table from extract and ready to restore

B. Restore backup from extract

1. Restore


mysql -uroot -p pertable < /data/pertable/barang_only.sql

2. check 
 


No comments:

Post a Comment

Popular Posts