Created
May 30, 2024 13:36
-
-
Save nimdasx/ca578fe2ac3cbb9bc37c07f591827452 to your computer and use it in GitHub Desktop.
mysql-restore.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read -p "nama file : " nama_file | |
read -p "nama db : " nama_db | |
host=0.0.0.0 | |
user=root | |
pass=xxx | |
port=3306 | |
echo " | |
CREATE DATABASE ${nama_db} | |
CHARACTER SET utf8mb4 | |
COLLATE utf8mb4_general_ci; | |
" | mysql -u$user -p$pass -P$port -h$host | |
pv $nama_file | mysql $nama_db -h$host -P$port -u$user -p$pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment