When in MariaDB or MySQL command line tool, hitting CTRL+C in the middle of a command will shut down the entire client, returning back to shell.
Instead, you can append \c
to the end of the line and hit enter and it will not execute anything on that line.
This is in fact provided in the startup message:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 64
Server version: 10.6.12-MariaDB-1:10.6.12+maria~ubu2004 mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
but I had always missed it.