• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

triggers

MySQL Restore to another DB

June 14, 2020

In order to restore a MySQL database to another database, use routines and triggers.

mysqldump -p user -p --routines --triggers db1 > db1.sql

mysqldump -p user -p --routines --triggers db1 > db1.sql

To restore to another database, just use the normal command.

mysql -u user -p db2 < db1.sql

mysql -u user -p db2 < db1.sql

Filed Under: Linux Tagged With: another, database, mysql, mysqldump, restore, routines, triggers

  • Home
  • About
  • Archives

Copyright © 2023