Import SQL file via mysql command line

Category:
Mysql
Tags:
Mysql

Samundar Singh Rajpurohit
6 months ago

Hi friends,

Imagine you have a large SQL file containing a substantial amount of data. Importing this SQL file directly through phpMyAdmin may be impossible due to its size. In such cases, you can follow these steps:

  1. Open the MySQL terminal by navigating to [https://prnt.sc/0fo4TgDaoSpm]
  2. The terminal opens and asks for a password then press enter key.
  3. Select your database name
   mysql> use db_name; //db_name replace with your database name

 4. select your SQL file path.

mysql> source C:\Users\rsamundar\Downloads\nextaway_web (1).sql

5. After executing the source command, verify that all tables from your SQL file have been successfully imported into your database.



DevZone
Made by developer, Made for developers