Let's start by explaining why I'm using Navicat, the first reason, because it's 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 hostname fills in: localhost, the port is 3306, and then fill in the user name 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-click localhost, choose to create a new database, I filled out here Infosystem, you can change the name as needed, note the next choice of character set options, if everyone's data source in Chinese, then it is best to choose gb2312, sorting selection gb2312_ Chinese_ci, so that the data can be displayed correctly in the database, to avoid the appearance of Chinese garbled.
Select the Infosystem database that you just created, click the Import Wizard button in the upper right of the Navicat form, go to the Import Wizard, and then follow the wizard step-by-step configuration:
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
So, very simple, the original Excel data imported into the MySQL database, at this time, in the SystemInfo database can see a new table just imported, open to see if the display is correct. At this point, the data source has been taken care of.
The above describes the SQL2000 database Excel data import MySQL database implementation code, including the content of sql2000 database, I hope the PHP tutorial interested in a friend helpful.