mysql mydb < dump.sql

Category: Databases & SQL

mysql mydb < dump.sql

Import a SQL dump into a database

Feeds dump.sql's statements into mydb through stdin, like psql mydb < file.sql. Create the database first unless the dump contains CREATE DATABASE. Related: mysqldump to produce the file.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.