VC++ workspace files for MySQL 4.1 and above are compatible with Microsoft Visual Studio 7.1 and tested by us before each release.
Follow this procedure to build MySQL:
Create a work directory (for example,
Unpack the source distribution in the aforementioned
directory using WinZip or other Windows
tool that can read
Start Visual Studio .Net 2003 (7.1).
From the File menu, select Open Solution....
mysql.sln solution you find in
the work directory.
From the Build menu, select Configuration Manager....
In the Active Solution Configuration pop-up menu, select the configuration to use. You likely want to use one of nt (normal server, not for Windows 98/ME), Max nt (more engines and features, not for 98/ME) or Debug configuration.
From the Build menu, select Build Solution.
Debug versions of the programs and libraries are placed in
lib_debug directories. Release versions
of the programs and libraries are placed in the
Test the server. The server built using the preceding
instructions expects that the MySQL base directory and data
C:\mysql\data by default. If you want
to test your server using the source tree root directory and
its data directory as the base directory and data directory,
you need to tell the server their path names. You can either
do this on the command line with the
--datadir options, or by
placing appropriate options in an option file. (See
Section 22.214.171.124, “Using Option Files”.) If you have an existing
data directory elsewhere that you want to use, you can
specify its path name instead.
Start your server from the
client_debug directory, depending on
which server you built or want to use. The general server
startup instructions are in
Section 2.3, “Installing MySQL on Microsoft Windows”. You must adapt the
instructions appropriately if you want to use a different
base directory or data directory.
When the server is running in standalone fashion or as a
service based on your configuration, try to connect to it
from the mysql interactive command-line
utility that exists in your
When you are satisfied that the programs you have built are working correctly, stop the server. Then install MySQL as follows:
Create the directories where you want to install MySQL. For
example, to install into
If you want to compile other clients and link them to MySQL, you should also create several additional directories:
If you want to benchmark MySQL, create this directory:
Benchmarking requires Perl support. See Section 2.14, “Perl Installation Notes”.
workdir directory, copy into
C:\mysql directory the following
copy client_release\*.exe C:\mysql\binC:\workdir>
copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.exeC:\workdir>
xcopy scripts\*.* C:\mysql\scripts /EC:\workdir>
xcopy share\*.* C:\mysql\share /E
If you want to compile other clients and link them to MySQL, you should also copy several libraries and header files:
copy lib_debug\mysqlclient.lib C:\mysql\lib\debugC:\workdir>
copy lib_debug\libmysql.* C:\mysql\lib\debugC:\workdir>
copy lib_debug\zlib.* C:\mysql\lib\debugC:\workdir>
copy lib_release\mysqlclient.lib C:\mysql\lib\optC:\workdir>
copy lib_release\libmysql.* C:\mysql\lib\optC:\workdir>
copy lib_release\zlib.* C:\mysql\lib\optC:\workdir>
copy include\*.h C:\mysql\includeC:\workdir>
copy libmysql\libmysql.def C:\mysql\include
If you want to benchmark MySQL, you should also do this:
xcopy sql-bench\*.* C:\mysql\bench /E
After installation, set up and start the server in the same way as for binary Windows distributions. See Section 2.3, “Installing MySQL on Microsoft Windows”.