End MySQLd session to return to command prompt

I am using Ubuntu Natty.

I started mysqld from the command line using the following:

mysqld -ndbcluster --console -umysql 

Why do I get the following:

 120314 0:09:49 [Warning] option 'new': boolean value 'dbcluster' wasn't recognized. Set to OFF. 120314 0:09:49 [Note] Plugin 'ndbcluster' is disabled. 120314 0:09:49 [Note] Plugin 'FEDERATED' is disabled. 120314 0:09:50 InnoDB: The InnoDB memory heap is disabled 120314 0:09:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins 120314 0:09:50 InnoDB: Compressed tables use zlib 1.2.3 120314 0:09:50 InnoDB: Using Linux native AIO 120314 0:09:50 InnoDB: Initializing buffer pool, size = 128.0M 120314 0:09:50 InnoDB: Completed initialization of buffer pool 120314 0:09:50 InnoDB: highest supported file format is Barracuda. 120314 0:09:50 InnoDB: Waiting for the background threads to start 120314 0:09:51 InnoDB: 1.1.8 started; log sequence number 1595675 120314 0:09:51 [Note] Event Scheduler: Loaded 0 events 120314 0:09:51 [Note] mysqld: ready for connections. Version: '5.5.19-ndb-7.2.4-gpl-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Cluster Community Server (GPL) 

However, I cannot figure out how to end the session. I tried Control-C and many other combinations.

How to end a session and return to the command line ?!

Thanks.

+4
source share
2 answers

ctrl + c will generate a SIGINT , which can be captured or blocked by the application. If you just start killall mysqld from another terminal, you will send SIGTERM to a process that may also be caught or blocked, but will give a much stronger hint that the process should stop immediately. (Which would be good for cleanly closing database tables.)

ctrl + \ will generate a SIGQUIT , which can be captured or blocked by the application. (If the application does not block this signal, the OS will generate a main file for you.)

You can send SIGKILL manually using kill(1) ; SIGKILL cannot be caught or blocked and thus will always stop the process if the kernel is sufficient to process the signal. Find pid using pidof or some other mechanism and run kill -SIGKILL pid . Note that this is a gross death; the process is not given the opportunity to clean up after itself, so the database tables may remain in an inconsistent state, which may take some time to be restored at the next start.

If you just need to go back, you can use ctrl + z to pause the process. You can then use the shell commands bg and fg to let the process continue to run in the background or re-join the process in the foreground. (This terminology does not make sense, but I hope that it conveys this idea.)

+10
source

Press Ctrl + \ .

MySQL seems to ignore SIGINT (which is issued when Ctrl + C is pressed), but performs a clean shutdown when it receives SIGQUIT (which is sent by Ctrl + \ ).

See samold's answer for details.

+1
source

Source: https://habr.com/ru/post/1401275/


All Articles