- Instant help with your Sql coding problems

Import an SQL file using the command line in MySQL

Question:
How to import an SQL file using the command line in MySQL?
Answer:
mysql -u username -p database_name < file-to-import.sql
Description:

If you want to import data into your MySQL database using the command line use the mysql command. You need to define the username, password and the database where you want to import data from the SQL file. 

Share "How to import an SQL file using the command line in MySQL?"