37
37
(http://support.microsoft.com/?kbid=932232)
39
39
* CMake, which can be downloaded from http://www.cmake.org.
40
After installing, modify your path to include the cmake
43
* Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net
44
2003 (7.1), or Visual Studio 2005 (8.0) compiler system.
46
* If you are using Visual C++ 2005 Express Edition, you must
47
also install an appropriate Platform SDK. More information and
48
links to downloads for various Windows platforms is available
50
http://www.microsoft.com/downloads/details.aspx?familyid=0baf2
51
b35-c656-4969-ace8-e4c0c0716adb.
53
* If you are compiling from a Bazaar tree or making changes to
54
the parser, you need bison for Windows, which can be
40
After installing, modify your PATH environment variable
41
to include the directory where cmake is located.
43
* Microsoft Visual C++ 2005 Express Edition, Visual Studio
44
.Net 2003 (7.1), or Visual Studio 2005 (8.0) compiler
47
* If you are using Visual C++ 2005 Express Edition, you
48
must also install an appropriate Platform SDK. More
49
information and links to downloads for various Windows
50
platforms is available from
51
http://www.microsoft.com/downloads/details.aspx?familyid=
52
0baf2b35-c656-4969-ace8-e4c0c0716adb.
54
* If you are compiling from a Bazaar tree or making changes
55
to the parser, you need bison for Windows, which can be
56
http://gnuwin32.sourceforge.net/packages/bison.htm. Download
57
the package labeled "Complete package, excluding sources".
58
After installing the package, modify your path to include the
59
bison binary and ensure that this binary is accessible from
57
http://gnuwin32.sourceforge.net/packages/bison.htm.
58
Download the package labeled "Complete package, excluding
59
sources". After installing the package, modify your PATH
60
environment variable to include the directory where bison
63
On Windows, the default location for bison is the
64
C:\Program Files\GnuWin32 directory. Some utilities,
65
including m4, may fail to find bison because of the space
66
in the directory name. You can resolve this by installing
67
into a directory that does not contain a space; for
62
* Cygwin might be necessary if you want to run the test script
63
or package the compiled binaries and support files into a Zip
64
archive. (Cygwin is needed only to test or package the
65
distribution, not to build it.) Cygwin is available from
70
* Cygwin might be necessary if you want to run the test
71
script or package the compiled binaries and support files
72
into a Zip archive. (Cygwin is needed only to test or
73
package the distribution, not to build it.) Cygwin is
74
available from http://cygwin.com.
68
76
* 3GB to 5GB of disk space.
70
The exact system requirements for Visual Studio can be found here:
71
http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as
73
http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx
75
You also need a MySQL source distribution for Windows, which can
78
* Obtain a source distribution packaged by Oracle Corporation.
79
These are available from http://dev.mysql.com/downloads/.
81
* Package a source distribution yourself from the latest Bazaar
82
developer source tree. For instructions on pulling the latest
83
source files, see Section 2.3.3, "Installing from the
84
Development Source Tree."
78
You also need a MySQL source distribution for Windows, which
79
can be obtained two ways:
81
* Obtain a source distribution packaged by Oracle
82
Corporation. These are available from
83
http://dev.mysql.com/downloads/.
85
* Package a source distribution yourself from the latest
86
Bazaar developer source tree. For instructions on pulling
87
the latest source files, see Section 2.11.3, "Installing
88
from a Development Source Tree."
86
90
If you find something not working as expected, or you have
87
suggestions about ways to improve the current build process on
88
Windows, please send a message to the win32 mailing list. See
89
Section 1.6.1, "MySQL Mailing Lists."
91
2.5.10.1. Building MySQL from Source Using CMake and Visual Studio
93
You can build MySQL on Windows by using a combination of cmake and
94
Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio
95
2005 (8.0), Microsoft Visual Studio 2008 (9.0) or Microsoft Visual
96
C++ 2005 Express Edition. You must have the appropriate Microsoft
97
Platform SDK installed.
91
suggestions about ways to improve the current build process
92
on Windows, please send a message to the win32 mailing list.
93
See Section 1.6.1, "MySQL Mailing Lists."
101
96
To compile from the source code on Windows you must use the
102
standard source distribution (for example, mysql-5.1.49.tar.gz).
103
You build from the same distribution as used to build MySQL on
104
Unix, Linux and other platforms. Do not use the Windows Source
105
distributions as they do not contain the necessary configuration
106
script and other files.
97
standard source distribution (for example, mysql-5.1.55.zip)
98
or mysql-5.1.55.tar.gz). You build from the same distribution
99
as used to build MySQL on Unix, Linux and other platforms. Do
100
not use the Windows Source distributions as they do not
101
contain the necessary configuration script and other files.
108
103
Follow this procedure to build MySQL:
110
1. If you are installing from a packaged source distribution,
111
create a work directory (for example, C:\workdir), and unpack
112
the source distribution there using WinZip or another Windows
113
tool that can read .zip files. This directory is the work
114
directory in the following instructions.
117
You must run the commands in the win directory from the
118
top-level source directory. Do not change into the win
119
directory, as the commands will not be executed correctly.
121
2. Start a command shell. If you have not configured the PATH and
122
other environment variables for all command shells, you may be
123
able to start a command shell from the Start Menu within the
124
Windows Visual Studio menu that contains the necessary
127
3. Within the command shell, navigate to the work directory and
128
run the following command:
105
1. If you are installing from a packaged source
106
distribution, create a work directory (for example,
107
C:\workdir), and unpack the source distribution there
108
using WinZip or another Windows tool that can read .zip
109
files. This directory is the work directory in the
110
following instructions.
112
Commands that are located in the win directory should be
113
executed from the top-level source directory. Do not
114
change location into the win directory, as the commands
115
will not execute correctly.
117
2. Start a command shell. If you have not configured the
118
PATH and other environment variables for all command
119
shells, you may be able to start a command shell from the
120
Start Menu within the Windows Visual Studio menu that
121
contains the necessary environment changes.
123
3. Within the command shell, navigate to the work directory
124
and run the following command:
129
125
C:\workdir>win\configure.js options
130
127
If you have associated the .js file extension with an
131
application such as a text editor, then you may need to use
132
the following command to force configure.js to be executed as
128
application such as a text editor, then you may need to
129
use the following command to force configure.js to be
130
executed as a script:
134
131
C:\workdir>cscript win\configure.js options
135
133
These options are available for configure.js:
137
+ WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage
135
+ WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB
140
138
+ WITH_PARTITION_STORAGE_ENGINE: Enable user-defined
143
+ WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage
141
+ WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE
146
144
+ WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE
149
+ WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage
147
+ WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE
152
150
+ WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED
155
+ WITH_NDBCLUSTER_STORAGE_ENGINE: Enable the NDBCLUSTER
156
storage engine in the MySQL server; cause binaries for
157
the MySQL Cluster management and data node, management
158
client, and other programs to be built.
159
This option is supported only in MySQL Cluster NDB 7.0
160
(NDBCLUSTER storage engine versions 6.4.0 and later)
161
using the MySQL Cluster sources. It cannot be used to
162
enable clustering support in other MySQL source trees or
153
+ WITH_NDBCLUSTER_STORAGE_ENGINE: Enable the
154
NDBCLUSTER storage engine in the MySQL server; cause
155
binaries for the MySQL Cluster management and data
156
node, management client, and other programs to be
158
This option is supported only in MySQL Cluster NDB
159
7.0 and later (NDBCLUSTER storage engine versions
160
6.4.0 and later) using the MySQL Cluster sources. It
161
cannot be used to enable clustering support in other
162
MySQL source trees or distributions.
165
+ MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none.
164
+ MYSQL_SERVER_SUFFIX=suffix: Server suffix, default
167
167
+ COMPILATION_COMMENT=comment: Server comment, default
168
168
"Source distribution".
170
170
+ MYSQL_TCP_PORT=port: Server port, default 3306.
172
172
+ DISABLE_GRANT_OPTIONS: Disables the --bootstrap,
173
--skip-grant-tables, and --init-file options for mysqld.
174
This option is available as of MySQL 5.1.15.
173
--skip-grant-tables, and --init-file options for
174
mysqld. This option is available as of MySQL 5.1.15.
175
175
For example (type the command on one line):
176
176
C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE
177
177
WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
179
180
4. From the work directory, execute the win\build-vs9.bat
180
181
(Windows Visual Studio 2008), win\build-vs8.bat (Windows
181
Visual Studio 2005), or win\build-vs71.bat (Windows Visual
182
Stidion 2003) script, depending on the version of Visual
183
Studio you have installed. The script invokes CMake, which
184
generates the mysql.sln solution file.
185
You can also use the corresponding 64-bit file (for example
186
win\build-vs8_x64.bat or win\build-vs9_x64.bat) to build the
187
64-bit version of MySQL. However, you cannot build the 64-bit
188
version with Visual Studio Express Edition. You must use
189
Visual Studio 2005 (8.0) or higher.
182
Visual Studio 2005), or win\build-vs71.bat (Windows
183
Visual Studio 2003) script, depending on the version of
184
Visual Studio you have installed. The script invokes
185
CMake, which generates the mysql.sln solution file.
186
You can also use the corresponding 64-bit file (for
187
example win\build-vs8_x64.bat or win\build-vs9_x64.bat)
188
to build the 64-bit version of MySQL. However, you cannot
189
build the 64-bit version with Visual Studio Express
190
Edition. You must use Visual Studio 2005 (8.0) or higher.
191
5. From the work directory, open the generated mysql.sln file
192
with Visual Studio and select the proper configuration using
193
the Configuration menu. The menu provides Debug, Release,
194
RelwithDebInfo, MinRelInfo options. Then select Solution >
195
Build to build the solution.
196
Remember the configuration that you use in this step. It is
197
important later when you run the test script because that
198
script needs to know which configuration you used.
192
5. From the work directory, open the generated mysql.sln
193
file with Visual Studio and select the proper
194
configuration using the Configuration menu. The menu
195
provides Debug, Release, RelwithDebInfo, MinRelInfo
196
options. Then select Solution > Build to build the
198
Remember the configuration that you use in this step. It
199
is important later when you run the test script because
200
that script needs to know which configuration you used.
200
202
6. Test the server. The server built using the preceding
201
instructions expects that the MySQL base directory and data
202
directory are C:\mysql and C:\mysql\data by default. If you
203
want to test your server using the source tree root directory
204
and its data directory as the base directory and data
205
directory, you need to tell the server their path names. You
206
can either do this on the command line with the --basedir and
207
--datadir options, or by placing appropriate options in an
208
option file. (See Section 4.2.3.3, "Using Option Files.") If
209
you have an existing data directory elsewhere that you want to
210
use, you can specify its path name instead.
203
instructions expects that the MySQL base directory and
204
data directory are C:\mysql and C:\mysql\data by default.
205
If you want to test your server using the source tree
206
root directory and its data directory as the base
207
directory and data directory, you need to tell the server
208
their path names. You can either do this on the command
209
line with the --basedir and --datadir options, or by
210
placing appropriate options in an option file. (See
211
Section 4.2.3.3, "Using Option Files.") If you have an
212
existing data directory elsewhere that you want to use,
213
you can specify its path name instead.
211
214
When the server is running in standalone fashion or as a
212
service based on your configuration, try to connect to it from
213
the mysql interactive command-line utility.
214
You can also run the standard test script, mysql-test-run.pl.
215
This script is written in Perl, so you'll need either Cygwin
216
or ActiveState Perl to run it. You may also need to install
217
the modules required by the script. To run the test script,
218
change location into the mysql-test directory under the work
219
directory, set the MTR_VS_CONFIG environment variable to the
220
configuration you selected earlier (or use the --vs-config
221
option), and invoke mysql-test-run.pl. For example (using
222
Cygwin and the bash shell):
215
service based on your configuration, try to connect to it
216
from the mysql interactive command-line utility.
217
You can also run the standard test script,
218
mysql-test-run.pl. This script is written in Perl, so
219
you'll need either Cygwin or ActiveState Perl to run it.
220
You may also need to install the modules required by the
221
script. To run the test script, change location into the
222
mysql-test directory under the work directory, set the
223
MTR_VS_CONFIG environment variable to the configuration
224
you selected earlier (or use the --vs-config option), and
225
invoke mysql-test-run.pl. For example (using Cygwin and
223
227
shell> cd mysql-test
224
228
shell> export MTR_VS_CONFIG=debug
225
229
shell> ./mysql-test-run.pl --force --timer
228
232
When you are satisfied that the programs you have built are
229
233
working correctly, stop the server. Now you can install the
230
distribution. One way to do this is to use the make_win_bin_dist
231
script in the scripts directory of the MySQL source distribution
232
(see Section 4.4.2, "make_win_bin_dist --- Package MySQL
233
Distribution as ZIP Archive"). This is a shell script, so you must
234
have Cygwin installed if you want to use it. It creates a Zip
235
archive of the built executables and support files that you can
236
unpack in the location at which you want to install MySQL.
238
It is also possible to install MySQL by copying directories and
241
1. Create the directories where you want to install MySQL. For
242
example, to install into C:\mysql, use these commands:
234
distribution. One way to do this is to use the
235
make_win_bin_dist script in the scripts directory of the
236
MySQL source distribution (see Section 4.4.2,
237
"make_win_bin_dist --- Package MySQL Distribution as ZIP
238
Archive"). This is a shell script, so you must have Cygwin
239
installed if you want to use it. It creates a Zip archive of
240
the built executables and support files that you can unpack
241
in the location at which you want to install MySQL.
243
It is also possible to install MySQL by copying directories
246
1. Create the directories where you want to install MySQL.
247
For example, to install into C:\mysql, use these
243
249
C:\> mkdir C:\mysql
244
250
C:\> mkdir C:\mysql\bin
245
251
C:\> mkdir C:\mysql\data
246
252
C:\> mkdir C:\mysql\share
247
253
C:\> mkdir C:\mysql\scripts
248
If you want to compile other clients and link them to MySQL,
249
you should also create several additional directories:
255
If you want to compile other clients and link them to
256
MySQL, you should also create several additional
250
258
C:\> mkdir C:\mysql\include
251
259
C:\> mkdir C:\mysql\lib
252
260
C:\> mkdir C:\mysql\lib\debug
253
261
C:\> mkdir C:\mysql\lib\opt
254
263
If you want to benchmark MySQL, create this directory:
255
264
C:\> mkdir C:\mysql\sql-bench
256
Benchmarking requires Perl support. See Section 2.15, "Perl
259
2. From the work directory, copy into the C:\mysql directory the
260
following files and directories:
266
Benchmarking requires Perl support for MySQL. See Section
267
2.15, "Perl Installation Notes."
269
2. From the work directory, copy into the C:\mysql directory
270
the following files and directories:
262
272
C:\workdir> mkdir C:\mysql
263
273
C:\workdir> mkdir C:\mysql\bin