Develop and Download Open Source Software

Browse Subversion Repository

Contents of /tags/tritonn-1.0.12-mysql-5.0.83/INSTALL-WIN-SOURCE

Parent Directory Parent Directory | Revision Log Revision Log


Revision 177 - (show annotations) (download)
Mon Jul 6 09:38:02 2009 UTC (14 years, 8 months ago) by myuka
File size: 16933 byte(s)
Initial inport
1
2 2.16.6. Installing MySQL from Source on Windows
3
4 These instructions describe how to build binaries from source for
5 MySQL 5.0 on Windows. Instructions are provided for building
6 binaries from a standard source distribution or from the Bazaar
7 tree that contains the latest development source.
8
9 Note
10
11 The instructions here are strictly for users who want to test
12 MySQL on Microsoft Windows from the latest source distribution or
13 from the Bazaar tree. For production use, we do not advise using a
14 MySQL server built by yourself from source. Normally, it is best
15 to use precompiled binary distributions of MySQL that are built
16 specifically for optimal performance on Windows by Sun
17 Microsystems, Inc. Instructions for installing binary
18 distributions are available in Section 2.9, "Installing MySQL on
19 Windows."
20
21 To build MySQL on Windows from source, you must satisfy the
22 following system, compiler, and resource requirements:
23
24 * Windows 2000, Windows XP, or newer version.
25 Windows Vista is supported when using Visual Studio 2005
26 provided you have installed the following updates:
27
28 + Microsoft Visual Studio 2005 Professional Edition - ENU
29 Service Pack 1 (KB926601)
30 (http://support.microsoft.com/?kbid=926601)
31
32 + Security Update for Microsoft Visual Studio 2005
33 Professional Edition - ENU (KB937061)
34 (http://support.microsoft.com/?kbid=937061)
35
36 + Update for Microsoft Visual Studio 2005 Professional
37 Edition - ENU (KB932232)
38 (http://support.microsoft.com/?kbid=932232)
39
40 * To build from the standard source distribution, you will need
41 CMake, which can be downloaded from http://www.cmake.org.
42 After installing, modify your path to include the cmake
43 binary.
44
45 * Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net
46 2003 (7.1), or Visual Studio 2005 (8.0) compiler system.
47
48 * If you are using Visual C++ 2005 Express Edition, you must
49 also install an appropriate Platform SDK. More information and
50 links to downloads for various Windows platforms is available
51 from
52 http://www.microsoft.com/downloads/details.aspx?familyid=0baf2
53 b35-c656-4969-ace8-e4c0c0716adb.
54
55 * If you are compiling from a Bazaar tree or making changes to
56 the parser, you need bison for Windows, which can be
57 downloaded from
58 http://gnuwin32.sourceforge.net/packages/bison.htm. Download
59 the package labeled "Complete package, excluding sources".
60 After installing the package, modify your path to include the
61 bison binary and ensure that this binary is accessible from
62 Visual Studio.
63
64 * Cygwin might be necessary if you want to run the test script
65 or package the compiled binaries and support files into a Zip
66 archive. (Cygwin is needed only to test or package the
67 distribution, not to build it.) Cygwin is available from
68 http://cygwin.com.
69
70 * 3GB to 5GB of disk space.
71
72 The exact system requirements can be found here:
73 http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as
74 px and
75 http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx
76
77 There are three solutions available for building from the source
78 code on Windows:
79
80 * Build from the standard MySQL source distribution. For this
81 you will need CMake and Visual C++ Express Edition or Visual
82 Studio. Using this method you can select the storage engines
83 that are included in your build. To use this method, see
84 Section 2.16.6.1, "Building MySQL from the Standard Source
85 Distribution."
86
87 * Build from the MySQL Windows source distribution. The Windows
88 source distribution includes ready-made Visual Studio solution
89 files that enable support for all storage engines (except
90 NDB). To build using using method you only need Visual C++
91 Express Edition or Visual Studio. To use this method, see
92 Section 2.16.6.2, "Building MySQL from a Windows Source
93 Distribution."
94
95 * Build directly from the Bazaar source repository. For this you
96 will need CMake, Visual C++ Express Edition or Visual Studio,
97 and bison. For this method you need to create the distribution
98 on a Unix system and then copy the generated files to your
99 Windows build environment. To use this method, see Section
100 2.16.6.5, "Creating a Windows Source Package from the Bazaar
101 Repository."
102
103 If you find something not working as expected, or you have
104 suggestions about ways to improve the current build process on
105 Windows, please send a message to the win32 mailing list. See
106 Section 1.5.1, "MySQL Mailing Lists."
107
108 2.16.6.1. Building MySQL from the Standard Source Distribution
109
110 You can build MySQL on Windows by using a combination of cmake and
111 Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio
112 2005 (8.0) or Microsoft Visual C++ 2005 Express Edition. You must
113 have the appropriate Microsoft Platform SDK installed.
114
115 Note
116
117 To compile from the source code using CMake you must use the
118 standard source distribution (for example, mysql-5.0.45.tar.gz).
119 You build from the same distribution as used to build MySQL on
120 Unix, Linux and other platforms. Do not use the Windows Source
121 distributions as they do not contain the necessary configuration
122 script and other files.
123
124 Follow this procedure to build MySQL:
125
126 1. If you are installing from a packaged source distribution,
127 create a work directory (for example, C:\workdir), and unpack
128 the source distribution there using WinZip or another Windows
129 tool that can read .zip files. This directory is the work
130 directory in the following instructions.
131
132 2. If you are installing from a Bazaar tree, the root directory
133 of that tree is the work directory in the following
134 instructions.
135
136 3. Using a command shell, navigate to the work directory and run
137 the following command:
138 C:\workdir>win\configure.js options
139 If you have associated the .js file extension with an
140 application such as a text editor, then you may need to use
141 the following command to force configure.js to be executed as
142 a script:
143 C:\workdir>cscript win\configure.js options
144 These options are available for configure.js:
145
146 + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage
147 engine.
148
149 + WITH_PARTITION_STORAGE_ENGINE: Enable user-defined
150 partitioning.
151
152 + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage
153 engine.
154
155 + WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE
156 storage engine.
157
158 + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage
159 engine.
160
161 + WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED
162 storage engine.
163
164 + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none.
165
166 + COMPILATION_COMMENT=comment: Server comment, default
167 "Source distribution".
168
169 + MYSQL_TCP_PORT=port: Server port, default 3306.
170
171 + DISABLE_GRANT_OPTIONS: Disables the the --bootstrap,
172 --skip-grant-tables, and --init-file options for mysqld.
173 This option is available as of MySQL 5.0.36.
174 For example (type the command on one line):
175 C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE ��
176 WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
177
178 4. From the work directory, execute the win\build-vs8.bat or
179 win\build-vs71.bat file, depending on the version of Visual
180 Studio you have installed. The script invokes CMake, which
181 generates the mysql.sln solution file you will need to build
182 MySQL using Visual Studio..
183 You can also use win\build-vs8_x64.bat to build the 64-bit
184 version of MySQL. However, you cannot build the 64-bit version
185 with Visual Studio Express Edition. You must use Visual Studio
186 2005 (8.0) or higher.
187
188 5. From the work directory, open the generated mysql.sln file
189 with Visual Studio and select the proper configuration using
190 the Configuration menu. The menu provides Debug, Release,
191 RelwithDebInfo, MinRelInfo options. Then select Solution >
192 Build to build the solution.
193 The build process will take some time. Please be patient.
194 Remember the configuration that you use in this step. It is
195 important later when you run the test script because that
196 script needs to know which configuration you used.
197
198 6. You should test you build before installation. See Section
199 2.16.6.4, "Testing a Windows Source Build."
200
201 7. To install, use the instructions in Section 2.16.6.3,
202 "Installing MySQL from a Source Build on Windows."
203
204 2.16.6.2. Building MySQL from a Windows Source Distribution
205
206 The Windows source distribution includes the necessary solution
207 file and the vcproj files required to build each component. Using
208 this method you are not able to select the storage engines that
209 are included in your build.
210
211 Note
212
213 VC++ workspace files for MySQL 4.1 and above are compatible with
214 Microsoft Visual Studio 7.1 and tested by MySQL AB staff before
215 each release.
216
217 Follow this procedure to build MySQL:
218
219 1. Create a work directory (for example, C:\workdir).
220
221 2. Unpack the source distribution in the aforementioned directory
222 using WinZip or another Windows tool that can read .zip files.
223
224 3. Start Visual Studio .Net 2003 (7.1).
225
226 4. From the File menu, select Open Solution....
227
228 5. Open the mysql.sln solution you find in the work directory.
229
230 6. From the Build menu, select Configuration Manager....
231
232 7. In the Active Solution Configuration pop-up menu, select the
233 configuration to use. You likely want to use one of nt (normal
234 server), Max nt (more engines and features), or Debug
235 configuration.
236
237 8. From the Build menu, select Build Solution.
238
239 9. Debug versions of the programs and libraries are placed in the
240 client_debug and lib_debug directories. Release versions of
241 the programs and libraries are placed in the client_release
242 and lib_release directories.
243 10. You should test you build before installation. See Section
244 2.16.6.4, "Testing a Windows Source Build."
245 11. To install, use the instructions in Section 2.16.6.3,
246 "Installing MySQL from a Source Build on Windows."
247
248 2.16.6.3. Installing MySQL from a Source Build on Windows
249
250 When you are satisfied that the program you have built is working
251 correctly, stop the server. Now you can install the distribution.
252 There are two ways to do this, either by using the supplied
253 installation script or by copying the files individually by hand.
254
255 To use the script method you must have Cygwin installed as the
256 script is a Shell script. To execute the installation process, run
257 the make_win_bin_dist script in the scripts directory of the MySQL
258 source distribution (see Section 4.4.2, "make_win_bin_dist ---
259 Package MySQL Distribution as ZIP Archive"). This is a shell
260 script, so you must have Cygwin installed if you want to use it.
261 It creates a Zip archive of the built executables and support
262 files that you can unpack to your desired installation location.
263
264 It is also possible to install MySQL by copying directories and
265 files manually:
266
267 1. Create the directories where you want to install MySQL. For
268 example, to install into C:\mysql, use these commands:
269 shell> mkdir C:\mysql
270 shell> mkdir C:\mysql\bin
271 shell> mkdir C:\mysql\data
272 shell> mkdir C:\mysql\share
273 shell> mkdir C:\mysql\scripts
274 If you want to compile other clients and link them to MySQL,
275 you should also create several additional directories:
276 shell> mkdir C:\mysql\include
277 shell> mkdir C:\mysql\lib
278 shell> mkdir C:\mysql\lib\debug
279 shell> mkdir C:\mysql\lib\opt
280 If you want to benchmark MySQL, create this directory:
281 shell> mkdir C:\mysql\sql-bench
282 Benchmarking requires Perl support. See Section 2.21, "Perl
283 Installation Notes."
284
285 2. From the work directory, copy into the C:\mysql directory the
286 following directories:
287 shell> cd \workdir
288 C:\workdir> copy client_release\*.exe C:\mysql\bin
289 C:\workdir> copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.ex
290 e
291 C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E
292 C:\workdir> xcopy share\*.* C:\mysql\share /E
293 If you want to compile other clients and link them to MySQL,
294 you should also copy several libraries and header files:
295 C:\workdir> copy lib_debug\mysqlclient.lib C:\mysql\lib\debug
296 C:\workdir> copy lib_debug\libmysql.* C:\mysql\lib\debug
297 C:\workdir> copy lib_debug\zlib.* C:\mysql\lib\debug
298 C:\workdir> copy lib_release\mysqlclient.lib C:\mysql\lib\opt
299 C:\workdir> copy lib_release\libmysql.* C:\mysql\lib\opt
300 C:\workdir> copy lib_release\zlib.* C:\mysql\lib\opt
301 C:\workdir> copy include\*.h C:\mysql\include
302 C:\workdir> copy libmysql\libmysql.def C:\mysql\include
303 If you want to benchmark MySQL, you should also do this:
304 C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E
305
306 After installation, set up and start the server in the same way as
307 for binary Windows distributions. See Section 2.9, "Installing
308 MySQL on Windows."
309
310 2.16.6.4. Testing a Windows Source Build
311
312 You should test the server that you have built from source before
313 using the distribution.
314
315 To test the server you need to run the built mysqld. By default,
316 using the source build examples, the MySQL base directory and data
317 directory are C:\mysql and C:\mysql\data. If you want to test your
318 server using the source tree root directory and its data directory
319 as the base directory and data directory, you need to tell the
320 server their path names. You can either do this on the command
321 line with the --basedir and --datadir options, or by placing
322 appropriate options in an option file. (See Section 4.2.3.2,
323 "Using Option Files.") If you have an existing data directory
324 elsewhere that you want to use, you can specify its path name
325 instead.
326
327 When the server is running in standalone fashion or as a service
328 based on your configuration, try to connect to it from the mysql
329 interactive command-line utility.
330
331 You can also run the standard test script, mysql-test-run.pl. This
332 script is written in Perl, so you'll need either Cygwin or
333 ActiveState Perl to run it. You may also need to install the
334 modules required by the script. To run the test script, change
335 location into the mysql-test directory under the work directory,
336 set the MTR_VS_CONFIG environment variable to the configuration
337 you selected earlier (or use the --vs-config option), and invoke
338 mysql-test-run.pl. For example (using Cygwin and the bash shell):
339 shell> cd mysql-test
340 shell> export MTS_VS_CONFIG=debug
341 shell> ./mysql-test-run.pl --force --timer
342 shell> ./mysql-test-run.pl --force --timer --ps-protocol
343
344 2.16.6.5. Creating a Windows Source Package from the Bazaar
345 Repository
346
347 To create a Windows source package from the current Bazaar source
348 tree, use the instructions here. This procedure must be performed
349 on a system running a Unix or Unix-like operating system because
350 some of the configuration and build steps require tools that work
351 only on Unix. For example, the following procedure is known to
352 work well on Linux.
353
354 1. Copy the Bazaar source tree for MySQL 5.0. For instructions on
355 how to do this, see Section 2.16.3, "Installing from the
356 Development Source Tree."
357
358 2. Configure and build the distribution so that you have a server
359 binary to work with. One way to do this is to run the
360 following command in the top-level directory of your source
361 tree:
362 shell> ./BUILD/compile-pentium-max
363
364 3. After making sure that the build process completed
365 successfully, run the following utility script from top-level
366 directory of your source tree:
367 shell> ./scripts/make_win_src_distribution
368 This script creates a Windows source package to be used on
369 your Windows system. You can supply different options to the
370 script based on your needs. See Section 4.4.3,
371 "make_win_src_distribution --- Create Source Distribution for
372 Windows," for a list of allowable options.
373 By default, make_win_src_distribution creates a Zip-format
374 archive with the name mysql-VERSION-win-src.zip, where VERSION
375 represents the version of your MySQL source tree.
376
377 4. Copy or upload the Windows source package that you have just
378 created to your Windows machine. To compile it, use the
379 instructions in Section 2.16.6.2, "Building MySQL from a
380 Windows Source Distribution."

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26