The implementation code _php skill of Excel data importing MySQL database

Source: Internet
Author: User


First of all, explain why I want to use Navicat, the first reason, because it is a good MySQL GUI tool, and more importantly, it can import some external data sources into the MySQL database. Because my data source is Excel data, I want to use Navicat to import it into MySQL.

First run, first create the connection, the host name fill: localhost, Port 3306, and then fill in the username password, OK. If it goes well, you can see the connection icon named localhost. Double-click to open it, the general MySQL default has two databases, respectively, MySQL and test.

Do not care about them, right key localhost, choose to create a new database, I fill in the infosystem here, you can modify the name as needed, note that the next selection of character set options, if you have the data source in Chinese, then it is best to choose gb2312, sorting out the choice of gb2312_ Chinese_ci, this can ensure that the data can be correctly displayed in the database, to avoid the emergence of Chinese garbled.

Select the Infosystem database you just built, click the Navicat form to import the wizard button, go to the Import Wizard, and then follow the wizard step-by-Step to configure:

Type is an Excel file
Select the exact location of the Excel file you want to import and one of the tables in Excel
Configure table structure
Start Import
In this way, very simple, original Excel data imported into the MySQL database, at this time, in the SystemInfo database can see a just imported a new table, open to see if the display is correct. At this point, the data source has been taken care of.

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.