Macos – MySQL in OS X Terminal.app — how to exit thesql command prompt but continue using the Terminal

macosMySQLoh-my-zshterminal.app

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.)

Best Answer

\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.

Related Question