MySQL in OS X Terminal.app -- how to exit mysql command prompt but continue using the Terminal?

21,317

Solution 1

\q 

so it will appear like this in the terminal window:

mysql> \q

will quit mysql and return you to the bash (or zsh if that's your default) shell. Once you've entered mysql, try using \h for a list of commands.

Solution 2

quit
exit

both works.
Shortcut ctrl + C but doesn't work sometimes.

Share:
21,317
user163831
Author by

user163831

Updated on September 18, 2022

Comments

  • user163831
    user163831 over 1 year

    I type mysql and enter the mysql command prompt (denoted ~mysql) (I have ohmyzsh installed also). But I can't seem to do anything within it. No commands work. To exit, I type 'exit', and get [Process completed] with typing disabled thereafter, thus I have to quit and reopen Terminal altogether. Any idea as to why or how to work this? I'm trying to get used to the command line, still a novice, haven't been using my local mysql in Terminal, only that in virtual machines via ssh, so I wasn't dealing with this one. This is bothering me. I just want to fiddle around without having to launch a VM and ssh in and THEN log in to mysql. (I know of sqlfiddle but that's limited.)