General Installation Steps
Before going through the actual installation steps, there are some decisions to be made. The first, and most important, two are:
At the time of this writing, there are stable releases available of MySQL 4.1 and 5.0, while 5.1 is in its alpha stage (there are also old releases still available of Versions 3.23 and 4.0). Generally I would recommend that you download the current stable version, which is marked as GA (Generally Available). The latest version will have the most features available (see the Introduction for a discussion of this). The main reason to install an older version of MySQL would be if you were currently using a different version of MySQL on another computer and wanted to ensure cross-computer consistency with the least amount of effort.
As for the installation method, MySQL is available in a precompiled binary format or as the raw source code. If a binary is available for your platform, you'll want to go with that unless you need to configure the installation (if, for instance, you need to change the default location or add support for other features). The binaries are also available in two formats: Standard (also called Windows Essentials as a Windows download) and Max (or just plain Windows as a Windows download). The former is smaller and should run faster. The latter has extra features enabled.
When you go to download MySQL, you'll notice that files have their own naming conventions. For example, a release may be called mysql-5.0.18. The first number indicates the major version. The second number is the release level. The combination of these two numbers is the release series, which is the most important thing to remember (4.0, 4.1, 5.0, 5.1, etc.). The third number is the version number within the release series.
Non-production versions will be followed with -alpha, -beta, or -rc (for release candidate, which is almost production caliber). I would advise that you avoid these. Finally, if you download the complete binary package, it may also have the word max added to the name.
Before going into the operating-system-specific installation instructions, here is a preview of the general installation steps.
To install MySQL:
Confirm that your operating system is supported.
MySQL is available for a long list of platforms, so it's a safe bet that you can use it. That being said, it's always best to check prior to going through all of the effort. MySQL will run on Windows 9.x,
Me, NT, 2000, 2003, and XP; Mac OS X; and several variants of Unix and Linux. The full list of supported operating systems appears in the MySQL manual; see section 2.1.1, "Operating Systems Supported by MySQL" (Figure 1.1
Figure 1.1. MySQL runs on the vast majority of available operating systems.
Select the release series of MySQL you'll want.
This is where you'll most likely decide to install the most current Generally Available release. MySQL still updates older releases as warranted by bug or security fixes, but you should probably install the current, stable version.
Select the distribution format.
Unless you know you need to create a custom installation, opt for a binary version, if one is available for your operating system. As to the choice between the Standard and Max versions, I leave that up to you. It's really a matter of whether you want a smaller size and faster speed or all of the enabled features.
Download the software.
Just click the link and follow the prompts to get MySQL. There is a form you can optionally fill out to give the MySQL company some information, or you can click the No thanks... message to just get the software. You'll probably have to download the software from a mirror site at the end.
Make sure you do not have an existing version of MySQL running.
If you already have a version of MySQL installed and running, see the "Upgrading MySQL" section later in this chapter prior to doing anything else.
Install the downloaded software.
This step will vary the most, as it depends upon what operating system you are using and whether you selected a precompiled binary version or the source code version in Step 3. The following sections of this chapter will focus on this part of the overall process.
Set up and start MySQL.
Some of the setup will be covered in this chapter, and then Chapter 2, "Running MySQL," will take over from there.
Use only the latest Generally Available release for mission-critical tasks. The non-stable releases are for the curious, the bug testers, and those with nothing serious to lose.
The MySQL manual is available in different versions, each corresponding to a MySQL release series. When using the manual, check that it corresponds to the version of MySQL you have.
For the truly security-conscious, an optional step you can take is to verify the downloaded software to make sure you don't have a Trojan horse (a malicious piece of code disguised as something else). There are a couple of ways to do this, starting by verifying the checksum. A checksum is an MD5 representation of data. So the checksum for the downloadable file should be unique to that download. If what you actually download has a different checksum, it's probably been tampered with.
Alternatively, you can use GnuPG, the GNU Privacy Guard, or (on Linux) RPM's built-in verification mechanism. I don't show or discuss any of these here, but the MySQL manual has instructions for using these tools, as well as where they can be obtained. See the "Installing MySQL" section for specifics.