Hi My txt is format blabla,blabla,blabla,bla,bla I know PHP and I can parse each line and save it to the database, but this will take 31 hours according to my calculations. Is there an easier way?
CodePudding user response:
Did you try using "import" feature? Another option is to generate insert statements using a scripting language (language eg python) and saving it as a sql file then execute the sql file.
CodePudding user response:
If you comma-separated-values file is alyreay in right order (first column mathes your first value, and same for remaining values), then try someting like:
LOAD DATA INFILE '/path/to/my-file.csv' INTO TABLE my_db.my_table;
https://dev.mysql.com/doc/refman/8.0/en/load-data.html
Else, you need to first write an algorithm to rearrange your CSV file's content (line by line), then try above.
