Lancer MySQL en ligne de commande <<< |
Lancer MySQL comme un service Windows | Faire fonctionner MySQL sous Windows >>> |
2.2.1 Installer MySQL sous Windows 2.2 Installation standard rapide de MySQL 2 Installer MySQL Manuel de Référence MySQL 4.1 : Version Française . Prérequis système sur Windows . Installation d'une distribution binaire sur Windows . Préparation de l'environnement MySQL de Windows . Choisir un serveur Windows . Démarrer le serveur pour la première fois . Lancer MySQL en ligne de commande ->Lancer MySQL comme un service Windows . Faire fonctionner MySQL sous Windows . MySQL pour Windows face à MySQL pour Unix |
2.2.1.7 Lancer MySQL comme un service Windows
Dans la famille NT (Windows NT, 2000 ou XP), the recommended way to run MySQL is to install it as a Windows service. Then Windows starts and stops the MySQL server automatically when Windows starts and stops. A server installed as a service can also be controlled from the command line using NET commands, or with the graphical Services utility. The Services utility (the Windows Service Control Manager ) can be found in the Windows Control Panel (under Administrative Tools on Windows 2000). It is advisable to close the Services utility while performing server installation or removal operations from this command line. This prevents some odd errors.To get MySQL to work with TCP/IP on Windows NT 4, you must install service pack 3 (or newer)! Before installing MySQL as a Windows service, you should first stop the current server if it is running by using the following command:
As of MySQL 4.0.2, you can specify a specific service name after the --install option. As of MySQL 4.0.3, you can in addition specify a --defaults-file option after the service name to indicate where the server should obtain options when it starts up. The rules that determine the service name and option files the server uses are as follows:
In the usual case that you install the server with --install but no service name, the server is installed with a service name of MySQL . As a more complex example, consider the following command:
Once a MySQL server is installed as a service, Windows will start the service automatically whenever Windows starts. The service also can be started immediately from the Services utility, or by using the command NET START MySQL . The NET command is not case sensitive. Please note that when run as a service, mysqld has no access to a console window, so no messages can be seen there. If mysqld doesn't start, check the error log to see if the server wrote any messages there to indicate the cause of the problem. The error log is located in the C:\mysql\data directory. It is the file with a suffix of .err .When mysqld is running as a service, it can be stopped by using the Services utility, the command NET STOP MySQL , or the command mysqladmin shutdown . If the service is running when Windows shuts down, Windows will stop the server automatically. From MySQL version 3.23.44, you have the choice of installing the server as a Manual service if you don't wish the service to be started automatically during the boot process. To do this, use the --install-manual option rather than the --install option:
The change to tell Windows to wait longer when stopping the MySQL server works for Windows 2000 and XP. It does not work for Windows NT, where Windows waits only 20 seconds for a service to shut down, and after that kills the service process. You can increase this default by opening the Registry Editor \winnt\system32\regedt32.exe and editing the value of WaitToKillServiceTimeout at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control in the Registry tree. Specify the new larger value in milliseconds. For example, the value 120000 tells Windows NT to wait up to 120 seconds. If you don't want to start mysqld as a service, you can start it from the command line the same way as for versions of Windows that are not based on NT. For instructions, see Lancer MySQL en ligne de commande Windows . |
<< | Lancer MySQL comme un service Windows | >> |
Lancer MySQL en ligne de commande | Installer MySQL sous Windows | Faire fonctionner MySQL sous Windows |