You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mysql_restore.sh 596B

1234567891011121314151617181920212223242526272829
  1. # Set the database credentials
  2. sudo apt-get update
  3. sudo apt-get -y install cifs-utils
  4. cd /
  5. mkdir mysql_backup
  6. sleep 2
  7. sudo chmod 777 mysql_backup
  8. sleep 2
  9. sudo mount //10.10.5.26/trias /mysql_backup/ -o username='baptist',password='2021Bbh',domain='bbh'
  10. sleep 2
  11. cd /mysql_backup/
  12. ls
  13. DB_USER="root"
  14. DB_PASS="root@123"
  15. DB_NAME="triq_demo"
  16. # Set the backup directory
  17. echo "Enter the name of backup file: "
  18. read fileName
  19. BACKUP_FILE="/mysql_backup/$fileName"
  20. mysql -u $DB_USER -p$DB_PASS -e "CREATE database triq_demo;"
  21. # Restore backup file
  22. mysql -u $DB_USER -p$DB_PASS $DB_NAME < $BACKUP_FILE