Skip to content

Import SQL files into a MySQL server

You can import SQL dumps into your MySQL server directly from the command line. I will assume here that you have the MySQL server installed locally and you have access to MySQL’s root account (and therefore have all rights on the database server).

To import a dump for a single database, run this command after your created the database:

To import a dump of multiple databases, simply don’t specify the database parameter:

[sc name=”src” url=”https://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql” ]
[sc name=”src” url=”https://askubuntu.com/questions/198170/restoring-multiple-mysql-databases-from-one-file-at-the-command-line” ]

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.