There is such a request:
LOAD DATA INFILE '%s' IGNORE INTO TABLE %s FIELDS TERMINATED BY ',' ENCLOSED BY \"'\" LINES TERMINATED BY '\n'
The problem is that in the downloadable file there are often values that already exist in the database and stand as unique. When such a record occurs, it does not add, but the auto-increment still increases the value for inserting the next record. That is, I had a table:
id string 1 text1 2 text2 ... 20 text20
Then I made an insert from the file, where all the records except 4, for example, were repetitions and it turned out:
id string 20 text20 ... 500 text25
How to make the auto-increment not increase if an error occurred (such a field already exists in the database) preferably without a temporary table? Thank.