Insert large amounts of text into a MySQL database

I ran into a problem while pasting a lot of text into the MySql database.

Can I get any pointers (which column types to use and any other problems I need to know) regarding how I can achieve this, the code works fine with small amounts.

Thanks in advance.

Explanation Text blocks have about 7000 characters.

And the problem I am facing is that the PHP application tells me that the data has been saved, but when I look at dbase, the record is not stored.

I changed the specific column to LONG TEXT, but it doesn't seem to be the trick.

thank

+3
source share
2 answers

LONGBLOB LONGTEXT, .

0

, innodb , :

sort your data file into the primary key order of the target table 
(innodb uses clustered primary keys)

:

truncate <table>;

set autocommit = 0;

load data infile <path> into table <table>...

commit;

, :

unqiue_checks = 0;
foreign_key_checks = 0;
sql_log_bin = 0;
split the csv file into smaller chunks

:

, tinyint unsigned vs int ..

, varchar.

0

Source: https://habr.com/ru/post/1770749/


All Articles