How to Import SQL file into mysql

0 votes

I have a database called edureka. I haven't created any tables there. But I have a SQL file which contains all the necessary data for the database. The file is edureka.sql which is in C:\ drive. This file has 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:/edureka.sql;

But this didn't work.

Aug 19, 2020 in PHP by kartik
• 37,510 points
150 views
I did this, but for some reason not all of my tables were imported..what do I do?

Hello,

If you are using phpMyAdmin, you can simply create a database and then go to the import tab and upload there, or you can SSH to your server and run 'mysql -u username -ppassword database_name < FILE.sql'. Make sure -ppassword has your password after it with no spaces.

1 answer to this question.

0 votes

Hello @kartik,

From the mysql console:

mysql> use DATABASE_NAME;

mysql> source path/to/edureka.sql;

make sure there is no slash before path if you are referring to a relative path.

Hope it helps!!
Thank You!

answered Aug 19, 2020 by Niroj
• 82,720 points

Related Questions In PHP

0 votes
1 answer

How to save MySQL query output to excel or .txt file?

Hello @kartik, You can write following codes to ...READ MORE

answered Aug 20, 2020 in PHP by Niroj
• 82,720 points
1,576 views
0 votes
1 answer

What is Php Mysql Database? How php connect to database?

Hello kartik, MySQL is the most popular database ...READ MORE

answered Feb 25, 2020 in PHP by Dey
257 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,720 points
429 views
0 votes
0 answers
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,720 points
7,092 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,720 points
812 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,720 points
627 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,720 points
7,497 views
0 votes
1 answer

How do I import an SQL file using the command line in MySQL?

Hello @kartik, Try: mysql -u username -p database_name < ...READ MORE

answered Aug 26, 2020 in PHP by Niroj
• 82,720 points
105 views
0 votes
1 answer

How to concatenate text from multiple rows into a single text string in SQL server?

Hello @kartik, Use COALESCE: DECLARE @Names VARCHAR(8000) SELECT @Names = ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,720 points
1,360 views