User Tools

Site Tools


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

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

file_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_nama_table

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.txt · Last modified: 2025/04/12 21:27 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