INSTALL-WIN-SOURCE 8.64 KB
Newer Older
1 2 3 4 5
#########################################################
#                                                       #
#         HOWTO : INSTALL MySQL FROM SOURCE             #
#                    WINDOWS PORT                       #
#                                                       #  
unknown's avatar
unknown committed
6
#           Copyright (C) MySQL AB 1995-2003            #
7 8
#########################################################

unknown's avatar
unknown committed
9 10 11 12
This is a simple 'HOWTO' document describing how to
build MySQL binaries for versions 4.1 and above on
Windows. Instructions are provided for building binaries
from a standard source distribution or from the BitKeeper
unknown's avatar
unknown committed
13
tree that contains the latest development source.
14 15 16 17 18

---------------------------------------------------------
NOTE
---------------------------------------------------------

unknown's avatar
unknown committed
19 20 21 22
Normally, it is best to use precompiled binary distributions
of MySQL that are built specifically for optimal performance
on Windows by MySQL AB.  Binary distributions are available
from:
23 24 25

http://www.mysql.com/downloads/

unknown's avatar
unknown committed
26 27 28 29
The instructions in this document are strictly for users
who want to test MySQL on Windows from the latest source or
from the BitKeeper tree, and for internal MySQL developers.

30 31 32 33
--------------------------------------------------------
TABLE OF CONTENTS
--------------------------------------------------------
1. REQUIREMENTS
unknown's avatar
unknown committed
34 35
2. OBTAINING A WINDOWS SOURCE DISTRIBUTION
3. CREATING A SOURCE PACKAGE FROM THE 'BitKeeper' TREE
36 37
4. BUILDING 'mysql server and clients' FROM VC++ WORKSPACE
5. BUILDING FROM 'nmake' MAKEFILES
unknown's avatar
unknown committed
38
6. STARTING THE MYSQL SERVER FOR THE FIRST TIME
39 40 41 42 43 44 45
7. TESTING THE CONNECTION
8. SPECIAL NOTES AND CONSIDERATIONS

-------------------------------------------------------
1. REQUIREMENTS
-------------------------------------------------------

unknown's avatar
unknown committed
46 47
To build MySQL on Windows from source, you need the
following compiler and resources available on your Windows
48 49 50 51 52 53
system:

   - Microsoft Visual C++ 6.0 and above
   - ~45 MB disk space
   - 64 MB RAM

unknown's avatar
unknown committed
54 55
You'll also need a MySQL source distribution, which you
can obtain as described in section 2.
56 57

-------------------------------------------------------
unknown's avatar
unknown committed
58
2. OBTAINING A WINDOWS SOURCE DISTRIBUTION
59 60
-------------------------------------------------------

unknown's avatar
unknown committed
61 62
There are two ways you can get a Windows source distribution
for MySQL version 4.1 and above:
63

unknown's avatar
unknown committed
64 65 66 67 68 69
 I.  Obtain a MySQL AB-distributed source distribution for the
     particular version of MySQL in which you are interested.
     Prepackaged source distributions are available for released
     versions of MySQL and can be obtained from:
     
     http://www.mysql.com/downloads/
70

