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.
Written by Ben Doerr
Related protips
4 Responses
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:
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Related Tags
#mysql
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#