Mysql – mysqldump 備份還原指令
備份
把 hostname 位置在 127.0.0.1 的資料庫 testdb ,匯出到 dump.sql
1 2 3 |
mysqldump -h 127.0.0.1 -u root -p testdb > dump.sql |
還原
將 dump.sql 匯入到資料庫 testdb
1 2 3 |
mysql -u root -p testdb < dump.sql |