Implementation code for importing Excel data into Mysql database _ PHP Tutorial

Source: Internet
Author: User
The implementation code for importing Excel data into the Mysql database. First, I want to explain why I want to use Navicat. The first reason is that it is a good MysqlGUI tool. More importantly, it can import some external data sources to the Mysql database. First, it explains why I want to use Navicat. The first reason is that it is a good Mysql GUI tool. 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 to Mysql.

For the first run, first create a connection, enter localhost in the host name, Port 3306, and then enter the username and password, OK. If the connection succeeds, you can see the connection icon named localhost. Double-click it. generally, Mysql has two databases by default, namely mysql and test.

You don't need to worry about them. right-click localhost and choose Create New Database. I entered infosystem here. you can modify the name as needed. Note that the character set option is selected next. if your data source contains Chinese characters, we recommend that you select gb2312 and gb2312_chinese_ci to ensure that the data can be correctly displayed in the database and avoid Chinese garbled characters.

Select the newly created infosystem database, click the import wizard button in the upper-right corner of the navicat form to enter the import wizard, and configure it step by step according to the Wizard:

Excel files
Select the location of the excel file you want to import and a table in the excel file
Configure table structure
Start Import
In this case, it is very easy to import the data in the original excel file to the Mysql database. then, you can see a new table you just imported in the systeminfo database and check whether the table is correctly displayed. Now, the data source is ready.

...

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.