If you're OK with a SQL command that spreads across multiple lines, then oedo's suggestion is the easiest:
INSERT INTO mytable (myfield) VALUES ('hi this is some text
and this is a linefeed.
and another');
I just had a situation where it was preferable to have the SQL statement all on one line, so I found that a combination of CONCAT_WS()
and CHAR()
worked for me.
INSERT INTO mytable (myfield) VALUES (CONCAT_WS(CHAR(10 using utf8), 'hi this is some text', 'and this is a linefeed.', 'and another'));