リストア(mysql/psql)
DestructiveRestore from a dump
mysql -u root -p <db> < backup.sql
Replays a SQL dump into a database. It overwrites — be absolutely sure of the target DB.
Examples
mysql -u root -p app_db < app_db_20260610.sqlRestore yesterday's dump
Syntax
mysql -u user -p db < dump.sql / psql -U user -d db -f dump.sql
Before you run it
Overwrites the target database.
Related commands
- Dump / backupBack up a DB
- SHOW DATABASESList databases
Check it once more before you run it
Some commands cannot be undone if one flag is wrong. An on-device reference works with no connection. Free to install, no ads.
Get it free on the App Store