2
I am starting my studies in Mysql. I decided to install Mariadb 10.1.14 in Centos. I want to create a database from a file . csv with about 166 million lines. I looked for tutorials on the internet, but it seems that they all assume that the user knows something a priori about databases, which is not my case. Also, I’m finding the official documentation of Mariadb a little complicated, with few examples.
This put, suppose I have the test.csv file and its content is 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
Let’s assume that I want to import the contents of this test.csv into a database bag. 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 really appreciate it if someone could shed some light on how to solve this.
Have you created the stock table? You in this code are creating the stock database, but I see no mention of the stock table (which should have another name). If possible place the error messages that are coming.
– lazyFox
It has been so long since I had this problem that I gave up on it. I ended up solving otherwise without using Mysql.
– Marcus Nunes