Two ways to import excel Data to mysql database

Source: Internet
Author: User

The following describes two methods for importing excel Data to the mysql database. These two methods are simple and convenient, in the past, I used php programs to import excel Data to mysql databases. Now we don't need a program, just use the existing tools.

The following describes two methods for importing excel Data to mysql: Database tutorial. These two methods are simple and convenient, in the past, I used php Tutorial programs to import excel Data to mysql databases. Now we don't need a program, just use the existing tools.

Method 1: Use phpmyadmin to import excel Data to the mysql database as follows:

This is an excel file. It must look like this.

The format of the phpmyadmin import file should be as configured. (Note that the structure of the imported excel table must be consistent with that of the mysql DATA table and the data type. Otherwise, the Import fails.

Method 2: generate an excel file. The SQL file is OK.

1. In the last column of the data to be imported, write an excel Formula as follows:
= Concatenate ("insert into employee (name, birthday, email, Hober) values ('", rc [-4], "', '", rc [-3], "','", rc [-2], "','", rc [-1], "');")
2. Select the last column, copy the data to a text file, and save the text file as a. SQL file (do not forget to delete the "SQL" in the first line ").
Note: if there is a date, modify the formula.
= Concatenate ("insert into employee (name, birthday, email, Hober) values ('", rc [-4], "', '", text (rc [-3], "yyyy-mm-dd hh: mm: ss"), "','", rc [-2], "','", rc [-1], "');")

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.