3.5. Starting and Stopping the MySQL Server

If you installed MySQL on Windows with the wizards, on Linux with an RPM, or on a Mac with a PKG file, the MySQL server was started during installation and set up so that it starts automatically whenever your computer boots. However, you might sometimes need to stop or start the server. For instance, if you upgrade MySQL, you must shut down the server before starting the upgrade. Instructions for starting and stopping the MySQL server are provided in this section.

If you installed MySQL from source code, you need to start the MySQL server manually and set it up so that it starts automatically when your computer boots. The instructions for starting the server and setting it up to start at boot up are included in the "Installing MySQL from source files" section, earlier in this chapter.

3.5.1. Controlling the server on Windows

If you're using Windows NT/2000/XP/Vista, MySQL runs as a service. (MySQL is installed as a service when you configure it, as described in the section "Running the MySQL Configuration Wizard," earlier in this chapter.) You can check whether MySQL is installed as a service, as described in the section, "Checking the MySQL Installation," earlier in this chapter. Starting and stopping the service is described in the following sections. You can also start and stop the server manually by using commands set up when MySQL is installed.

If you're using Windows 98/Me, you can start and stop the server from the command line ...

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.