使用 MySQL 数据库,我想导入一个 13 列和 120 行的 csv 文件。我正在尝试将它们上传到表格中。
这是我的命令:
mysql> load data local infile 'restaurants.csv'
into table restaurants_restaurant fields
terminated by ',' enclosed by '"' lines terminated by '\n';
以下是报道的内容:
Query OK, 1 row affected, 4 warnings (0.05 sec)
Records: 1 Deleted: 0 Skipped: 0 Warnings: 4
仅添加了 1 行,并且仅添加了部分?我究竟做错了什么?
我的表结构:
class Restaurant(models.Model):
name = models.CharField(max_length=200)
category = models.CharField(max_length=200)
city = models.CharField(max_length=200)
location= models.CharField(max_length=200)
address= models.CharField(max_length=500)
phone_number= models.IntegerField()
email= models.CharField(max_length=200)
description= models.CharField(max_length=2000)
hours= models.CharField(max_length=200)
photos= models.CharField(max_length=200)
price= models.CharField(max_length=200)
rating= models.IntegerField()
review= models.CharField(max_length=2000)
我的 csv 的前 4 行:
American Burger,American,Dhaka,,,,,,,,2 to 4,4
ARIRANG,Korean,Dhaka,,"House 3, Road 51, Gulshan 2, Dhaka, Bangladesh.",(88-02) 989-6453,,,,,,
Aroma,,Dhaka,,,,,,,,15 to 20,3.5
Bacaru,,Dhaka,,,,,,,,,4