Last Updated: February 25, 2016
·
1.852K
· bendoerr

Avoid Ctrl-C MySQL Woops

I have a habit of hitting ctrl-c when I type something I don't want to execute. This is bad when I am connected to MySQL and writing some query. I know to finish my line with \c if I don't want it executed but muscle memory is intense. So to avoid completely exiting my MySQL shell I start it with the --sigint-ignore flag.

mysql -u root --sigint-ignore

Now ctrl-c won't exit out of MySQL.

4 Responses
Add your response

Awesome :D Thanks!

over 1 year ago ·

You can get this behaviour by default if you add the the following to your ~/.my.cnf:

[mysql]
sigint-ignore
over 1 year ago ·

@joni Thats great. Just added it. Thanks.

over 1 year ago ·

Starting in version 5.1 the CTRL-C behavior was changed. Some discussion here:

http://bugs.mysql.com/bug.php?id=66583

over 1 year ago ·