User Tools

Site Tools


linux:bash:script-restore-per-table-ke-database-mysql

This is an old revision of the document!


Contoh Script Restore Database dari Table per Table MySQL

Kadang ya kita perlu restore database mysql tabel per tabel sql file, maka berikut ini adalah contoh scriptnya

nama_table=/table.txt

while read nama_table; do
	if [ ! -z "/root/db/$nama_table.sql" ]; then
		tfile="/root/db/${nama_table}.sql"
		echo $tfile
		mysql -u user_mysql --password="paswwd-mysql" nama_db <  $tfile
	fi
done<$file

isi dari table.txt adalah

nama-table1.sql
nama-table2.sql
nama-table3.sql

dst…

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash/script-restore-per-table-ke-database-mysql.1744507588.txt.gz · Last modified: 2025/04/12 21:26 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki