Rechercher dans le manuel MySQL

4.10 Unix Signal Handling in MySQL

On Unix and Unix-like systems, a process can be the recipient of signals sent to it by root or the account that owns the process. Signals can be sent using the kill command. Some command interpreters associate certain key sequences with signals, such as Control+C to send a SIGINT signal. This section describes how the MySQL server and client programs respond to signals.

Server Response to Signals

mysqld responds to signals as follows:

  • SIGTERM causes the server to shut down. This is like executing a SHUTDOWN statement without having to connect to the server (which for shutdown requires an account that has the SHUTDOWN privilege).

  • SIGHUP causes the server to reload the grant tables and to flush tables, logs, the thread cache, and the host cache. These actions are like various forms of the FLUSH statement. Prior to MySQL 8.0.20, the server also writes a status report to the error log that has this format:

    Status information:
    
    Current dir: /var/mysql/data/
    Running threads: 0  Stack size: 196608
    Current locks:
    
    Key caches:
    default
    Buffer_size:       8388600
    Block_size:           1024
    Division_limit:        100
    Age_limit:             300
    blocks used:             0
    not flushed:             0
    w_requests:              0
    writes:                  0
    r_requests:              0
    reads:                   0
    
    handler status:
    read_key:            0
    read_next:           0
    read_rnd             0
    read_first:          1
    write:               0
    delete               0
    update:              0
    
    Table status:
    Opened tables:          5
    Open tables:            0
    Open files:             7
    Open streams:           0
    
    Alarm status:
    Active alarms:   1
    Max used alarms: 2
    Next alarm time: 67
  • As of MySQL 8.0.19, SIGUSR1 causes the server to flush the error log, general query log, and slow query log. One use for SIGUSR1 is to implement log rotation without having to connect to the server (which to flush logs requires an account that has the RELOAD privilege). See Section 5.4.6, “Server Log Maintenance”.

    The server response to SIGUSR1 is a subset of the response to SIGHUP, enabling SIGUSR1 to be used as a more lightweight signal that flushes certain logs without the other SIGHUP effects such as flushing the thread and host caches and writing a status report to the error log.

  • SIGINT normally is ignored by the server. Starting the server with the --gdb option installs an interrupt handler for SIGINT for debugging purposes. See Section 29.5.1.4, “Debugging mysqld under gdb”.

Table des matières Haut

Client Response to Signals

MySQL client programs respond to signals as follows:


Rechercher dans le manuel MySQL

Traduction non disponible

Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-unix-signal-response.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :en Manuel MySQL : https://dev.mysql.com/

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut