Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to prevent the default mysql client from ?:

  • 'removing newlines'
  • a.k.a. 'converting newlines to spaces'
  • a.k.a. 'mapping newlines to spaces'

Being more specific, with 'default mysql client' i mean the one in a terminal, command-line, shell or whatever you like to call it.

I didn't see an option for it at and couldn't easily find a solution.

My guess is that it will be hard because it logs to a file ( e.g. ~/.mysql_history), like other shells do (e.g. ~/.bash_history). But I thought it couldn't hurt to ask. Here's to hoping for workarounds, hacks or something like that.

share|improve this question
Are you talking about this?… (removing of end of line characters) If you are, binary-mode is what you are looking for, only available from 5.6. – jynus Jul 11 '14 at 20:02
It sounds like you're referring to the "MySQL Command Line Client" and the way it stores queries with newlines in such a way that you can't easily "up-arrow" back through those queries in order to run them again, because they're stored in the history as individual lines. Right? – Michael - sqlbot Jul 13 '14 at 5:28
Yes, i am referring to the easy 'up-arrow' to go back through previous queries in the Command Line Client. So i guess i will try that binary-mode. For people using ubuntu, it seems to be available in the universe-repository . – immeëmosol Jul 15 '14 at 6:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.