Home  >  Article  >  Database  >  phpMyAdmin下将Excel中的数据导入MySql的图文方法

phpMyAdmin下将Excel中的数据导入MySql的图文方法

WBOY
WBOYOriginal
2016-06-07 18:02:441163browse

使用phpMyAdmin将Excel中的数据导入MySql,需要将execl导入到mysql数据库的朋友可以参考下。

一开始导入失败了。

生成的SQL语句不正确。

SQL 查询:

INSERT INTO `cc_present`.`c_city` (`A`, `B`, `C`) VALUES (NULL, 1, '市辖区')...

像这样列名称变为A,B,C了。

问题出在两个地方。

1.需要在Excel文件中加入列名称

另外注意Excel的Sheet名应该为表的名称,像下面这样。

2.需要勾选忽略首行选项

当然表名和字段名要和mySQL的定义一致,同时数据的类型和长度要没有问题,才能导入成功。

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