0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
1 |
2.5.10. Installing MySQL from Source on Windows |
0.2.6
by Norbert Tretkowski
Import upstream version 5.1.41 |
2 |
|
1.1.1
by Mathias Gug
Import upstream version 5.1.31 |
3 |
These instructions describe how to build binaries from source for |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
4 |
MySQL 5.1 on Windows. Instructions are provided for building |
5 |
binaries from a standard source distribution or from the Bazaar |
|
6 |
tree that contains the latest development source. |
|
7 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
8 |
Note
|
9 |
||
10 |
The instructions here are strictly for users who want to test |
|
11 |
MySQL on Microsoft Windows from the latest source distribution or |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
12 |
from the Bazaar tree. For production use, we do not advise using a |
13 |
MySQL server built by yourself from source. Normally, it is best |
|
14 |
to use precompiled binary distributions of MySQL that are built |
|
15 |
specifically for optimal performance on Windows by Sun |
|
16 |
Microsystems, Inc. Instructions for installing binary |
|
17 |
distributions are available in Section 2.5, "Installing MySQL on |
|
0.2.5
by Norbert Tretkowski
Import upstream version 5.1.40 |
18 |
Windows."
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
19 |
|
1
by Chuck Short
Import upstream version 5.1.30 |
20 |
To build MySQL on Windows from source, you must satisfy the |
21 |
following system, compiler, and resource requirements: |
|
22 |
||
23 |
* Windows 2000, Windows XP, or newer version. |
|
24 |
Windows Vista is supported when using Visual Studio 2005 |
|
25 |
provided you have installed the following updates: |
|
26 |
||
27 |
+ Microsoft Visual Studio 2005 Professional Edition - ENU |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
28 |
Service Pack 1 (KB926601) |
29 |
(http://support.microsoft.com/?kbid=926601) |
|
1
by Chuck Short
Import upstream version 5.1.30 |
30 |
|
31 |
+ Security Update for Microsoft Visual Studio 2005 |
|
32 |
Professional Edition - ENU (KB937061) |
|
33 |
(http://support.microsoft.com/?kbid=937061) |
|
34 |
||
35 |
+ Update for Microsoft Visual Studio 2005 Professional |
|
36 |
Edition - ENU (KB932232) |
|
37 |
(http://support.microsoft.com/?kbid=932232) |
|
38 |
||
39 |
* CMake, which can be downloaded from http://www.cmake.org. |
|
40 |
After installing, modify your path to include the cmake |
|
41 |
binary. |
|
42 |
||
43 |
* Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
44 |
2003 (7.1), or Visual Studio 2005 (8.0) compiler system. |
45 |
||
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 |
|
49 |
from
|
|
0.2.1
by Norbert Tretkowski
Import upstream version 5.1.34 |
50 |
http://www.microsoft.com/downloads/details.aspx?familyid=0baf2 |
51 |
b35-c656-4969-ace8-e4c0c0716adb. |
|
52 |
||
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
53 |
* If you are compiling from a Bazaar tree or making changes to |
54 |
the parser, you need bison for Windows, which can be |
|
55 |
downloaded from |
|
1
by Chuck Short
Import upstream version 5.1.30 |
56 |
http://gnuwin32.sourceforge.net/packages/bison.htm. Download |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
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 |
|
60 |
Visual Studio. |
|
61 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
62 |
* Cygwin might be necessary if you want to run the test script |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
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 |
|
66 |
http://cygwin.com. |
|
67 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
68 |
* 3GB to 5GB of disk space. |
69 |
||
70 |
The exact system requirements for Visual Studio can be found here: |
|
0.2.6
by Norbert Tretkowski
Import upstream version 5.1.41 |
71 |
http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
72 |
px and |
73 |
http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx |
|
74 |
||
75 |
You also need a MySQL source distribution for Windows, which can |
|
76 |
be obtained two ways: |
|
77 |
||
78 |
* Obtain a source distribution packaged by Sun Microsystems, |
|
79 |
Inc. These are available from http://dev.mysql.com/downloads/. |
|
80 |
||
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 |
|
0.2.5
by Norbert Tretkowski
Import upstream version 5.1.40 |
84 |
Development Source Tree."
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
85 |
|
1
by Chuck Short
Import upstream version 5.1.30 |
86 |
If you find something not working as expected, or you have |
87 |
suggestions about ways to improve the current build process on |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
88 |
Windows, please send a message to the win32 mailing list. See |
89 |
Section 1.5.1, "MySQL Mailing Lists." |
|
90 |
||
1.1.1
by Mathias Gug
Import upstream version 5.1.31 |
91 |
2.5.10.1. Building MySQL from Source Using CMake and Visual Studio |
0.2.6
by Norbert Tretkowski
Import upstream version 5.1.41 |
92 |
|
1.1.1
by Mathias Gug
Import upstream version 5.1.31 |
93 |
You can build MySQL on Windows by using a combination of cmake and |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
94 |
Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio |
95 |
2005 (8.0) or Microsoft Visual C++ 2005 Express Edition. You must |
|
96 |
have the appropriate Microsoft Platform SDK installed. |
|
97 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
98 |
Note
|
99 |
||
100 |
To compile from the source code on Windows you must use the |
|
101 |
standard source distribution (for example, mysql-5.1.41.tar.gz). |
|
0.2.6
by Norbert Tretkowski
Import upstream version 5.1.41 |
102 |
You build from the same distribution as used to build MySQL on |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
103 |
Unix, Linux and other platforms. Do not use the Windows Source |
104 |
distributions as they do not contain the necessary configuration |
|
105 |
script and other files. |
|
106 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
107 |
Follow this procedure to build MySQL: |
108 |
||
109 |
1. If you are installing from a packaged source distribution, |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
110 |
create a work directory (for example, C:\workdir), and unpack |
111 |
the source distribution there using WinZip or another Windows |
|
112 |
tool that can read .zip files. This directory is the work |
|
113 |
directory in the following instructions. |
|
114 |
||
115 |
2. Using a command shell, navigate to the work directory and run |
|
116 |
the following command: |
|
117 |
C:\workdir>win\configure.js options |
|
118 |
If you have associated the .js file extension with an |
|
119 |
application such as a text editor, then you may need to use |
|
120 |
the following command to force configure.js to be executed as |
|
121 |
a script: |
|
122 |
C:\workdir>cscript win\configure.js options |
|
123 |
These options are available for configure.js: |
|
124 |
||
125 |
+ WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage |
|
126 |
engine. |
|
127 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
128 |
+ WITH_PARTITION_STORAGE_ENGINE: Enable user-defined |
129 |
partitioning. |
|
130 |
||
131 |
+ WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
132 |
engine. |
133 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
134 |
+ WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE |
135 |
storage engine. |
|
136 |
||
137 |
+ WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
138 |
engine. |
139 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
140 |
+ WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED |
141 |
storage engine. |
|
142 |
||
143 |
+ WITH_NDBCLUSTER_STORAGE_ENGINE (experimental): Enable the |
|
0.2.1
by Norbert Tretkowski
Import upstream version 5.1.34 |
144 |
NDBCLUSTER storage engine in the MySQL server; cause |
145 |
binaries for the MySQL Cluster management and data node, |
|
146 |
management client, and other programs to be built. |
|
147 |
This option is supported only in MySQL Cluster NDB 7.0 |
|
148 |
(NDBCLUSTER storage engine versions 6.4.0 and later) |
|
149 |
using the MySQL Cluster sources. It cannot be used to |
|
150 |
enable clustering support in other MySQL source trees or |
|
151 |
distributions. |
|
152 |
||
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
153 |
+ MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none. |
154 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
155 |
+ COMPILATION_COMMENT=comment: Server comment, default |
156 |
"Source distribution". |
|
157 |
||
158 |
+ MYSQL_TCP_PORT=port: Server port, default 3306. |
|
159 |
||
160 |
+ DISABLE_GRANT_OPTIONS: Disables the --bootstrap, |
|
161 |
--skip-grant-tables, and --init-file options for mysqld.
|
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
162 |
This option is available as of MySQL 5.1.15. |
163 |
For example (type the command on one line): |
|
1
by Chuck Short
Import upstream version 5.1.30 |
164 |
C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
165 |
WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro |
1
by Chuck Short
Import upstream version 5.1.30 |
166 |
|
167 |
3. From the work directory, execute the win\build-vs8.bat or |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
168 |
win\build-vs71.bat file, depending on the version of Visual |
169 |
Studio you have installed. The script invokes CMake, which |
|
170 |
generates the mysql.sln solution file. |
|
171 |
You can also use win\build-vs8_x64.bat to build the 64-bit |
|
172 |
version of MySQL. However, you cannot build the 64-bit version |
|
173 |
with Visual Studio Express Edition. You must use Visual Studio |
|
174 |
2005 (8.0) or higher. |
|
175 |
||
176 |
4. From the work directory, open the generated mysql.sln file |
|
177 |
with Visual Studio and select the proper configuration using |
|
178 |
the Configuration menu. The menu provides Debug, Release, |
|
179 |
RelwithDebInfo, MinRelInfo options. Then select Solution > |
|
180 |
Build to build the solution. |
|
181 |
Remember the configuration that you use in this step. It is |
|
182 |
important later when you run the test script because that |
|
183 |
script needs to know which configuration you used. |
|
184 |
||
185 |
5. Test the server. The server built using the preceding |
|
186 |
instructions expects that the MySQL base directory and data |
|
187 |
directory are C:\mysql and C:\mysql\data by default. If you |
|
188 |
want to test your server using the source tree root directory |
|
189 |
and its data directory as the base directory and data |
|
190 |
directory, you need to tell the server their path names. You |
|
191 |
can either do this on the command line with the --basedir and |
|
192 |
--datadir options, or by placing appropriate options in an
|
|
193 |
option file. (See Section 4.2.3.3, "Using Option Files.") If |
|
0.2.2
by Christian Hammers
Import upstream version 5.1.36 |
194 |
you have an existing data directory elsewhere that you want to |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
195 |
use, you can specify its path name instead. |
196 |
When the server is running in standalone fashion or as a |
|
1
by Chuck Short
Import upstream version 5.1.30 |
197 |
service based on your configuration, try to connect to it from |
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
198 |
the mysql interactive command-line utility. |
199 |
You can also run the standard test script, mysql-test-run.pl. |
|
200 |
This script is written in Perl, so you'll need either Cygwin |
|
201 |
or ActiveState Perl to run it. You may also need to install |
|
202 |
the modules required by the script. To run the test script, |
|
203 |
change location into the mysql-test directory under the work |
|
204 |
directory, set the MTR_VS_CONFIG environment variable to the |
|
205 |
configuration you selected earlier (or use the --vs-config |
|
206 |
option), and invoke mysql-test-run.pl. For example (using |
|
207 |
Cygwin and the bash shell): |
|
208 |
shell> cd mysql-test |
|
1
by Chuck Short
Import upstream version 5.1.30 |
209 |
shell> export MTR_VS_CONFIG=debug |
0.2.3
by Norbert Tretkowski
Import upstream version 5.1.37 |
210 |
shell> ./mysql-test-run.pl --force --timer |
1.1.1
by Mathias Gug
Import upstream version 5.1.31 |
211 |
shell> ./mysql-test-run.pl --force --timer --ps-protocol |
212 |
||
1
by Chuck Short
Import upstream version 5.1.30 |
213 |
When you are satisfied that the programs you have built are |
214 |
working correctly, stop the server. Now you can install the |
|
215 |
distribution. One way to do this is to use the make_win_bin_dist |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
216 |
script in the scripts directory of the MySQL source distribution |
217 |
(see Section 4.4.2, "make_win_bin_dist --- Package MySQL |
|
218 |
Distribution as ZIP Archive"). This is a shell script, so you must |
|
219 |
have Cygwin installed if you want to use it. It creates a Zip |
|
220 |
archive of the built executables and support files that you can |
|
221 |
unpack in the location at which you want to install MySQL. |
|
222 |
||
223 |
It is also possible to install MySQL by copying directories and |
|
224 |
files directly: |
|
225 |
||
226 |
1. Create the directories where you want to install MySQL. For |
|
227 |
example, to install into C:\mysql, use these commands: |
|
228 |
C:\> mkdir C:\mysql |
|
1
by Chuck Short
Import upstream version 5.1.30 |
229 |
C:\> mkdir C:\mysql\bin |
230 |
C:\> mkdir C:\mysql\data |
|
231 |
C:\> mkdir C:\mysql\share |
|
232 |
C:\> mkdir C:\mysql\scripts |
|
233 |
If you want to compile other clients and link them to MySQL, |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
234 |
you should also create several additional directories: |
235 |
C:\> mkdir C:\mysql\include |
|
1
by Chuck Short
Import upstream version 5.1.30 |
236 |
C:\> mkdir C:\mysql\lib |
237 |
C:\> mkdir C:\mysql\lib\debug |
|
238 |
C:\> mkdir C:\mysql\lib\opt |
|
239 |
If you want to benchmark MySQL, create this directory: |
|
240 |
C:\> mkdir C:\mysql\sql-bench |
|
241 |
Benchmarking requires Perl support. See Section 2.15, "Perl |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
242 |
Installation Notes."
|
243 |
||
244 |
2. From the work directory, copy into the C:\mysql directory the |
|
245 |
following directories: |
|
246 |
C:\> cd \workdir |
|
1
by Chuck Short
Import upstream version 5.1.30 |
247 |
C:\workdir> copy client_release\*.exe C:\mysql\bin |
248 |
C:\workdir> copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.ex |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
249 |
e
|
250 |
C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E |
|
1
by Chuck Short
Import upstream version 5.1.30 |
251 |
C:\workdir> xcopy share\*.* C:\mysql\share /E |
252 |
If you want to compile other clients and link them to MySQL, |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
253 |
you should also copy several libraries and header files: |
254 |
C:\workdir> copy lib_debug\mysqlclient.lib C:\mysql\lib\debug |
|
1
by Chuck Short
Import upstream version 5.1.30 |
255 |
C:\workdir> copy lib_debug\libmysql.* C:\mysql\lib\debug |
256 |
C:\workdir> copy lib_debug\zlib.* C:\mysql\lib\debug |
|
257 |
C:\workdir> copy lib_release\mysqlclient.lib C:\mysql\lib\opt |
|
258 |
C:\workdir> copy lib_release\libmysql.* C:\mysql\lib\opt |
|
259 |
C:\workdir> copy lib_release\zlib.* C:\mysql\lib\opt |
|
260 |
C:\workdir> copy include\*.h C:\mysql\include |
|
261 |
C:\workdir> copy libmysql\libmysql.def C:\mysql\include |
|
262 |
If you want to benchmark MySQL, you should also do this: |
|
263 |
C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E |
|
264 |
||
265 |
After installation, set up and start the server in the same way as |
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
266 |
for binary Windows distributions. See Section 2.5, "Installing |
0.2.5
by Norbert Tretkowski
Import upstream version 5.1.40 |
267 |
MySQL on Windows."
|
0.1.1
by Norbert Tretkowski
Import upstream version 5.1.32 |
268 |