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.
...