0

I have a problem to transfer Excel data to My SQL Query Browser? Someone can help me with how to transfer Excel data to SQL?

My excel data is store

  C:\2019\countries.xlsx

My excel data is like below the picture:

enter image description here

Below is my SQL info, I won't put excel file data to column(id, name,country_code and language):

enter image description here

I hope anyone can guide me on how to use an easy way to insert data into the database. Thanks.

Ramprasath Selvam
  • 3,868
  • 3
  • 25
  • 41
  • Does this answer your question? [How to import CSV file to MySQL table](https://stackoverflow.com/questions/3635166/how-to-import-csv-file-to-mysql-table) – John Klakegg Nov 01 '19 at 09:48

1 Answers1

0

You need to convert into csv then use the below query to import.

load data local infile 'C:/2019/countries.csv' into table countries
fields terminated by ','
enclosed by '"' 
lines terminated by '\r\n'
ignore 1 lines;

You can refer the detail in docs here

Note: If using Windows terminate by '\r\n' use '\n' on Linux based OS.

James
  • 1,819
  • 2
  • 8
  • 21