unknown's avatar
unknown committed
71 72 73 74 75 76 77 78 79 80 81
 II. Alternatively, you can package a source distribution
     yourself from the latest BitKeeper developer source
     tree. If you plan to do this, you must create the
     package on a Unix system and then transfer it to your
     Windows system.  (The reason for this is that some of the
     configuration and build steps require tools that work only
     on Unix.)  The BitKeeper approach thus requires:

     - A system running Unix, or a Unix-like system such as Linux
     - BitKeeper 3.0 installed on that system (you can obtain
       BitKeeper from http://www.bitkeeper.com)
unknown's avatar
unknown committed
82 83

If you are using the first option, you can skip the  next
unknown's avatar
unknown committed
84 85
section and go directly to "BUILDING 'mysql server & clients'
FROM VC++ WORKSPACE"
86 87

-------------------------------------------------------
unknown's avatar
unknown committed
88
3. CREATING A SOURCE PACKAGE FROM THE 'BitKeeper' TREE
89 90
-------------------------------------------------------

unknown's avatar
unknown committed
91 92 93 94
To build the latest Windows source package from the current
BitKeeper source tree, use the following instructions. Please
note that this procedure must be performed on a system
running a Unix or Unix-like operating system.  (The procedure
unknown's avatar
unknown committed
95
is known to work well on Linux, for example.)
96

unknown's avatar
unknown committed
97 98
- Clone the BitKeeper source tree for MySQL (version 4.1
  or above, as desired).  For more information how to clone
unknown's avatar
unknown committed
99
  the source tree, see the instructions at:
unknown's avatar
unknown committed
100

101 102
  http://www.mysql.com/doc/en/Installing_source_tree.html

unknown's avatar
unknown committed
103 104 105 106
- Configure and build the distribution so that you have a
  server binary to work with.  One way to do this is to run
  the following command in the top-level directory of your
  source tree:
107

unknown's avatar
unknown committed
108 109
  ./BUILD/compile-pentium-max

unknown's avatar
unknown committed
110
- After making sure that the build process completed successfully,
unknown's avatar
unknown committed
111 112
  run the following utility script from top-level directory
  of your source tree:
113 114 115

  ./scripts/make_win_src_distribution

unknown's avatar
unknown committed
116 117 118
  This script creates a Windows source package, to be used on
  your Windows system.  You can supply different options to the
  script based on your needs. It accepts the following options:
119 120 121

    --debug   Debug, without creating the package
    --tmp     Specify the temporary location
unknown's avatar
unknown committed
122 123
    --suffix  Suffix name for the package
    --dirname Directory name to copy files (intermediate)
124 125 126 127
    --silent  Do not list verbosely files processed
    --tar     Create tar.gz package instead of .zip
    --help    Show this help message

unknown's avatar
unknown committed
128 129
   By default, make_win_src_distribution creates a zipped
   archive with the name mysql-$version-win-src.zip, where
unknown's avatar
unknown committed
130
   $version represents the version of your MySQL source tree.
131
 
unknown's avatar
unknown committed
132
 - Copy or upload to your Windows machine the Windows source
unknown's avatar
unknown committed
133
   package that you have just created. To compile it, use
unknown's avatar
unknown committed
134
   the instructions in the next section.
135 136

---------------------------------------------------------
unknown's avatar
unknown committed
137
4. BUILDING 'mysql server & clients' FROM VC++ WORKSPACE
138 139 140 141 142 143 144 145
---------------------------------------------------------

NOTE: MySQL 4.1 and above VC++ workspace files are compatible
      with Microsoft Visual Studio 6.0 and above(7.0/.NET)
      editions and tested by MySQL folks before each 
      release.

Unpack the Windows source zipped archive to a folder and open 
unknown's avatar
unknown committed
146 147 148
mysql.dsw from your top-level directory.

If you want to build both release and debug versions, then
unknown's avatar
unknown committed
149 150 151
select 'build' -> 'buildall' option. To build only release
or debug versions, select all appropriate workspaces from
the 'build' -> 'batch build' option.
unknown's avatar
unknown committed
152

unknown's avatar
unknown committed
153
The simplest solution to building the basic clients and core
unknown's avatar
unknown committed
154 155
server is to set your current active workspace as 'mysqld'
release or debug version, and just hit 'build' or 'F7', which
unknown's avatar
unknown committed
156 157
creates the necessary client binaries in the 'client_release'
or 'client_debug' directories. The libraries are placed in the
unknown's avatar
unknown committed
158 159 160 161
'lib_release' and 'lib_debug' directories for release and
debug versions, respectively.

Now you have built the distribution. If you get any compiler
unknown's avatar
unknown committed
162
errors, please cross check and email the compiler output to 
163 164 165
win32@lists.mysql.com for further assistance.

---------------------------------------------------------
unknown's avatar
unknown committed
166
5. BUILDING FROM 'nmake' MAKEFILES
167 168 169 170
---------------------------------------------------------
TODO from MySQL PIEFU team.

---------------------------------------------------------
unknown's avatar
unknown committed
171
6. STARTING THE MYSQL SERVER FOR THE FIRST TIME
172 173
---------------------------------------------------------

unknown's avatar
unknown committed
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
The server built using the preceding instructions will
expect that the MySQL base directory and data directory
are C:\mysql and C:\mysql\data by default. If you want to
test your server using the source root directory and its
data directory as the base directory and data directory,
you will need to tell the server their pathnames. You can
either do this on the command line with the --basedir
and --data-dir options, or place appropriate options in
an option file (C:\my.cnf or the my.ini file in your
Windows directory). If you have an existing data directory
elsewhere that you want to use, you can specify its pathname
instead.

Start your server from the 'client_release' or 'client_debug'
directory (depending on which server you want to use). The
general instructions are given here:
190 191 192

http://www.mysql.com/doc/en/Windows_installation.html

unknown's avatar
unknown committed
193 194 195
You'll have to adapt the instructions appropriately if you
want to use a different base directory and/or data directory.

unknown's avatar
unknown committed
196 197
That's all!!! See, it's as simple to build MySQL on Windows
as on any other platform!!!
198 199 200 201 202

---------------------------------------------------------
7. TESTING THE CONNECTION
---------------------------------------------------------

unknown's avatar
unknown committed
203 204 205 206
Once the server is running in standalone fashion or as a
service based on your configuration, try to connect to it
from the 'mysql' command line SQL interactive utility that
exists in your 'client_release' or 'client_debug' directory.
207 208 209 210 211

---------------------------------------------------------
8. SPECIAL NOTES AND CONSIDERATIONS
---------------------------------------------------------

unknown's avatar
unknown committed
212
- For production use, MySQL AB does not advise using a MySQL
unknown's avatar
unknown committed
213 214
  server built by yourself from source. It is preferable to
  stick to using binaries shipped by MySQL AB.
215

unknown's avatar
unknown committed
216 217
- If you find something not working as expected, or you have
  suggestions about ways to improve the current build process
unknown's avatar
unknown committed
218
  on Windows, please email to win32@lists.mysql.com.
219 220 221

Thanks
MySQL Team