Napisałem prosty skrypt do importowania plików csv rekurencyjnie w php, ale przy importowaniu tabela osiągnie mniej więcej 1 mln. rekordów i tyle, dopiero po zrestartowaniu serwera da się upchąć następne milion. Gdzie jest limit?
System: CentOS 7
baza: MariaDB
Skrypt(uruchamiany z konsoli):
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ // set time limit a script is allowed to run. Default 30, 0 = no time limits. if (!$connect) { } else { } // supply your database name $rdi=new RecursiveIteratorIterator(new RecursiveDirectoryIterator('/var/lib/mysql/2011')); foreach($rdi as $file) { $path = "/var/lib/mysql/2011/"; $query = " LOAD DATA INFILE '".$path. $rdi->getFilename()."' INTO TABLE rok2012 FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 ROWS; "; } ?>