I'm trying to load up a simple CSV file using this tutorial. My CSV includes the list of nationalities, of which here is a sample:
1,Afghan,2015-10-14 17:56:39
Meanwhile, my table definitions is:
+-------------+--------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+-------------------+-----------------------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| Nationality | varchar(255) | NO | UNI | NULL | |
| Time | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+-------------+--------------+------+-----+-------------------+-----------------------------+
I'm running the following command:
BULK INSERT meta_nationality FROM '/home/benjamin/Downloads/Nationalities.csv' WITH (fieldterminator = ',', rowterminator ='\n');
This seems to be right, however I get an error message pointing to a syntax issue:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk insert...
According to the documentation the syntax error refers to the use of a reserved word, but I wouldn't know which one it is in this case.
Could you help me figure out my way through this? Thanks.