Why does ctrl-c not exit mysql input mode in Windows?
Because you have told MySQL to interpret your exit commands as valid input.
What makes the MySQL terminal hard to understand is there there are different modes for single quote, double quote, and normal mode.
So to get out of mysql input mode, you will have to do these steps:
- Get out of double quote mode.
- Get out of single quote mode.
- Get out of mysql mode.
- Exit mysql back to the default terminal.
Most basic example:
mysql> /version
->
->
->
-> \c
mysql> exit
Bye
C:\>
You never left default mode in the above example so exit commands work correctly.
Example 2 (this is what is tripping you up).
mysql> hello
->
-> look dash is on the left"
"> In doublequote mode now, because doublequote above
"> adding another doublequote breaks you out: "
-> look a single quote ' here
'> in single quote mode now.
'> get out, in, then out again with three singlequotes: '''
-> now it will listen to your escape code: \c
mysql> exit
Bye
C:\>
While you are in single quote mode or double quote mode, no escape sequences are respected. Even Ctrl-C and Ctrl-D are ignored in these modes.
In which one of the 26 universes does Ctrl-C not stop a program regardless of mode? We may never know. Bazinga.