Home >Backend Development >PHP Tutorial >Implementation code for importing Excel data into Mysql database using sql2000 database

Implementation code for importing Excel data into Mysql database using sql2000 database

WBOY
WBOYOriginal
2016-07-29 08:38:101319browse

First let me explain why I use Navicat. The first reason is because 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 into Mysql.
The first time you run it, first create a connection, fill in the host name: localhost, the port is 3306, then fill in the username and password, OK. If everything goes well, you will be able to see the connection icon named localhost. Double-click it to open it. Generally, Mysql has two databases by default, namely mysql and test.
Ignore them, right-click localhost and choose to create a new database. I filled in the infosystem here. You can modify the name as needed. Pay attention to the option to select the character set next. If your data source has Chinese, it is best to choose gb2312 , select gb2312_chinese_ci for sorting, which can ensure that the data can be displayed correctly in the database and avoid the occurrence of Chinese garbled characters.
Select the infosystem database you just created, click the Import Wizard button at the top right of the navicat form to enter the import wizard, and then follow the wizard to configure step by step:
The type is Excel file
Select the specific location and excel of the excel file you want to import A certain table in
Configure the table structure
Start importing
That’s it, it’s very simple. The original data in excel is imported into the Mysql database. At this time, you can see a new table just imported in the systeminfo database. Open it and see if it displays correctly. At this point, the data source has been determined.

The above introduces the implementation code of sql2000 database to import Excel data into Mysql database, including the content of sql2000 database. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn