I have around 1000 html files in my local computer and I have to import them into database table in a single column . I mean one full file into one cell and 1000 HTML files into 1000 rows .
Table structure
CREATE TABLE `content` (
`ID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`data` text ,
PRIMARY KEY (`ID`)
)
one row contains ID and one html file contents
I tried
load DATA LOCAL INFILE 'C:\\Users\\userD\\Desktop\\data\\alter-data.html' INTO TABLE content LINES TERMINATED BY '</html>';
since each file end line is </html> but that didn’t help to load any data ..
Can any one help me on this?
Thank You
Regards
Kiran
I needed to do the same thing and spent ages working it out but it turned out to be simple.
Note the test table, test_html field was defined as a “text” field