Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (20.3k points)

I have a database called nitm. I haven't created any tables there. But I have a SQL file that contains all the necessary data for the database. The file is nitm.sql which is in C:\ drive. This file has a size of about 103 MB. I am using wamp server.

I have used the following syntax in MySQL console to import the file:


But this didn't work.

1 Answer

0 votes
by (119k points)

Run these commands in the MySQL console to import the SQL file :

mysql> use DatabaseName;

mysql> source_path/to/file.sql;

Note: Don't use a slash in the starting of the file path referring to the relative path. 

I recommend checking out this SQL Tutorial to learn the fundamentals of SQL.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Dec 17, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked Sep 6, 2019 in SQL by Sammy (47.6k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories