Importing the CSV File in MySQL Workbench

  • By Karishma Pawar
  • January 25, 2024
  • SQL
Importing the CSV File in MySQL Workbench

Importing the CSV File in MySQL Workbench

Many times, it is difficult to insert data into tables manually if the count of the rows is large. In MySQL workbench, you can import records from a CSV file. The procedure for importing the CSV file is given below. In this blog, we will discuss about Importing the CSV file in MySQL Workbench.

 

For Free, Demo classes Call: 020 7117 1500

Registration Link: Click Here!

 

Let us consider Emp.csv file as shown below. 

Importing the CSV File in MySQL Workbench

 

Step 1: Create database in MySQL and select the database 

create database demo456; 

use demo456; 

 

Step 2: Create a structure of the table as follows in MYSQL 

 

CREATE TABLE basic_pays(

    employee_name VARCHAR(50) NOT NULL,

    department VARCHAR(50) NOT NULL,

    salary INT NOT NULL,

    PRIMARY KEY (employee_name , department)

);

 

Step 3: Check whether a table is created. Currently the table is empty. 

Select * from basic_pays;

Importing the CSV File in MySQL Workbench

Step 4: Click on “Import records from an external file”

Importing the CSV File in MySQL Workbench

 

For Free, Demo classes Call: 020 7117 1500

Registration Link: Click Here!

 

Step 5: Browse to the location where csv file is stored and click on Next

Importing the CSV File in MySQL Workbench

 

Step 6: As we have already created a table basic_pays in the database demo456, select the option for “Use existing table” and click Next

Importing the CSV File in MySQL Workbench

Step 7: Check source and destination columns. Click on Next

Importing the CSV File in MySQL Workbench

 

For Free, Demo classes Call: 020 7117 1500

Registration Link: SQL Training in Pune!

 

Step 8: Click on Next to import the data. 

Importing the CSV File in MySQL Workbench

 

Step 9: Click on Finish to complete the procedure for importing the data

This is one of the ways to import large CSV files in MySQL workbench. 

Importing the CSV File in MySQL Workbench

 

Do watch our Channel to learn more: Click Here

 

Author:

Karishma Pawar

Call the Trainer and Book your free demo Class For SQL Call now!!!
| SevenMentor Pvt Ltd.

© Copyright 2021 | SevenMentor Pvt Ltd.

Submit Comment

Your email address will not be published. Required fields are marked *

*
*