Develop and Download Open Source Software

Browse Subversion Repository

Contents of /tags/tritonn-1.1.0-mysql-5.0.51a/INSTALL-WIN-SOURCE

Parent Directory Parent Directory | Revision Log Revision Log


Revision 99 - (show annotations) (download)
Tue Feb 5 07:55:57 2008 UTC (16 years, 1 month ago) by mir
File size: 16509 byte(s)
copy from tritonn-1.0.9-mysql-5.0.51a.

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

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