0 votes
1 view
in SQL by (22.4k 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:

mysql>c:/nitm.sql;

But this didn't work.

1 Answer

0 votes
by (72.3k 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

+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 31, 2019 in SQL by Tech4ever (22.4k points)
0 votes
1 answer
asked Sep 6, 2019 in SQL by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...