I'm starting my studies in MySQL. I decided to install MariaDB 10.1.14 on CentOS. I want to create a database from a .csv file with approximately 166 million rows. I searched for tutorials on the internet, but it seems they all assume that the user knows something a priori about databases, which is not my case. Also, I'm finding the official MariaDB documentation a bit complicated, with few examples.
That said, suppose I have the test.csv file and its contents are as follows:
UF,ValorParcela,MêsCompetência
PE,185.00,01/2015
AM,147.00,01/2015
PR,232.00,01/2015
PE,310.00,01/2015
PB,463.00,01/2015
CE,182.00,01/2015
AL,112.00,01/2015
MG,112.00,01/2015
BA,112.00,01/2015
Suppose I want to import the contents of this test.csv into a database purse. So far, I've found that I need to do the following:
CREATE DATABASE bolsa;
USE bolsa;
LOAD DATA LOCAL INFILE teste.csv;
INTO TABLE bolsa
FIELDS TERMINATED by ','
LINES TERMINATED BY '\n';
Only this code is not correct. The error messages are not clear to me. I would appreciate it if anyone could give me a light on how to resolve this issue.