我在本地使用WAMPSERVER2.5
我在OpenOfficeCalc上建立了我的数据库:db.txt
- Character set: Unicode (UTF-8)
- Field separator: ,
- Text separator: "
我想在名为"db_pma"的表中导入"db.txt",这是在名为"hct"的数据库中(在PhpMyAdmin中)
"db.txt"包含两个字段:
- string_field (character string, max:30)
- numeric_field (sample: 5862314523685.256325632)
问题:
1)我是否需要首先在PhpMyAdmin创建表的结构("db_pma"),这将包含数据?
2)我试着用这个代码导入"db.txt"
mysql -h localhost -u root
LOAD DATA LOCAL INFILE 'db.txt'
INTO TABLE dp_pma
FIELDS TERMINATED BY ','
LINES TERMINATED BY 'AUTO';
它不工作。你能帮我吗?
请使用LINES TERMINATED BY 'rn'
(适用于Windows)或LINES TERMINATED BY 'n'
(适用于Linux)。