How to use the command line to import SQL files in MySQL

  • How-Tos FAQs
  • December 16, 2018
Supercharge Your Snowflake SQL
with Datameer's
Data Transformation

4 Easy Steps on how to use the command line to import SQL files in MySQL

Import a SQL file in MySQL

Below is the screenshot of importing create_tables.sql SQL file located at “D:\” drive in “sakila” Database.

  1. Open MySQL Command Line
  2. Insert the user name and the password
  3. mysql > use your_database;
  4. mysql > source file_path_with_file_name.sql

 

Import a SQL file in MySQL - Unicode SQL FAQ

And that’s how to use the command line to import SQL files in MySQL!

 


Up Next:

Read How to return data which contains multiple words in SQL?