How can I escape all CRLF chars in all column values when doing a select?

Tags:
Linux
MySQL
Let's say I want to do:
SELECT * FROM tableName
But some columns' values have linebreaks, so in my MySQL console it breaks the formatting of the table. I know I can circumvent this by explicitly REPLACE()ing CLRF chars, but this requires me naming each column and is not very quick to type out, eg.:
SELECT id, name, REPLACE(REPLACE(description, 'r', 'r'), 'n', 'n') as 'description'... FROM tableName
The above is annoying to type, especially if i need to do this for multiple column names. So I guess I'm asking how I can achieve the same result, but with something as easy as a SELECT *. Is there some kind of setting I can invoke at the beginning of a MySQL connection to do this for all output by default?


Software/Hardware used:
mysql,linux
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: