HomeMySQL Page 7 - MySQL Installation and Configuration
Installing MySQL from a Source Distribution (Windows) - MySQL
In this chapter, Vikram discusses how to obtain, install, configure, and test the MySQL server on Unix and Windows. It also explains the differences between the different MySQL sever versions available, with a view to helping you select the right one for your needs. This excerpt comes from chapter three of MySQL: The Complete Reference, by Vikram Vaswani (McGraw-Hill/Osborne, ISBN 0-07-222477-0, 2004).
While compiling MySQL for Windows from the source archive is not something thatís generally recommended--itís far safer, not to mention easier, to use the provided binaries--itís certainly doable, assuming you have a copy of the Visual C++ 6.0 compiler (with Service Pack 5 and the preprocessor package). Hereís how itís done:
1. Unzip the source archive to a working directory on your system.
2. Launch the Visual C++ compiler, and open the mysql.dsw workspace from the working directory. You should see a window like Figure 19.
FIGURE 19The MySQL workspace in Visual C++
3. Choose Build | Set Active Configuration to obtain a list of available configurations. Select mysqld Ė Win32 Release (see Figure 20). Click OK.
FIGURE 20Selecting which version of MySQL to build in Visual C++
4. Begin compiling by pressing the F7 key. The various MySQL binaries will be compiled--expect the process to take from 20 minutes to an hour, depending on the capabilities of your machine. During the compilation process, the Visual C++ compiler window will display a series of messages, such as those shown in Figure 21.
FIGURE 21Compiling MySQL for Windows in Visual C++
5. After compilation is complete, create a separate installation directory to house the compiled binaries--for example, c:\program files\mysql.
6. Create a bin\ subdirectory under this directory, and move the compiled libraries and executables into this directory. While youíre at it, also move the data\, share\, docs\, and support-files\ directories from the working directory into this directory.
7. You should now be able to start the MySQL server by diving into the bin\ subdirectory of your MySQL installation and launching the MySQL server daemon directly (mysqld.exe or mysqld-nt.exe).
Once the server has started, proceed to test it as per the instructions in ďTesting MySQL,Ē next.
Remember: this is chapter three of MySQL: The Complete Reference, by Vikram Vaswani (McGraw-Hill/Osborne, ISBN 0-07-222477-0, 2004). Vikram is the founder of Melonfire, and has had numerous articles featured on Dev Shed. Buy this book now.