Rechercher dans le manuel MySQL

13.7.7.8 RESTART Syntax

  1. RESTART

This statement stops and restarts the MySQL server. It requires the SHUTDOWN privilege.

One use for RESTART is when it is not possible or convenient to gain command-line access to the MySQL server on the server host to restart it. For example, SET PERSIST_ONLY can be used at runtime to make configuration changes to system variables that can be set only at server startup, but the server must still be restarted for those changes to take effect. The RESTART statement provides a way to do so from within client sessions, without requiring command-line access on the server host.

Note

After executing a RESTART statement, the client can expect the current connection to be lost. If auto-reconnect is enabled, the connection will be reestablished after the server restarts. Otherwise, the connection must be reestablished manually.

A successful RESTART operation requires mysqld to be running in an environment that has a monitoring process available to detect a server shutdown performed for restart purposes:

  • In the presence of a monitoring process, RESTART causes mysqld to terminate such that the monitoring process can determine that it should start a new mysqld instance.

  • If no monitoring process is present, RESTART fails with an error.

These platforms provide the necessary monitoring support for the RESTART statement:

  • Windows, when mysqld is started as a Windows service or standalone. (mysqld forks, and one process acts as a monitor to the other, which acts as the server.)

  • Unix and Unix-like systems that use systemd or mysqld_safe to manage mysqld.

On Windows, the forking used to implement RESTART makes determining the server process to attach to for debugging more difficult. To alleviate this, starting the server with --gdb suppresses forking, in addition to its other actions done to set up a debugging environment. In non-debug settings, --no-monitor may be used for the sole purpose of suppressing forking the monitor process. For a server started with either --gdb or --no-monitor, executing RESTART causes the server to simply exit without restarting.


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-restart.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