KIF120583 / Django_Stock

0 stars 0 forks source link

Data Base - Backup and Restore #6

Open KIF120583 opened 2 years ago

KIF120583 commented 2 years ago
KIF120583 commented 2 years ago
  1. Install MySQL Workbench 8.0 CE
  2. Go to C:\Program Files\MySQL\MySQL Workbench 8.0 CE>
  3. Type the below command to backup database stock to D:\KIF120583\DjangoStock\tools\DB\db_backup\backup.sql
    C:\Program Files\MySQL\MySQL Workbench 8.0 CE>mysqldump -h 192.168.23.137 -u root -p stock > D:\KIF120583\DjangoStock\tools\DB\db_backup\backup.sql
    Enter password: ******
  4. Restore the backup sql file , create schema first
    sql command : CREATE SCHEMA `restore_test` ;
  5. Type the below command to restore the backup file to database restore_test
    C:\Program Files\MySQL\MySQL Workbench 8.0 CE>mysql -h 192.168.23.137 -u root -p restore_test < D:\KIF120583\DjangoStock\tools\DB\db_backup\backup.sql
    Enter password: ******