mysql -u app -p appdb < appdb.sql

Category: Databases & SQL

mysql -u app -p appdb < appdb.sql

Restore a database from a SQL file

Feeds the dump file into the mysql client, which replays every statement. The target database must already exist. Check the file's CREATE DATABASE statements if you want a full rebuild.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.