Develop and Download Open Source Software

Browse Subversion Repository

Contents of /tags/tritonn-1.0.12-mysql-5.0.67/INSTALL-SOURCE

Parent Directory Parent Directory | Revision Log Revision Log


Revision 169 - (show annotations) (download)
Mon Dec 1 07:20:52 2008 UTC (15 years, 3 months ago) by mir
File size: 433874 byte(s)
renamed to version 1.0.12

1
2 Chapter 2. Installing and Upgrading MySQL
3
4 2.1. MySQL Installation Overview
5
6 This chapter describes how to obtain and install MySQL. You can
7 choose to install MySQL Enterprise or MySQL Community Server:
8 * MySQL Enterprise is MySQL AB's commercial offering for modern
9 enterprise businesses. It includes MySQL Enterprise Server and
10 the services provided by MySQL Network. To install MySQL
11 Enterprise, see Section 2.3, "Installing MySQL Enterprise."
12 * MySQL Community Server is for users who are comfortable
13 configuring and administering MySQL by themselves. To install
14 MySQL Community Server, see Section 2.4, "Installing MySQL
15 Community Server."
16
17 If you plan to upgrade an existing version of MySQL to a newer
18 version rather than install MySQL for the first time, see Section
19 2.4.17, "Upgrading MySQL," for information about upgrade
20 procedures and about issues that you should consider before
21 upgrading.
22
23 If you are interested in migrating to MySQL from another database
24 system, you may wish to read Section A.8, "MySQL 5.0 FAQ ---
25 Migration," which contains answers to some common questions
26 concerning migration issues.
27
28 2.2. Determining your current MySQL version
29
30 To determine the version and release of your currently installed
31 MySQL installation, there are a number of options.
32 * Using a command client (mysql), the server version of the
33 MySQL server to which you are connected is shown once you are
34 connected. The server version information includes community
35 or enterprise accordingly.
36 For example, here is the output from a MySQL Community Server
37 edition installed on Linux:
38 Welcome to the MySQL monitor. Commands end with ; or \g.
39 Your MySQL connection id is 6
40 Server version: 5.0.27-standard MySQL Community Edition - Standard (G
41 PL)
42
43 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
44
45 mysql>
46 This is an example of the output from MySQL Enterprise Server
47 on Windows:
48 Welcome to the MySQL monitor. Commands end with ; or \g.
49 Your MySQL connection id is 2
50 Server version: 5.0.28-enterprise-gpl-nt MySQL Enterprise Server (GPL
51 )
52
53 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
54 * You may also determine the version information using the
55 version variables. Both the version and version_comment
56 variables contain version information for the server to which
57 you are connected. Use the SHOW VARIABLES statement to obtain
58 the information you want, as shown in this example:
59 mysql> SHOW VARIABLES LIKE "%version%";
60 +-------------------------+------------------------------------------
61 +
62 | Variable_name | Value
63 |
64 +-------------------------+------------------------------------------
65 +
66 | protocol_version | 10
67 |
68 | version | 5.0.27-standard
69 |
70 | version_comment | MySQL Community Edition - Standard (GPL)
71 |
72 | version_compile_machine | i686
73 |
74 | version_compile_os | pc-linux-gnu
75 |
76 +-------------------------+------------------------------------------
77 +
78 5 rows in set (0.04 sec)
79
80 Note
81 MySQL Administrator shows the server version within the Server
82 Information tab. However, only the value of version is shown.
83 * The STATUS command displays the version as well as version
84 comment information. For example:
85 mysql> STATUS;
86 --------------
87 ./client/mysql Ver 14.12 Distrib 5.0.29, for pc-linux-gnu (i686) usi
88 ng readline 5.0
89
90 Connection id: 8
91 Current database:
92 Current user: mc@localhost
93 SSL: Not in use
94 Current pager: /usr/bin/less
95 Using outfile: ''
96 Using delimiter: ;
97 Server version: 5.0.27-standard MySQL Community Edition - Sta
98 ndard (GPL)
99 Protocol version: 10
100 Connection: Localhost via UNIX socket
101 Server characterset: latin1
102 Db characterset: latin1
103 Client characterset: latin1
104 Conn. characterset: latin1
105 UNIX socket: /tmp/mysql.sock
106 Uptime: 1 day 3 hours 58 min 43 sec
107
108 Threads: 2 Questions: 17 Slow queries: 0 Opens: 11 Flush tables:
109 1 Open tables: 6 Queries per second avg: 0.000
110 --------------
111
112 2.3. Installing MySQL Enterprise
113
114 This section does not apply to MySQL Community Server users.
115
116 This section contains information about the components,
117 installation and initial configuration requirements for installing
118 MySQL Enterprise.
119
120 2.3.1. Overview of MySQL Enterprise Installation
121
122 To obtain MySQL Enterprise, visit http://enterprise.mysql.com if
123 you're a customer. Otherwise, visit
124 http://www.mysql.com/products/enterprise/. The platforms that are
125 officially supported for MySQL Enterprise are listed at
126 http://www.mysql.com/support/supportedplatforms.html.
127
128 MySQL Enterprise Server is available for download in the form of
129 Quarterly Service Pack (QSP) or Monthly Rapid Update (MRU) binary
130 releases.
131
132 To install MySQL Enterprise Server, you should use the latest
133 available Quarterly Service Pack (QSP). This includes an
134 accumulation of the bug fixes provided in all predecessor QSP and
135 MRU releases.
136
137 MRU releases are provided on a monthly basis and represent the
138 most current Enterprise Server bug fixes. Each MRU is an
139 accumulation of the bug fixes included in its predecessor.
140 Customers should standardize on the latest MRU release only if it
141 includes a needed bug fix.
142
143 2.3.2. Enterprise Server Distribution Types
144
145 This section does not apply to MySQL Community Server users.
146
147 Enterprise Server releases will be created for the following
148 packages from the MySQL 5.0 tree:
149 * mysql-enterprise: Released under a commercial license and
150 includes the following storage engines: MyISAM, MEMORY, MERGE,
151 InnoDB, ARCHIVE, BLACKHOLE, EXAMPLE, FEDERATED.
152 * mysql-enterprise-gpl: Same as mysql-enterprise, but released
153 under the GPL.
154 * mysql-cluster: mysql-enterprise plus MySQL Cluster (NDB).
155 * mysql-classic: Released under a commercial license, does not
156 include InnoDB.
157 * mysql-community: Same as mysql-enterprise-gpl, but available
158 for the community, and released every 6 months.
159
160 To satisfy different user requirements, we provide several
161 servers. mysqld is an optimized server that is a smaller, faster
162 binary. mysqld-debug is compiled with debugging support but is
163 otherwise configured identically to the non-debug server.
164
165 Each of these servers is compiled from the same source
166 distribution, though with different configuration options. All
167 native MySQL clients can connect to servers from either MySQL
168 version.
169
170 2.3.3. Installing the Enterprise MySQL Server
171
172 For Windows and Mac OS X platforms you will need to use the MySQL
173 installer. For all other other platforms, you will need to use the
174 TAR, Zip or native package format (RPM, Solaris PKG) pafiles to
175 perform the installation.
176
177 2.3.4. Upgrading MySQL Enterprise Server
178
179 This section does not apply to MySQL Community Server users.
180
181 When upgrading to MySQL Enterprise from Community Server you need
182 only follow the installation process to install and upgrade the
183 packages to the latest version provided by MySQL Enterprise. You
184 will also need to install the latest MySQL Enterprise Service Pack
185 and any outstanding MySQL Hot-fix packs.
186
187 Be aware, however, that you must take into account any of the
188 changes when moving between major releases. You should also check
189 the release notes (see Appendix C, "MySQL Enterprise Release
190 Notes") for details on major changes between revisions of MySQL
191 Enterprise Server. For details of changes in other packages in
192 MySQL Enterprise, see Appendix E, "MySQL Change History."
193
194 You should also review the notes and advice contained within
195 Section 2.4.17, "Upgrading MySQL."
196
197 2.3.5. Uninstalling MySQL Enterprise
198
199 This section does not apply to MySQL Community Server users.
200
201 You can uninstall MySQL Enterprise using the standard tools
202 according to your operating system.
203
204 Note
205
206 When uninstalling, any data files created are not removed. You
207 will need to separately remove these files to completely remove
208 MySQL from your system.
209
210 2.3.5.1. Uninstalling on Windows
211
212 To uninstall MySQL Enterprise on Windows you should use the Add or
213 Remove Programs utility located within the Control Panel.
214 Uninstalling MySQL Enterprise
215
216 Packages within MySQL Enterprise must be removed individually. You
217 may also use this option to remove packages that you no longer
218 want or use.
219
220 Any data you created while MySQL Enterprise was installed will not
221 be removed. You will need to separately delete this information.
222
223 2.3.5.2. Uninstalling on Linux (RPMs)
224
225 To uninstall MySQL Enterprise on a Linux operating system that
226 uses the RPM package format, you must remove each of the packages
227 that were installed by the MySQL Enterprise Installer
228 individually.
229
230 To do this, first obtain a list of the installed packages:
231 shell> rpm -q -a|grep -i mysql
232 mysql-docs-en-5.0.26-1
233 MySQL-server-standard-5.0.26-0.rhel4
234 mysql-connector-j-5.0.3-1
235 MySQL-devel-standard-5.0.26-0.rhel4
236 mysql-query-browser-5.0r4-1rhel4
237 mysql-connector-odbc-3.51.12-1
238 MySQL-client-standard-5.0.26-0.rhel4
239 mysql-administrator-5.0r4-1rhel4
240 mysql-gui-tools-5.0r4-1rhel4
241 mysql-setup-wizard-1.0-1
242 mysql-connector-net-1.0.7-1
243
244 You can remove these packages individually, or all together
245 automatically, like this:
246 shell> rpm -q -a|grep -i mysql|xargs rpm --erase
247
248 2.4. Installing MySQL Community Server
249
250 2.4.1. Overview of MySQL Community Server Installation
251
252 1. Determine whether MySQL runs and is supported on your
253 platform. Not all platforms are equally suitable for running
254 MySQL, and not all platforms on which MySQL is known to run
255 are officially supported by MySQL AB. For a list of platforms
256 on which MySQL Community Server runs, see Section 2.4.2,
257 "Operating Systems Supported by MySQL Community Server."
258 2. Choose which distribution to install. Several versions of
259 MySQL are available, and most are available in multiple
260 distribution formats. You can choose from prepackaged
261 distributions containing binary (precompiled) programs or
262 source code. When in doubt, use a binary distribution. We also
263 provide public access to our current source trees for those
264 who want to see our most recent developments and to help us
265 test new code. To determine which version and type of
266 distribution you should use, see Section 2.4.3, "Choosing
267 Which MySQL Distribution to Install."
268 3. Download the distribution that you want to install. For
269 download instructions, see Section 2.4.4, "How to Get MySQL."
270 To verify the integrity of the distribution, use the
271 instructions in Section 2.4.5, "Verifying Package Integrity
272 Using MD5 Checksums or GnuPG."
273 4. Install the distribution. To install MySQL from a binary
274 distribution, use the instructions in Section 2.4.7, "Standard
275 MySQL Installation Using a Binary Distribution." To install
276 MySQL from a source distribution or from the current
277 development source tree, use the instructions in Section
278 2.4.15, "MySQL Installation Using a Source Distribution."
279 If you encounter installation difficulties, see Section
280 2.4.19, "Operating System-Specific Notes," for information on
281 solving problems for particular platforms.
282 5. Perform any necessary post-installation setup. After
283 installing MySQL, read Section 2.4.16, "Post-Installation
284 Setup and Testing," which contains important information about
285 making sure the MySQL server is working properly. It also
286 describes how to secure the initial MySQL user accounts, which
287 have no passwords until you assign passwords. The information
288 in this section applies whether you install MySQL using a
289 binary or source distribution.
290 6. Perform setup for running benchmarks (optional). If you want
291 to use the MySQL benchmark scripts, Perl support for MySQL
292 must be available. See Section 2.4.21, "Perl Installation
293 Notes," for more information.
294
295 The sections immediately following this one contain necessary
296 information about choosing, downloading, and verifying your
297 distribution. The instructions in later sections of the chapter
298 describe how to install the distribution that you choose. For
299 binary distributions, see the instructions in Section 2.4.7,
300 "Standard MySQL Installation Using a Binary Distribution." To
301 build MySQL from source, use the instructions in Section 2.4.15,
302 "MySQL Installation Using a Source Distribution."
303
304 2.4.2. Operating Systems Supported by MySQL Community Server
305
306 This section does not apply to MySQL Enterprise Server users.
307
308 This section lists the operating systems on which MySQL Community
309 Server is known to run.
310
311 Important
312
313 MySQL AB does not necessarily provide official support for all the
314 platforms listed in this section. For information about those
315 platforms which MySQL AB officially supports, see MySQL Server
316 Supported Platforms
317 (http://www.mysql.com/support/supportedplatforms.html) on the
318 MySQL Web site.
319
320 We use GNU Autoconf, so it is possible to port MySQL to all modern
321 systems that have a C++ compiler and a working implementation of
322 POSIX threads. (Thread support is needed for the server. To
323 compile only the client code, the only requirement is a C++
324 compiler.)
325
326 MySQL has been reported to compile successfully on the following
327 combinations of operating system and thread package.
328 * AIX 4.x and 5.x with native threads. See Section 2.4.19.5.3,
329 "IBM-AIX notes."
330 * Amiga.
331 * FreeBSD 5.x and up with native threads.
332 * HP-UX 11.x with native threads. See Section 2.4.19.5.2, "HP-UX
333 Version 11.x Notes."
334 * Linux. MySQL builds on all fairly recent Linux distributions
335 with glibc 2.3. See Section 2.4.19.1, "Linux Notes."
336 * Mac OS X. See Section 2.4.19.2, "Mac OS X Notes."
337 * NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha. See Section
338 2.4.19.4.2, "NetBSD Notes."
339 * Novell NetWare 6.0 and 6.5. See Section 2.4.13, "Installing
340 MySQL on NetWare."
341 * OpenBSD 2.5 and with native threads. OpenBSD earlier than 2.5
342 with the MIT-pthreads package. See Section 2.4.19.4.3,
343 "OpenBSD 2.5 Notes."
344 * SCO OpenServer 5.0.X with a recent port of the FSU Pthreads
345 package. See Section 2.4.19.5.8, "SCO UNIX and OpenServer
346 5.0.x Notes."
347 * SCO Openserver 6.0.x. See Section 2.4.19.5.9, "SCO OpenServer
348 6.0.x Notes."
349 * SCO UnixWare 7.1.x. See Section 2.4.19.5.10, "SCO UnixWare
350 7.1.x and OpenUNIX 8.0.0 Notes."
351 * SGI Irix 6.x with native threads. See Section 2.4.19.5.7, "SGI
352 Irix Notes."
353 * Solaris 2.5 and above with native threads on SPARC and x86.
354 See Section 2.4.19.3, "Solaris Notes."
355 * Tru64 Unix. See Section 2.4.19.5.5, "Alpha-DEC-UNIX Notes
356 (Tru64)."
357 * Windows 2000, XP, and Windows Server 2003, as well as 32-bit
358 Windows Vista. See Section 2.4.8, "Installing MySQL on
359 Windows."
360
361 MySQL has also been known to run on other systems in the past. See
362 Section 2.4.19, "Operating System-Specific Notes." Some porting
363 effort might be required for current versions of MySQL on these
364 systems.
365
366 Not all platforms are equally well suited for running MySQL. How
367 well a certain platform is suited for a high-load mission-critical
368 MySQL server is determined by the following factors:
369 * General stability of the thread library. A platform may have
370 an excellent reputation otherwise, but MySQL is only as stable
371 as the thread library it calls, even if everything else is
372 perfect.
373 * The capability of the kernel and the thread library to take
374 advantage of symmetric multi-processor (SMP) systems. When a
375 process creates a thread, it should be possible for that
376 thread to run on a CPU different from the original process.
377 * Multi-threading and handling of mutexes. The capability of
378 the kernel and the thread library to run many threads that
379 acquire and release a mutex over a short critical region
380 frequently without excessive context switches. If the
381 implementation of pthread_mutex_lock() does not easily yield
382 CPU time, this hurts MySQL tremendously. If this issue is not
383 taken care of, adding extra CPUs actually makes MySQL slower.
384 * Filesystem stability and performance. MySQL's stability and
385 performance are directly affected by those of the operating
386 platform's filesystem. In particular, where large tables are
387 in use, performance is affected by the ability of the
388 filesystem to deal with large files at all and to deal with
389 them efficiently.
390 * Expertise with the platform. If we know a platform well, we
391 enable platform-specific optimizations and fixes at compile
392 time. We can also provide advice on configuring your system
393 optimally for MySQL. This is also affected by the amount of
394 testing we have done internally for similar configurations, as
395 well as by the number of users that have run MySQL
396 successfully on the platform in similar configurations. If
397 these figures are high, the likelihood of encountering
398 platform-specific surprises is much smaller.
399
400 2.4.3. Choosing Which MySQL Distribution to Install
401
402 This section does not apply to MySQL Enterprise Server users.
403
404 When preparing to install MySQL, you should decide which version
405 to use. MySQL development occurs in several release series, and
406 you can pick the one that best fits your needs. After deciding
407 which version to install, you can choose a distribution format.
408 Releases are available in binary or source format.
409
410 2.4.3.1. Choosing Which Version of MySQL to Install
411
412 This section does not apply to MySQL Enterprise Server users.
413
414 The first decision to make is whether you want to use a production
415 (stable) release or a development release. In the MySQL
416 development process, multiple release series co-exist, each at a
417 different stage of maturity:
418 * MySQL 5.1 is the current development release series.
419 * MySQL 5.0 is the current stable (production-quality) release
420 series. New releases are issued for bugfixes only; no new
421 features are being added that could effect stability.
422 * MySQL 4.1, 4.0 and 3.23 are the old stable
423 (production-quality) release series. MySQL 4.1 is now at the
424 end of the product lifecycle. Active development and support
425 for these versions has ended. Extended support for MySQL 4.1
426 and 4.0 is available. According to the MySQL Lifecycle Policy
427 (seehttp://www.mysql.com/company/legal/lifecycle/#policy),
428 only Security and Severity Level 1 issues will still be fixed
429 for MySQL 4.0 and 4.1.
430
431 We do not believe in a complete code freeze because this prevents
432 us from making bugfixes and other fixes that must be done. By
433 "somewhat frozen" we mean that we may add small things that should
434 not affect anything that currently works in a production release.
435 Naturally, relevant bugfixes from an earlier series propagate to
436 later series.
437
438 Normally, if you are beginning to use MySQL for the first time or
439 trying to port it to some system for which there is no binary
440 distribution, we recommend going with the production release
441 series. Currently, this is MySQL 5.0. All MySQL releases, even
442 those from development series, are checked with the MySQL
443 benchmarks and an extensive test suite before being issued.
444
445 If you are running an older system and want to upgrade, but do not
446 want to take the chance of having a non-seamless upgrade, you
447 should upgrade to the latest version in the same release series
448 you are using (where only the last part of the version number is
449 newer than yours). We have tried to fix only fatal bugs and make
450 only small, relatively "safe" changes to that version.
451
452 If you want to use new features not present in the production
453 release series, you can use a version from a development series.
454 Note that development releases are not as stable as production
455 releases.
456
457 If you want to use the very latest sources containing all current
458 patches and bugfixes, you can use one of our Bazaar repositories.
459 These are not "releases" as such, but are available as previews of
460 the code on which future releases are to be based.
461
462 The MySQL naming scheme uses release names that consist of three
463 numbers and a suffix; for example, mysql-5.0.12-beta. The numbers
464 within the release name are interpreted as follows:
465 * The first number (5) is the major version and describes the
466 file format. All MySQL 5 releases have the same file format.
467 * The second number (0) is the release level. Taken together,
468 the major version and release level constitute the release
469 series number.
470 * The third number (12) is the version number within the release
471 series. This is incremented for each new release. Usually you
472 want the latest version for the series you have chosen.
473
474 For each minor update, the last number in the version string is
475 incremented. When there are major new features or minor
476 incompatibilities with previous versions, the second number in the
477 version string is incremented. When the file format changes, the
478 first number is increased.
479
480 Release names also include a suffix to indicates the stability
481 level of the release. Releases within a series progress through a
482 set of suffixes to indicate how the stability level improves. The
483 possible suffixes are:
484 * alpha indicates that the release is for preview purposes only.
485 Known bugs should be documented in the News section (see
486 Appendix E, "MySQL Change History"). Most alpha releases
487 implement new commands and extensions. Active development that
488 may involve major code changes can occur in an alpha release.
489 However, we do conduct testing before issuing a release.
490 * beta indicates that the release is appropriate for use with
491 new development. Within beta releases, the features and
492 compatibility should remain consistent. However, beta releases
493 may contain numerous and major unaddressed bugs.
494 No APIs, externally visible structures, or columns for SQL
495 statements will change during future beta, release candidate,
496 or production releases.
497 * rc indicates a Release Candidate. Release candidates are
498 believed to be stable, having passed all of MySQL's internal
499 testing, and with all known fatal runtime bugs fixed. However,
500 the release has not been in widespread use long enough to know
501 for sure that all bugs have been identified. Only minor fixes
502 are added. (A release candidate is what formerly was known as
503 a gamma release.)
504 * If there is no suffix, it indicates that the release is a
505 General Availability (GA) or Production release. GA releases
506 are stable, having successfully passed through all earlier
507 release stages and are believed to be reliable, free of
508 serious bugs, and suitable for use in production systems. Only
509 critical bugfixes are applied to the release.
510
511 MySQL uses a naming scheme that is slightly different from most
512 other products. In general, it is usually safe to use any version
513 that has been out for a couple of weeks without being replaced by
514 a new version within the same release series.
515
516 All releases of MySQL are run through our standard tests and
517 benchmarks to ensure that they are relatively safe to use. Because
518 the standard tests are extended over time to check for all
519 previously found bugs, the test suite keeps getting better.
520
521 All releases have been tested at least with these tools:
522 * Our internal test suite. The mysql-test directory contains an
523 extensive set of test cases. We run these tests for every
524 server binary. See Section 28.1.2, "MySQL Test Suite," for
525 more information about this test suite.
526 * The MySQL benchmark suite. This suite runs a range of common
527 queries. It is also a test to determine whether the latest
528 batch of optimizations actually made the code faster. See
529 Section 7.1.4, "The MySQL Benchmark Suite."
530 * The crash-me test. This test tries to determine what features
531 the database supports and what its capabilities and
532 limitations are. See Section 7.1.4, "The MySQL Benchmark
533 Suite."
534
535 We also test the newest MySQL version in our internal production
536 environment, on at least one machine. We have more than 100GB of
537 data to work with.
538
539 2.4.3.2. Choosing a Distribution Format
540
541 This section does not apply to MySQL Enterprise Server users.
542
543 After choosing which version of MySQL to install, you should
544 decide whether to use a binary distribution or a source
545 distribution. In most cases, you should probably use a binary
546 distribution, if one exists for your platform. Binary
547 distributions are available in native format for many platforms,
548 such as RPM files for Linux or PKG package installers for Mac OS X
549 or Solaris. Distributions also are available as Zip archives or
550 compressed tar files.
551
552 Reasons to choose a binary distribution include the following:
553 * Binary distributions generally are easier to install than
554 source distributions.
555 * To satisfy different user requirements, we provide several
556 servers in binary distributions. mysqld is an optimized server
557 that is a smaller, faster binary. mysqld-debug is compiled
558 with debugging support.
559 Each of these servers is compiled from the same source
560 distribution, though with different configuration options. All
561 native MySQL clients can connect to servers from either MySQL
562 version.
563
564 Under some circumstances, you may be better off installing MySQL
565 from a source distribution:
566 * You want to install MySQL at some explicit location. The
567 standard binary distributions are ready to run at any
568 installation location, but you might require even more
569 flexibility to place MySQL components where you want.
570 * You want to configure mysqld to ensure that features are
571 available that might not be included in the standard binary
572 distributions. Here is a list of the most common extra options
573 that you may want to use to ensure feature availability:
574 + --with-berkeley-db (not available on all platforms)
575 + --with-libwrap
576 + --with-named-z-libs (this is done for some of the
577 binaries)
578 + --with-debug[=full]
579 * You want to configure mysqld without some features that are
580 included in the standard binary distributions. For example,
581 distributions normally are compiled with support for all
582 character sets. If you want a smaller MySQL server, you can
583 recompile it with support for only the character sets you
584 need.
585 * You have a special compiler (such as pgcc) or want to use
586 compiler options that are better optimized for your processor.
587 Binary distributions are compiled with options that should
588 work on a variety of processors from the same processor
589 family.
590 * You want to use the latest sources from one of the Bazaar
591 repositories to have access to all current bugfixes. For
592 example, if you have found a bug and reported it to the MySQL
593 development team, the bugfix is committed to the source
594 repository and you can access it there. The bugfix does not
595 appear in a release until a release actually is issued.
596 * You want to read (or modify) the C and C++ code that makes up
597 MySQL. For this purpose, you should get a source distribution,
598 because the source code is always the ultimate manual.
599 * Source distributions contain more tests and examples than
600 binary distributions.
601
602 2.4.3.3. How and When Updates Are Released
603
604 MySQL is evolving quite rapidly and we want to share new
605 developments with other MySQL users. We try to produce a new
606 release whenever we have new and useful features that others also
607 seem to have a need for.
608
609 We also try to help users who request features that are easy to
610 implement. We take note of what our licensed users want, and we
611 especially take note of what our support customers want and try to
612 help them in this regard.
613
614 No one is required to download a new release. The News section
615 helps you determine whether the new release has something you
616 really want. See Appendix E, "MySQL Change History."
617
618 We use the following policy when updating MySQL:
619 * Enterprise Server releases are meant to appear every 18
620 months, supplemented by quarterly service packs and monthly
621 rapid updates. Community Server releases are meant to appear
622 2-3 times per year.
623 * Releases are issued within each series. Enterprise Server
624 releases are numbered using even numbers (for example,
625 5.0.20). Community Server releases are numbered using odd
626 numbers (for example, 5.0.21).
627 * Binary distributions for some platforms are made by us for
628 major releases. Other people may make binary distributions for
629 other systems, but probably less frequently.
630 * We make fixes available as soon as we have identified and
631 corrected small or non-critical but annoying bugs. The fixes
632 are available in source form immediately from our public
633 Bazaar repositories, and are included in the next release.
634 * If by any chance a security vulnerability or critical bug is
635 found in a release, our policy is to fix it in a new release
636 as soon as possible. (We would like other companies to do
637 this, too!)
638
639 2.4.3.4. MySQL Binaries Compiled by MySQL AB
640
641 This section does not apply to MySQL Enterprise Server users.
642
643 As a service of MySQL AB, we provide a set of binary distributions
644 of MySQL that are compiled on systems at our site or on systems
645 where supporters of MySQL kindly have given us access to their
646 machines.
647
648 In addition to the binaries provided in platform-specific package
649 formats, we offer binary distributions for a number of platforms
650 in the form of compressed tar files (.tar.gz files). See Section
651 2.4.7, "Standard MySQL Installation Using a Binary Distribution."
652
653 The RPM distributions for MySQL 5.0 releases that we make
654 available through our Web site are generated by MySQL AB.
655
656 For Windows distributions, see Section 2.4.8, "Installing MySQL on
657 Windows."
658
659 These distributions are generated using the script
660 scripts/make_binary_distribution.
661
662 The binaries are configured and built with the following compilers
663 and options. This information can also be obtained by looking at
664 the variables COMP_ENV_INFO and CONFIGURE_LINE inside the script
665 bin/mysqlbug of every binary tar file distribution.
666
667 Anyone who has more optimal options for any of the following
668 configure commands can mail them to the MySQL internals mailing
669 list. See Section 1.6.1, "MySQL Mailing Lists."
670
671 If you want to compile a debug version of MySQL, you should add
672 --with-debug or --with-debug=full to the following configure
673 commands and remove any -fomit-frame-pointer options.
674
675 The following binaries are built on MySQL AB development systems:
676 * Linux 2.4.xx x86 with gcc 2.95.3:
677 CFLAGS="-O2 -mcpu=pentiumpro" CXX=gcc CXXFLAGS="-O2 -mcpu=pentiumpro
678 -felide-constructors" ./configure --prefix=/usr/local/mysql
679 --with-extra-charsets=complex --enable-thread-safe-client
680 --enable-local-infile --enable-assembler --disable-shared
681 --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
682 * Linux 2.4.x x86 with icc (Intel C++ Compiler 8.1 or later
683 releases):
684 CC=icc CXX=icpc CFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict"
685 CXXFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict" ./configure
686 --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
687 --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
688 --enable-thread-safe-client --enable-local-infile --enable-assembler
689 --disable-shared --with-client-ldflags=-all-static
690 --with-mysqld-ldflags=-all-static --with-embedded-server --with-innod
691 b
692
693 Note
694 Versions 8.1 and newer of the Intel compiler have separate
695 drivers for 'pure' C (icc) and C++ (icpc); if you use icc
696 version 8.0 or older for building MySQL, you need to set
697 CXX=icc.
698 * Linux 2.4.xx Intel Itanium 2 with ecc (Intel C++ Itanium
699 Compiler 7.0):
700 CC=ecc CFLAGS="-O2 -tpp2 -ip -nolib_inline" CXX=ecc CXXFLAGS="-O2
701 -tpp2 -ip -nolib_inline" ./configure --prefix=/usr/local/mysql
702 --with-extra-charsets=complex --enable-thread-safe-client
703 --enable-local-infile
704 * Linux 2.4.xx Intel Itanium with ecc (Intel C++ Itanium
705 Compiler 7.0):
706 CC=ecc CFLAGS=-tpp1 CXX=ecc CXXFLAGS=-tpp1 ./configure
707 --prefix=/usr/local/mysql --with-extra-charsets=complex
708 --enable-thread-safe-client --enable-local-infile
709 * Linux 2.4.xx alpha with ccc (Compaq C V6.2-505 / Compaq C++
710 V6.3-006):
711 CC=ccc CFLAGS="-fast -arch generic" CXX=cxx CXXFLAGS="-fast -arch
712 generic -noexceptions -nortti" ./configure --prefix=/usr/local/mysql
713 --with-extra-charsets=complex --enable-thread-safe-client
714 --enable-local-infile --with-mysqld-ldflags=-non_shared
715 --with-client-ldflags=-non_shared --disable-shared
716 * Linux 2.x.xx ppc with gcc 2.95.4:
717 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
718 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
719 -fno-rtti" ./configure --prefix=/usr/local/mysql
720 --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/b
721 in
722 --with-extra-charsets=complex --enable-thread-safe-client
723 --enable-local-infile --disable-shared --with-embedded-server
724 --with-innodb
725 * Linux 2.4.xx s390 with gcc 2.95.3:
726 CFLAGS="-O2" CXX=gcc CXXFLAGS="-O2 -felide-constructors" ./configure
727 --prefix=/usr/local/mysql --with-extra-charsets=complex
728 --enable-thread-safe-client --enable-local-infile --disable-shared
729 --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
730 * Linux 2.4.xx x86_64 (AMD64) with gcc 3.2.1:
731 CXX=gcc ./configure --prefix=/usr/local/mysql
732 --with-extra-charsets=complex --enable-thread-safe-client
733 --enable-local-infile --disable-shared
734 * Sun Solaris 8 x86 with gcc 3.2.3:
735 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
736 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
737 -fno-rtti" ./configure --prefix=/usr/local/mysql
738 --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/b
739 in
740 --with-extra-charsets=complex --enable-thread-safe-client
741 --enable-local-infile --disable-shared --with-innodb
742 * Sun Solaris 8 SPARC with gcc 3.2:
743 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
744 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
745 -fno-rtti" ./configure --prefix=/usr/local/mysql
746 --with-extra-charsets=complex --enable-thread-safe-client
747 --enable-local-infile --enable-assembler --with-named-z-libs=no
748 --with-named-curses-libs=-lcurses --disable-shared
749 * Sun Solaris 8 SPARC 64-bit with gcc 3.2:
750 CC=gcc CFLAGS="-O3 -m64 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O
751 3
752 -m64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
753 -fno-rtti" ./configure --prefix=/usr/local/mysql
754 --with-extra-charsets=complex --enable-thread-safe-client
755 --enable-local-infile --with-named-z-libs=no
756 --with-named-curses-libs=-lcurses --disable-shared
757 * Sun Solaris 9 SPARC with gcc 2.95.3:
758 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
759 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
760 -fno-rtti" ./configure --prefix=/usr/local/mysql
761 --with-extra-charsets=complex --enable-thread-safe-client
762 --enable-local-infile --enable-assembler --with-named-curses-libs=-lc
763 urses
764 --disable-shared
765 * Sun Solaris 9 SPARC with cc-5.0 (Sun Forte 5.0):
766 CC=cc-5.0 CXX=CC ASFLAGS="-xarch=v9" CFLAGS="-Xa -xstrconst -mt
767 -D_FORTEC_ -xarch=v9" CXXFLAGS="-noex -mt -D_FORTEC_ -xarch=v9"
768 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
769 --enable-thread-safe-client --enable-local-infile --enable-assembler
770 --with-named-z-libs=no --enable-thread-safe-client --disable-shared
771 * IBM AIX 4.3.2 ppc with gcc 3.2.3:
772 CFLAGS="-O2 -mcpu=powerpc -Wa,-many " CXX=gcc CXXFLAGS="-O2
773 -mcpu=powerpc -Wa,-many -felide-constructors -fno-exceptions
774 -fno-rtti" ./configure --prefix=/usr/local/mysql
775 --with-extra-charsets=complex --enable-thread-safe-client
776 --enable-local-infile --with-named-z-libs=no --disable-shared
777 * IBM AIX 4.3.3 ppc with xlC_r (IBM Visual Age C/C++ 6.0):
778 CC=xlc_r CFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
779 CXX=xlC_r CXXFLAGS ="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
780 ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysq
781 l/data
782 --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
783 --enable-thread-safe-client --enable-local-infile --with-named-z-libs
784 =no
785 --disable-shared --with-innodb
786 * IBM AIX 5.1.0 ppc with gcc 3.3:
787 CFLAGS="-O2 -mcpu=powerpc -Wa,-many" CXX=gcc CXXFLAGS="-O2 -mcpu=powe
788 rpc
789 -Wa,-many -felide-constructors -fno-exceptions -fno-rtti" ./configure
790 --prefix=/usr/local/mysql --with-extra-charsets=complex
791 --enable-thread-safe-client --enable-local-infile --with-named-z-libs
792 =no
793 --disable-shared
794 * IBM AIX 5.2.0 ppc with xlC_r (IBM Visual Age C/C++ 6.0):
795 CC=xlc_r CFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
796 CXX=xlC_r CXXFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
797 ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysq
798 l/data
799 --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
800 --enable-thread-safe-client --enable-local-infile --with-named-z-libs
801 =no
802 --disable-shared --with-embedded-server --with-innodb
803 * HP-UX 10.20 pa-risc1.1 with gcc 3.1:
804 CFLAGS="-DHPUX -I/opt/dce/include -O3 -fPIC" CXX=gcc CXXFLAGS="-DHPUX
805 -I/opt/dce /include -felide-constructors -fno-exceptions -fno-rtti
806 -O3 -fPIC" ./configure --prefix=/usr/local/mysql
807 --with-extra-charsets=complex --enable-thread-safe-client
808 --enable-local-infile --with-pthread --with-named-thread-libs=-ldce
809 --with-lib-ccflags=-fPIC --disable-shared
810 * HP-UX 11.00 pa-risc with aCC (HP ANSI C++ B3910B A.03.50):
811 CC=cc CXX=aCC CFLAGS=+DAportable CXXFLAGS=+DAportable ./configure
812 --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
813 --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
814 --enable-thread-safe-client --enable-local-infile --disable-shared
815 --with-embedded-server --with-innodb
816 * HP-UX 11.11 pa-risc2.0 64bit with aCC (HP ANSI C++ B3910B
817 A.03.33):
818 CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure
819 --prefix=/usr/local/mysql --with-extra-charsets=complex
820 --enable-thread-safe-client --enable-local-infile --disable-shared
821 * HP-UX 11.11 pa-risc2.0 32bit with aCC (HP ANSI C++ B3910B
822 A.03.33):
823 CC=cc CXX=aCC CFLAGS="+DAportable" CXXFLAGS="+DAportable" ./configure
824 --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
825 --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
826 --enable-thread-safe-client --enable-local-infile --disable-shared
827 --with-innodb
828 * HP-UX 11.22 ia64 64bit with aCC (HP aC++/ANSI C B3910B
829 A.05.50):
830 CC=cc CXX=aCC CFLAGS="+DD64 +DSitanium2" CXXFLAGS="+DD64 +DSitanium2"
831 ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysq
832 l/data
833 --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
834 --enable-thread-safe-client --enable-local-infile --disable-shared
835 --with-embedded-server --with-innodb
836 * Apple Mac OS X 10.2 powerpc with gcc 3.1:
837 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
838 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
839 -fno-rtti" ./configure --prefix=/usr/local/mysql
840 --with-extra-charsets=complex --enable-thread-safe-client
841 --enable-local-infile --disable-shared
842 * FreeBSD 4.7 i386 with gcc 2.95.4:
843 CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql
844 --with-extra-charsets=complex --enable-thread-safe-client
845 --enable-local-infile --enable-assembler --with-named-z-libs=not-used
846 --disable-shared
847 * FreeBSD 4.7 i386 using LinuxThreads with gcc 2.95.4:
848 CFLAGS="-DHAVE_BROKEN_REALPATH -D__USE_UNIX98 -D_REENTRANT
849 -D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
850 CXXFLAGS="-DHAVE_BROKEN_REALPATH -D__USE_UNIX98 -D_REENTRANT
851 -D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" ./configure
852 --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
853 --libexecdir=/usr/local/mysql/bin --enable-thread-safe-client
854 --enable-local-infile --enable-assembler
855 --with-named-thread-libs="-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
856 -D_THREAD_SAFE -I /usr/local/include/pthread/linuxthreads
857 -L/usr/local/lib -llthread -llgcc_r" --disable-shared
858 --with-embedded-server --with-innodb
859 * QNX Neutrino 6.2.1 i386 with gcc 2.95.3qnx-nto 20010315:
860 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
861 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
862 -fno-rtti" ./configure --prefix=/usr/local/mysql
863 --with-extra-charsets=complex --enable-thread-safe-client
864 --enable-local-infile --disable-shared
865
866 The following binaries are built on third-party systems kindly
867 provided to MySQL AB by other users. These are provided only as a
868 courtesy; MySQL AB does not have full control over these systems,
869 so we can provide only limited support for the binaries built on
870 them.
871 * SCO Unix 3.2v5.0.7 i386 with gcc 2.95.3:
872 CFLAGS="-O3 -mpentium" LDFLAGS=-static CXX=gcc CXXFLAGS="-O3 -mpentiu
873 m
874 -felide-constructors" ./configure --prefix=/usr/local/mysql
875 --with-extra-charsets=complex --enable-thread-safe-client
876 --enable-local-infile --with-named-z-libs=no --enable-thread-safe-cli
877 ent
878 --disable-shared
879 * SCO UnixWare 7.1.4 i386 with CC 3.2:
880 CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql
881 --with-extra-charsets=complex --enable-thread-safe-client
882 --enable-local-infile --with-named-z-libs=no --enable-thread-safe-cli
883 ent
884 --disable-shared --with-readline
885 * SCO OpenServer 6.0.0 i386 with CC 3.2:
886 CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql
887 --with-extra-charsets=complex --enable-thread-safe-client
888 --enable-local-infile --with-named-z-libs=no --enable-thread-safe-cli
889 ent
890 --disable-shared --with-readline
891 * Compaq Tru64 OSF/1 V5.1 732 alpha with cc/cxx (Compaq C
892 V6.3-029i / DIGITAL C++ V6.1-027):
893 CC="cc -pthread" CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline
894 speed -speculate all" CXX="cxx -pthread" CXXFLAGS="-O4 -ansi_alias
895 -fast -inline speed -speculate all -noexceptions -nortti" ./configure
896 --prefix=/usr/local/mysql --with-extra-charsets=complex
897 --enable-thread-safe-client --enable-local-infile
898 --with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-share
899 d
900 --with-mysqld-ldflags=-all-static
901 * SGI Irix 6.5 IP32 with gcc 3.0.1:
902 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXXFLAGS="-O3
903 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
904 -fno-rtti" ./configure --prefix=/usr/local/mysql
905 --with-extra-charsets=complex --enable-thread-safe-client
906 --enable-local-infile --disable-shared
907 * FreeBSD/sparc64 5.0 with gcc 3.2.1:
908 CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql
909 --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/b
910 in
911 --with-extra-charsets=complex --enable-thread-safe-client
912 --enable-local-infile --disable-shared --with-innodb
913
914 The following compile options have been used for binary packages
915 that MySQL AB provided in the past. These binaries no longer are
916 being updated, but the compile options are listed here for
917 reference purposes.
918 * Linux 2.2.xx SPARC with egcs 1.1.2:
919 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
920 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
921 -fno-rtti" ./configure --prefix=/usr/local/mysql
922 --with-extra-charsets=complex --enable-thread-safe-client
923 --enable-local-infile --enable-assembler --disable-shared
924 * Linux 2.2.x x86 with gcc 2.95.2:
925 CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro
926 -felide-constructors -fno-exceptions -fno-rtti" ./configure
927 --prefix=/usr/local/mysql --enable-assembler
928 --with-mysqld-ldflags=-all-static --disable-shared
929 --with-extra-charsets=complex
930 * SunOS 4.1.4 2 sun4c with gcc 2.7.2.1:
931 CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure
932 --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=comp
933 lex
934 --enable-assembler
935 * SunOS 5.5.1 (and above) sun4u with egcs 1.0.3a or 2.90.27 or
936 gcc 2.95.2 and newer:
937 CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors
938 -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql
939 --with-low-memory --with-extra-charsets=complex --enable-assembler
940 * SunOS 5.6 i86pc with gcc 2.8.1:
941 CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
942 --with-low-memory --with-extra-charsets=complex
943 * BSDI BSD/OS 3.1 i386 with gcc 2.7.2.1:
944 CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql
945 --with-extra-charsets=complex
946 * BSDI BSD/OS 2.1 i386 with gcc 2.7.2:
947 CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
948 --with-extra-charsets=complex
949 * AIX 4.2 with gcc 2.7.2.2:
950 CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
951 --with-extra-charsets=complex
952
953 2.4.4. How to Get MySQL
954
955 This section does not apply to MySQL Enterprise Server users.
956
957 Check our downloads page at http://dev.mysql.com/downloads/ for
958 information about the current version of MySQL and for downloading
959 instructions. For a complete up-to-date list of MySQL download
960 mirror sites, see http://dev.mysql.com/downloads/mirrors.html. You
961 can also find information there about becoming a MySQL mirror site
962 and how to report a bad or out-of-date mirror.
963
964 Our main mirror is located at http://mirrors.sunsite.dk/mysql/.
965
966 2.4.5. Verifying Package Integrity Using MD5 Checksums or GnuPG
967
968 This section does not apply to MySQL Enterprise Server users.
969
970 After you have downloaded the MySQL package that suits your needs
971 and before you attempt to install it, you should make sure that it
972 is intact and has not been tampered with. MySQL AB offers three
973 means of integrity checking:
974 * MD5 checksums
975 * Cryptographic signatures using GnuPG, the GNU Privacy Guard
976 * For RPM packages, the built-in RPM integrity verification
977 mechanism
978
979 The following sections describe how to use these methods.
980
981 If you notice that the MD5 checksum or GPG signatures do not
982 match, first try to download the respective package one more time,
983 perhaps from another mirror site. If you repeatedly cannot
984 successfully verify the integrity of the package, please notify us
985 about such incidents, including the full package name and the
986 download site you have been using, at webmaster@mysql.com or
987 build@mysql.com. Do not report downloading problems using the
988 bug-reporting system.
989
990 2.4.5.1. Verifying the MD5 Checksum
991
992 This section does not apply to MySQL Enterprise Server users.
993
994 After you have downloaded a MySQL package, you should make sure
995 that its MD5 checksum matches the one provided on the MySQL
996 download pages. Each package has an individual checksum that you
997 can verify with the following command, where package_name is the
998 name of the package you downloaded:
999 shell> md5sum package_name
1000
1001 Example:
1002 shell> md5sum mysql-standard-5.0.68-linux-i686.tar.gz
1003 aaab65abbec64d5e907dcd41b8699945 mysql-standard-5.0.68-linux-i686.ta
1004 r.gz
1005
1006 You should verify that the resulting checksum (the string of
1007 hexadecimal digits) matches the one displayed on the download page
1008 immediately below the respective package.
1009
1010 Note
1011
1012 Make sure to verify the checksum of the archive file (for example,
1013 the .zip or .tar.gz file) and not of the files that are contained
1014 inside of the archive.
1015
1016 Note that not all operating systems support the md5sum command. On
1017 some, it is simply called md5, and others do not ship it at all.
1018 On Linux, it is part of the GNU Text Utilities package, which is
1019 available for a wide range of platforms. You can download the
1020 source code from http://www.gnu.org/software/textutils/ as well.
1021 If you have OpenSSL installed, you can use the command openssl md5
1022 package_name instead. A Windows implementation of the md5 command
1023 line utility is available from http://www.fourmilab.ch/md5/.
1024 winMd5Sum is a graphical MD5 checking tool that can be obtained
1025 from http://www.nullriver.com/index/products/winmd5sum.
1026
1027 2.4.5.2. Signature Checking Using GnuPG
1028
1029 This section does not apply to MySQL Enterprise Server users.
1030
1031 Another method of verifying the integrity and authenticity of a
1032 package is to use cryptographic signatures. This is more reliable
1033 than using MD5 checksums, but requires more work.
1034
1035 At MySQL AB, we sign MySQL downloadable packages with GnuPG (GNU
1036 Privacy Guard). GnuPG is an Open Source alternative to the
1037 well-known Pretty Good Privacy (PGP) by Phil Zimmermann. See
1038 http://www.gnupg.org/ for more information about GnuPG and how to
1039 obtain and install it on your system. Most Linux distributions
1040 ship with GnuPG installed by default. For more information about
1041 GnuPG, see http://www.openpgp.org/.
1042
1043 To verify the signature for a specific package, you first need to
1044 obtain a copy of MySQL AB's public GPG build key, which you can
1045 download from http://www.keyserver.net/. The key that you want to
1046 obtain is named build@mysql.com. Alternatively, you can cut and
1047 paste the key directly from the following text:
1048 Key ID:
1049 pub 1024D/5072E1F5 2003-02-03
1050 MySQL Package signing key (www.mysql.com) <build@mysql.com>
1051 Fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
1052
1053 Public Key (ASCII-armored):
1054
1055 -----BEGIN PGP PUBLIC KEY BLOCK-----
1056 Version: GnuPG v1.0.6 (GNU/Linux)
1057 Comment: For info see http://www.gnupg.org
1058
1059 mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3
1060 RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ
1061 fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3
1062 BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW
1063 hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV
1064 K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE
1065 kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI
1066 QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep
1067 rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q7TXlTUUwgUGFj
1068 a2FnZSBzaWduaW5nIGtleSAod3d3Lm15c3FsLmNvbSkgPGJ1aWxkQG15c3FsLmNv
1069 bT6IXQQTEQIAHQUCPj6jDAUJCWYBgAULBwoDBAMVAwIDFgIBAheAAAoJEIxxjTtQ
1070 cuH1cY4AnilUwTXn8MatQOiG0a/bPxrvK/gCAJ4oinSNZRYTnblChwFaazt7PF3q
1071 zIhMBBMRAgAMBQI+PqPRBYMJZgC7AAoJEElQ4SqycpHyJOEAn1mxHijft00bKXvu
1072 cSo/pECUmppiAJ41M9MRVj5VcdH/KN/KjRtW6tHFPYhMBBMRAgAMBQI+QoIDBYMJ
1073 YiKJAAoJELb1zU3GuiQ/lpEAoIhpp6BozKI8p6eaabzF5MlJH58pAKCu/ROofK8J
1074 Eg2aLos+5zEYrB/LsrkCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWsEN/l
1075 xaZoJYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLmRDRi
1076 Rjd1DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hkAWzE
1077 7zaD5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkbf4fm
1078 Le11EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHbuE5p
1079 /1oIDznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+Lwqq
1080 a8CGrRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1ZaSaf
1081 anFvwFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGoTbOW
1082 I39EcyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev42Lmu
1083 QT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkKHt92
1084 6s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUOetdZ
1085 Whe70YGNPw1yjWJT1IhMBBgRAgAMBQI+PqMdBQkJZgGAAAoJEIxxjTtQcuH17p4A
1086 n3r1QpVC9yhnW2cSAjq+kr72GX0eAJ4295kl6NxYEuFApmr1+0uUq/SlsQ==
1087 =YJkx
1088 -----END PGP PUBLIC KEY BLOCK-----
1089
1090 To import the build key into your personal public GPG keyring, use
1091 gpg --import. For example, if you have saved the key in a file
1092 named mysql_pubkey.asc, the import command looks like this:
1093 shell> gpg --import mysql_pubkey.asc
1094
1095 After you have downloaded and imported the public build key,
1096 download your desired MySQL package and the corresponding
1097 signature, which also is available from the download page. The
1098 signature file has the same name as the distribution file with an
1099 .asc extension. For example:
1100 Distribution file mysql-standard-5.0.68-linux-i686.tar.gz
1101 Signature file mysql-standard-5.0.68-linux-i686.tar.gz.asc
1102
1103 Make sure that both files are stored in the same directory and
1104 then run the following command to verify the signature for the
1105 distribution file:
1106 shell> gpg --verify package_name.asc
1107
1108 Example:
1109 shell> gpg --verify mysql-standard-5.0.68-linux-i686.tar.gz.asc
1110 gpg: Signature made Tue 12 Jul 2005 23:35:41 EST using DSA key ID 507
1111 2E1F5
1112 gpg: Good signature from "MySQL Package signing key (www.mysql.com) <
1113 build@mysql.com>"
1114
1115 The Good signature message indicates that everything is all right.
1116 You can ignore any insecure memory warning you might obtain.
1117
1118 See the GPG documentation for more information on how to work with
1119 public keys.
1120
1121 2.4.5.3. Signature Checking Using RPM
1122
1123 This section does not apply to MySQL Enterprise Server users.
1124
1125 For RPM packages, there is no separate signature. RPM packages
1126 have a built-in GPG signature and MD5 checksum. You can verify a
1127 package by running the following command:
1128 shell> rpm --checksig package_name.rpm
1129
1130 Example:
1131 shell> rpm --checksig MySQL-server-5.0.68-0.glibc23.i386.rpm
1132 MySQL-server-5.0.68-0.glibc23.i386.rpm: md5 gpg OK
1133
1134 Note
1135
1136 If you are using RPM 4.1 and it shows the error (GPG) NOT OK
1137 (MISSING KEYS: GPG#5072e1f5) even though you have imported the
1138 MySQL public build key into your own GPG keyring, you need to
1139 import the key into the RPM keyring first. RPM 4.1 no longer uses
1140 your personal GPG keyring (or GPG itself). Rather, it maintains
1141 its own keyring because it is a system-wide application and a
1142 user's GPG public keyring is a user-specific file. To import the
1143 MySQL public key into the RPM keyring, first obtain the key as
1144 described in Section 2.4.5.2, "Signature Checking Using GnuPG."
1145 Then use rpm --import to import the key. For example, if you have
1146 saved the public key in a file named mysql_pubkey.asc, import it
1147 using this command:
1148 shell> rpm --import mysql_pubkey.asc
1149
1150 If you need to obtain the MySQL public key, see Section 2.4.5.2,
1151 "Signature Checking Using GnuPG."
1152
1153 2.4.6. Installation Layouts
1154
1155 This section describes the default layout of the directories
1156 created by installing binary or source distributions provided by
1157 MySQL AB. A distribution provided by another vendor might use a
1158 layout different from those shown here.
1159
1160 For MySQL 5.0 on Windows, the default installation directory is
1161 C:\Program Files\MySQL\MySQL Server 5.0. (Some Windows users
1162 prefer to install in C:\mysql, the directory that formerly was
1163 used as the default. However, the layout of the subdirectories
1164 remains the same.) The installation directory has the following
1165 subdirectories:
1166 Directory Contents
1167 bin Client programs and the mysqld server
1168 data Log files, databases
1169 Docs Manual in CHM format
1170 examples Example programs and scripts
1171 include Include (header) files
1172 lib Libraries
1173 scripts Utility scripts
1174 share Error message files
1175
1176 Installations created from MySQL AB's Linux RPM distributions
1177 result in files under the following system directories:
1178 Directory Contents
1179 /usr/bin Client programs and scripts
1180 /usr/sbin The mysqld server
1181 /var/lib/mysql Log files, databases
1182 /usr/share/info Manual in Info format
1183 /usr/share/man Unix man pages
1184 /usr/include/mysql Include (header) files
1185 /usr/lib/mysql Libraries
1186 /usr/share/mysql Error message and character set files
1187 /usr/share/sql-bench Benchmarks
1188
1189 On Unix, a tar file binary distribution is installed by unpacking
1190 it at the installation location you choose (typically
1191 /usr/local/mysql) and creates the following directories in that
1192 location:
1193 Directory Contents
1194 bin Client programs and the mysqld server
1195 data Log files, databases
1196 docs Manual in Info format
1197 man Unix manual pages
1198 include Include (header) files
1199 lib Libraries
1200 scripts mysql_install_db
1201 share/mysql Error message files
1202 sql-bench Benchmarks
1203
1204 A source distribution is installed after you configure and compile
1205 it. By default, the installation step installs files under
1206 /usr/local, in the following subdirectories:
1207 Directory Contents
1208 bin Client programs and scripts
1209 include/mysql Include (header) files
1210 Docs Manual in Info, CHM formats
1211 man Unix manual pages
1212 lib/mysql Libraries
1213 libexec The mysqld server
1214 share/mysql Error message files
1215 sql-bench Benchmarks and crash-me test
1216 var Databases and log files
1217
1218 Within its installation directory, the layout of a source
1219 installation differs from that of a binary installation in the
1220 following ways:
1221 * The mysqld server is installed in the libexec directory rather
1222 than in the bin directory.
1223 * The data directory is var rather than data.
1224 * mysql_install_db is installed in the bin directory rather than
1225 in the scripts directory.
1226 * The header file and library directories are include/mysql and
1227 lib/mysql rather than include and lib.
1228
1229 You can create your own binary installation from a compiled source
1230 distribution by executing the scripts/make_binary_distribution
1231 script from the top directory of the source distribution.
1232
1233 2.4.7. Standard MySQL Installation Using a Binary Distribution
1234
1235 This section does not apply to MySQL Enterprise Server users.
1236
1237 The next several sections cover the installation of MySQL on
1238 platforms where we offer packages using the native packaging
1239 format of the respective platform. (This is also known as
1240 performing a binary installation.) However, binary distributions
1241 of MySQL are available for many other platforms as well. See
1242 Section 2.4.14, "Installing MySQL from tar.gz Packages on Other
1243 Unix-Like Systems," for generic installation instructions for
1244 these packages that apply to all platforms.
1245
1246 See Section 2.4, "Installing MySQL Community Server," for more
1247 information on what other binary distributions are available and
1248 how to obtain them.
1249
1250 2.4.8. Installing MySQL on Windows
1251
1252 This section does not apply to MySQL Enterprise Server users.
1253
1254 A native Windows distribution of MySQL has been available from
1255 MySQL AB since version 3.21 and represents a sizable percentage of
1256 the daily downloads of MySQL. This section describes the process
1257 for installing MySQL on Windows.
1258
1259 Note
1260
1261 If you are upgrading MySQL from an existing installation older
1262 than MySQL 4.1.5, you must first perform the procedure described
1263 in Section 2.4.8.14, "Upgrading MySQL on Windows."
1264
1265 To run MySQL on Windows, you need the following:
1266 * A Windows operating system such as 2000, XP, Vista, or Windows
1267 Server 2003. Only 32-bit and 64-bit versions of Windows 2000
1268 and later are supported; however, 64-bit Windows Vista is not
1269 yet supported. Windows 95/98/ME and versions of Windows older
1270 than these are no longer supported.
1271 A Windows operating system permits you to run the MySQL server
1272 as a service. See Section 2.4.8.11, "Starting MySQL as a
1273 Windows Service."
1274 Generally, you should install MySQL on Windows using an
1275 account that has administrator rights. Otherwise, you may
1276 encounter problems with certain operations such as editing the
1277 PATH environment variable or accessing the Service Control
1278 Manager.
1279 * TCP/IP protocol support.
1280 * Enough space on the hard drive to unpack, install, and create
1281 the databases in accordance with your requirements (generally
1282 a minimum of 200 megabytes is recommended.)
1283
1284 For a list of limitations within the Windows version of MySQL, see
1285 Section F.7.3, "Windows Platform Limitations."
1286
1287 There may also be other requirements, depending on how you plan to
1288 use MySQL:
1289 * If you plan to connect to the MySQL server via ODBC, you need
1290 a Connector/ODBC driver. See Chapter 27, "Connectors."
1291 * If you need tables with a size larger than 4GB, install MySQL
1292 on an NTFS or newer filesystem. Don't forget to use MAX_ROWS
1293 and AVG_ROW_LENGTH when you create tables. See Section 12.1.5,
1294 "CREATE TABLE Syntax."
1295
1296 MySQL for Windows is available in several distribution formats:
1297 * Binary distributions are available that contain a setup
1298 program that installs everything you need so that you can
1299 start the server immediately. Another binary distribution
1300 format contains an archive that you simply unpack in the
1301 installation location and then configure yourself. For
1302 details, see Section 2.4.8.1, "Choosing An Installation
1303 Package."
1304 * The source distribution contains all the code and support
1305 files for building the executables using the Visual Studio
1306 compiler system.
1307
1308 Generally speaking, you should use a binary distribution that
1309 includes an installer. It is simpler to use than the others, and
1310 you need no additional tools to get MySQL up and running. The
1311 installer for the Windows version of MySQL, combined with a GUI
1312 Configuration Wizard, automatically installs MySQL, creates an
1313 option file, starts the server, and secures the default user
1314 accounts.
1315
1316 Caution
1317
1318 Using virus scanning software such as Norton/Symantec Anti-Virus
1319 on directories containing MySQL data and temporary tables can
1320 cause issues, both in terms of the performance of MySQL and the
1321 virus-scanning software mis-identifying the contents of the files
1322 as containing spam. This is because of the fingerprinting
1323 mechanism used by the virus scanning software, and the way in
1324 which MySQL rapidly updates different files, which may be
1325 identified as a potential security risk.
1326
1327 After installing MySQL Server, it is recommended that you disable
1328 virus scanning on main directory (datadir) being used to store
1329 your MySQL table data. There is usually a system built into the
1330 virus scanning software to allow certain directories to be
1331 specifically ignored during virus scanning.
1332
1333 In addition, by default, MySQL creates temporary files in the
1334 standard Windows temporary directory. To prevent the temporary
1335 files also being scanned, you should configure a separate
1336 temporary directory for MySQL temporary files and add this to the
1337 virus scanning exclusion list. To do this, add a configuration
1338 option for the tmpdir parameter to your my.ini configuration file.
1339 For more information, see Section 2.4.8.7, "Creating an Option
1340 File," and tmpdir.
1341
1342 The following section describes how to install MySQL on Windows
1343 using a binary distribution. To use an installation package that
1344 does not include an installer, follow the procedure described in
1345 Section 2.4.8.5, "Installing MySQL from a Noinstall Zip Archive."
1346 To install using a source distribution, see Section 2.4.15.6,
1347 "Installing MySQL from Source on Windows."
1348
1349 MySQL distributions for Windows can be downloaded from
1350 http://dev.mysql.com/downloads/. See Section 2.4.4, "How to Get
1351 MySQL."
1352
1353 2.4.8.1. Choosing An Installation Package
1354
1355 This section does not apply to MySQL Enterprise Server users.
1356
1357 For MySQL 5.0, there are three installation packages to choose
1358 from when installing MySQL on Windows:
1359 * The Essentials package. This package has a filename similar
1360 to mysql-essential-5.0.68-win32.msi and contains the minimum
1361 set of files needed to install MySQL on Windows, including the
1362 Configuration Wizard. This package does not include optional
1363 components such as the embedded server and benchmark suite.
1364 * The Complete package. This package has a filename similar to
1365 mysql-5.0.68-win32.zip and contains all files needed for a
1366 complete Windows installation, including the Configuration
1367 Wizard. This package includes optional components such as the
1368 embedded server and benchmark suite.
1369 * The no-install archive. This package has a filename similar
1370 to mysql-noinstall-5.0.68-win32.zip and contains all the files
1371 found in the Complete install package, with the exception of
1372 the Configuration Wizard. This package does not include an
1373 automated installer, and must be manually installed and
1374 configured.
1375
1376 The Essentials package is recommended for most users. It is
1377 provided as an .msi file for use with the Windows Installer. The
1378 Complete and Noinstall distributions are packaged as Zip archives.
1379 To use them, you must have a tool that can unpack .zip files.
1380
1381 Your choice of install package affects the installation process
1382 you must follow. If you choose to install either the Essentials or
1383 Complete install packages, see Section 2.4.8.2, "Installing MySQL
1384 with the Automated Installer." If you choose to install MySQL from
1385 the Noinstall archive, see Section 2.4.8.5, "Installing MySQL from
1386 a Noinstall Zip Archive."
1387
1388 2.4.8.2. Installing MySQL with the Automated Installer
1389
1390 New MySQL users can use the MySQL Installation Wizard and MySQL
1391 Configuration Wizard to install MySQL on Windows. These are
1392 designed to install and configure MySQL in such a way that new
1393 users can immediately get started using MySQL.
1394
1395 The MySQL Installation Wizard and MySQL Configuration Wizard are
1396 available in the Essentials and Complete install packages. They
1397 are recommended for most standard MySQL installations. Exceptions
1398 include users who need to install multiple instances of MySQL on a
1399 single server host and advanced users who want complete control of
1400 server configuration.
1401
1402 2.4.8.3. Using the MySQL Installation Wizard
1403
1404 2.4.8.3.1. Introduction to the Installation Wizard
1405
1406 MySQL Installation Wizard is an installer for the MySQL server
1407 that uses the latest installer technologies for Microsoft Windows.
1408 The MySQL Installation Wizard, in combination with the MySQL
1409 Configuration Wizard, allows a user to install and configure a
1410 MySQL server that is ready for use immediately after installation.
1411
1412 The MySQL Installation Wizard is the standard installer for all
1413 MySQL server distributions, version 4.1.5 and higher. Users of
1414 previous versions of MySQL need to shut down and remove their
1415 existing MySQL installations manually before installing MySQL with
1416 the MySQL Installation Wizard. See Section 2.4.8.3.7, "Upgrading
1417 MySQL with the Installation Wizard," for more information on
1418 upgrading from a previous version.
1419
1420 The Microsoft Windows Installer (MSI) is the standard for
1421 application installations on Windows 2000 and later versions. The
1422 MySQL Installation Wizard makes use of this technology to provide
1423 a smoother and more flexible installation process.
1424
1425 The Microsoft Windows Installer Engine was updated with the
1426 release of Windows XP; those using a previous version of Windows
1427 can reference this Microsoft Knowledge Base article
1428 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;292539)
1429 for information on upgrading to the latest version of the Windows
1430 Installer Engine.
1431
1432 In addition, Microsoft has introduced the WiX (Windows Installer
1433 XML) toolkit, which is the first highly acknowledged Open Source
1434 project from Microsoft. We have switched to WiX because it is an
1435 Open Source project and it allows us to handle the complete
1436 Windows installation process in a flexible manner using scripts.
1437
1438 Improving the MySQL Installation Wizard depends on the support and
1439 feedback of users. If you find that the MySQL Installation Wizard
1440 is lacking some feature important to you, or if you discover a
1441 bug, please report it in our bugs database using the instructions
1442 given in Section 1.7, "How to Report Bugs or Problems."
1443
1444 2.4.8.3.2. Downloading and Starting the MySQL Installation Wizard
1445
1446 MySQL installation packages can be downloaded from
1447 http://dev.mysql.com/downloads/. If the package you download is
1448 contained within a Zip archive, you need to extract the archive
1449 first.
1450
1451 Note
1452
1453 If you are installing on Windows Vista it is best to open a port
1454 for MySQL to use before beginning the installation. To do this,
1455 first ensure that you are logged in as an administrator, then go
1456 to the Control Panel and double-click the Windows Firewall icon.
1457 Choose the Allow a program through Windows Firewall option and
1458 click the Add port button. Enter MySQL into the Name text box and
1459 3306 (or other port of your choice) into the Port number text box.
1460 Also ensure that the TCP protocol radio button is selected. If you
1461 wish, you can also limit access to the MySQL server by choosing
1462 the Change scope button. Confirm your choices by clicking the OK
1463 button. If you do not open a port prior to installation, you
1464 cannot configure the MySQL server immediately after installation.
1465 Additionally, when running the MySQL Installation Wizard on
1466 Windows Vista, ensure that you are logged in as a user with
1467 administrative rights.
1468
1469 The process for starting the wizard depends on the contents of the
1470 installation package you download. If there is a setup.exe file
1471 present, double-click it to start the installation process. If
1472 there is an .msi file present, double-click it to start the
1473 installation process.
1474 MySQL Installer Main Screen (Windows)
1475
1476 2.4.8.3.3. Choosing an Installation Type
1477
1478 There are three installation types available: Typical, Complete,
1479 and Custom.
1480 MySQL Installer Setup type (Windows)
1481
1482 The Typical installation type installs the MySQL server, the mysql
1483 command-line client, and the command-line utilities. The
1484 command-line clients and utilities include mysqldump, myisamchk,
1485 and several other tools to help you manage the MySQL server.
1486
1487 The Complete installation type installs all components included in
1488 the installation package. The full installation package includes
1489 components such as the embedded server library, the benchmark
1490 suite, support scripts, and documentation.
1491
1492 The Custom installation type gives you complete control over which
1493 packages you wish to install and the installation path that is
1494 used. See Section 2.4.8.3.4, "The Custom Installation Dialog," for
1495 more information on performing a custom install.
1496
1497 If you choose the Typical or Complete installation types and click
1498 the Next button, you advance to the confirmation screen to verify
1499 your choices and begin the installation. If you choose the Custom
1500 installation type and click the Next button, you advance to the
1501 custom installation dialog, described in Section 2.4.8.3.4, "The
1502 Custom Installation Dialog."
1503
1504 2.4.8.3.4. The Custom Installation Dialog
1505
1506 This section does not apply to MySQL Enterprise Server users.
1507
1508 If you wish to change the installation path or the specific
1509 components that are installed by the MySQL Installation Wizard,
1510 choose the Custom installation type.
1511 MySQL Installer Custom Installation (Windows)
1512
1513 A tree view on the left side of the custom install dialog lists
1514 all available components. Components that are not installed have a
1515 red X icon; components that are installed have a gray icon. To
1516 change whether a component is installed, click on that component's
1517 icon and choose a new option from the drop-down list that appears.
1518
1519 You can change the default installation path by clicking the
1520 Change... button to the right of the displayed installation path.
1521
1522 After choosing your installation components and installation path,
1523 click the Next button to advance to the confirmation dialog.
1524
1525 2.4.8.3.5. The Confirmation Dialog
1526
1527 This section does not apply to MySQL Enterprise Server users.
1528
1529 Once you choose an installation type and optionally choose your
1530 installation components, you advance to the confirmation dialog.
1531 Your installation type and installation path are displayed for you
1532 to review.
1533 MySQL Installer Installation Summary (Windows)
1534
1535 To install MySQL if you are satisfied with your settings, click
1536 the Install button. To change your settings, click the Back
1537 button. To exit the MySQL Installation Wizard without installing
1538 MySQL, click the Cancel button.
1539
1540 After installation is complete, you have the option of registering
1541 with the MySQL web site. Registration gives you access to post in
1542 the MySQL forums at forums.mysql.com (http://forums.mysql.com),
1543 along with the ability to report bugs at bugs.mysql.com
1544 (http://bugs.mysql.com) and to subscribe to our newsletter. The
1545 final screen of the installer provides a summary of the
1546 installation and gives you the option to launch the MySQL
1547 Configuration Wizard, which you can use to create a configuration
1548 file, install the MySQL service, and configure security settings.
1549
1550 2.4.8.3.6. Changes Made by MySQL Installation Wizard
1551
1552 This section does not apply to MySQL Enterprise Server users.
1553
1554 Once you click the Install button, the MySQL Installation Wizard
1555 begins the installation process and makes certain changes to your
1556 system which are described in the sections that follow.
1557
1558 Changes to the Registry
1559
1560 The MySQL Installation Wizard creates one Windows registry key in
1561 a typical install situation, located in
1562 HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB.
1563
1564 The MySQL Installation Wizard creates a key named after the major
1565 version of the server that is being installed, such as MySQL
1566 Server 5.0. It contains two string values, Location and Version.
1567 The Location string contains the path to the installation
1568 directory. In a default installation it contains C:\Program
1569 Files\MySQL\MySQL Server 5.0\. The Version string contains the
1570 release number. For example, for an installation of MySQL Server
1571 5.0.68, the key contains a value of 5.0.68.
1572
1573 These registry keys are used to help external tools identify the
1574 installed location of the MySQL server, preventing a complete scan
1575 of the hard-disk to determine the installation path of the MySQL
1576 server. The registry keys are not required to run the server, and
1577 if you install MySQL using the noinstall Zip archive, the registry
1578 keys are not created.
1579
1580 Changes to the Start Menu
1581
1582 The MySQL Installation Wizard creates a new entry in the Windows
1583 Start menu under a common MySQL menu heading named after the major
1584 version of MySQL that you have installed. For example, if you
1585 install MySQL 5.0, the MySQL Installation Wizard creates a MySQL
1586 Server 5.0 section in the Start menu.
1587
1588 The following entries are created within the new Start menu
1589 section:
1590 * MySQL Command Line Client: This is a shortcut to the mysql
1591 command-line client and is configured to connect as the root
1592 user. The shortcut prompts for a root user password when you
1593 connect.
1594 * MySQL Server Instance Config Wizard: This is a shortcut to the
1595 MySQL Configuration Wizard. Use this shortcut to configure a
1596 newly installed server, or to reconfigure an existing server.
1597 * MySQL Documentation: This is a link to the MySQL server
1598 documentation that is stored locally in the MySQL server
1599 installation directory. This option is not available when the
1600 MySQL server is installed using the Essentials installation
1601 package.
1602
1603 Changes to the File System
1604
1605 The MySQL Installation Wizard by default installs the MySQL 5.0
1606 server to C:\Program Files\MySQL\MySQL Server 5.0, where Program
1607 Files is the default location for applications in your system, and
1608 5.0 is the major version of your MySQL server. This is the
1609 recommended location for the MySQL server, replacing the former
1610 default location C:\mysql.
1611
1612 By default, all MySQL applications are stored in a common
1613 directory at C:\Program Files\MySQL, where Program Files is the
1614 default location for applications in your Windows installation. A
1615 typical MySQL installation on a developer machine might look like
1616 this:
1617 C:\Program Files\MySQL\MySQL Server 5.0
1618 C:\Program Files\MySQL\MySQL Administrator 1.0
1619 C:\Program Files\MySQL\MySQL Query Browser 1.0
1620
1621 This approach makes it easier to manage and maintain all MySQL
1622 applications installed on a particular system.
1623
1624 2.4.8.3.7. Upgrading MySQL with the Installation Wizard
1625
1626 This section does not apply to MySQL Enterprise Server users.
1627
1628 The MySQL Installation Wizard can perform server upgrades
1629 automatically using the upgrade capabilities of MSI. That means
1630 you do not need to remove a previous installation manually before
1631 installing a new release. The installer automatically shuts down
1632 and removes the previous MySQL service before installing the new
1633 version.
1634
1635 Automatic upgrades are available only when upgrading between
1636 installations that have the same major and minor version numbers.
1637 For example, you can upgrade automatically from MySQL 4.1.5 to
1638 MySQL 4.1.6, but not from MySQL 4.1 to MySQL 5.0.
1639
1640 See Section 2.4.8.14, "Upgrading MySQL on Windows."
1641
1642 2.4.8.4. MySQL Server Configuration Wizard
1643
1644 The MySQL Server Configuration Wizard helps automate the process
1645 of configuring your server. It creates a custom MySQL
1646 configuration file (my.ini or my.cnf) by asking you a series of
1647 questions and then applying your responses to a template to
1648 generate the configuration file that is tuned to your
1649 installation.
1650
1651 The MySQL Server Configuration Wizard is included with the MySQL
1652 5.0 server. For Community Server users, the MySQL Server
1653 Configuration Wizard is available only for Windows. For Enterprise
1654 Server users, the MySQL Server Configuration Wizard is included as
1655 part of the standard Enterprise Installer.
1656
1657 The MySQL Server Configuration Wizard is to a large extent the
1658 result of feedback that MySQL AB has received from many users over
1659 a period of several years. However, if you find that it lacks some
1660 feature important to you, please report it in our bugs database
1661 using the instructions given in Section 1.7, "How to Report Bugs
1662 or Problems."
1663
1664 2.4.8.4.1. Starting the MySQL Server Configuration Wizard
1665
1666 The MySQL Server Configuration Wizard is normally started as part
1667 of the installation process. You should only need to run the MySQL
1668 Server Configuration Wizard again when you need to change the
1669 configuration parameters of your server.
1670
1671 If you chose not to open a port prior to installing MySQL on
1672 Windows Vista, you can choose to use the MySQL Server
1673 Configuration Wizard after installation. However, you must open a
1674 port in the Windows Firewall. To do this see the instructions
1675 given in Section 2.4.8.3.2, "Downloading and Starting the MySQL
1676 Installation Wizard." Rather than opening a port, you also have
1677 the option of adding MySQL as a program that bypasses the Windows
1678 Firewall. One or the other option is sufficient --- you need not
1679 do both. Additionally, when running the MySQL Server Configuration
1680 Wizard on Windows Vista ensure that you are logged in as a user
1681 with administrative rights.
1682 MySQL Server Configuration Wizard
1683
1684 2.4.8.4.1.1. The MySQL Server Configuration Wizard on Windows
1685
1686 You can launch the MySQL Configuration Wizard by clicking the
1687 MySQL Server Instance Config Wizard entry in the MySQL section of
1688 the Windows Start menu.
1689
1690 Alternatively, you can navigate to the bin directory of your MySQL
1691 installation and launch the MySQLInstanceConfig.exe file directly.
1692
1693 The MySQL Server Configuration Wizard places the my.ini file in
1694 the installation directory for the MySQL server. This helps
1695 associate configuration files with particular server instances.
1696
1697 To ensure that the MySQL server knows where to look for the my.ini
1698 file, an argument similar to this is passed to the MySQL server as
1699 part of the service installation:
1700 --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"
1701
1702 Here, C:\Program Files\MySQL\MySQL Server 5.0 is replaced with the
1703 installation path to the MySQL Server. The --defaults-file option
1704 instructs the MySQL server to read the specified file for
1705 configuration options when it starts.
1706
1707 Apart from making changes to the my.ini file by running the MySQL
1708 Server Configuration Wizard again, you can modify it by opening it
1709 with a text editor and making any necessary changes. You can also
1710 modify the server configuration with the MySQL Administrator
1711 (http://www.mysql.com/products/administrator/) utility. For more
1712 information about server configuration, see Section 5.1.2,
1713 "Command Options."
1714
1715 MySQL clients and utilities such as the mysql and mysqldump
1716 command-line clients are not able to locate the my.ini file
1717 located in the server installation directory. To configure the
1718 client and utility applications, create a new my.ini file in the
1719 Windows installation directory (for example, C:\WINDOWS).
1720
1721 Under Windows Server 2003, Windows Server 2000 and Windows XP,
1722 MySQL Server Configuration Wizard will configure MySQL to work as
1723 a Windows service. To start and stop MySQL you use the Services
1724 application that is supplied as part of the Windows Administrator
1725 Tools.
1726
1727 2.4.8.4.2. Choosing a Maintenance Option
1728
1729 If the MySQL Server Configuration Wizard detects an existing
1730 configuration file, you have the option of either reconfiguring
1731 your existing server, or removing the server instance by deleting
1732 the configuration file and stopping and removing the MySQL
1733 service.
1734
1735 To reconfigure an existing server, choose the Re-configure
1736 Instance option and click the Next button. Any existing
1737 configuration file is not overwritten, but renamed (within the
1738 same directory) using a timestamp (Windows) or sequential number
1739 (Linux). To remove the existing server instance, choose the Remove
1740 Instance option and click the Next button.
1741
1742 If you choose the Remove Instance option, you advance to a
1743 confirmation window. Click the Execute button. The MySQL Server
1744 Configuration Wizard stops and removes the MySQL service, and then
1745 deletes the configuration file. The server installation and its
1746 data folder are not removed.
1747
1748 If you choose the Re-configure Instance option, you advance to the
1749 Configuration Type dialog where you can choose the type of
1750 installation that you wish to configure.
1751
1752 2.4.8.4.3. Choosing a Configuration Type
1753
1754 When you start the MySQL Server Configuration Wizard for a new
1755 MySQL installation, or choose the Re-configure Instance option for
1756 an existing installation, you advance to the Configuration Type
1757 dialog.
1758 MySQL Server Configuration Wizard: Configuration Type
1759
1760 There are two configuration types available: Detailed
1761 Configuration and Standard Configuration. The Standard
1762 Configuration option is intended for new users who want to get
1763 started with MySQL quickly without having to make many decisions
1764 about server configuration. The Detailed Configuration option is
1765 intended for advanced users who want more fine-grained control
1766 over server configuration.
1767
1768 If you are new to MySQL and need a server configured as a
1769 single-user developer machine, the Standard Configuration should
1770 suit your needs. Choosing the Standard Configuration option causes
1771 the MySQL Configuration Wizard to set all configuration options
1772 automatically with the exception of Service Options and Security
1773 Options.
1774
1775 The Standard Configuration sets options that may be incompatible
1776 with systems where there are existing MySQL installations. If you
1777 have an existing MySQL installation on your system in addition to
1778 the installation you wish to configure, the Detailed Configuration
1779 option is recommended.
1780
1781 To complete the Standard Configuration, please refer to the
1782 sections on Service Options and Security Options in Section
1783 2.4.8.4.10, "The Service Options Dialog," and Section 2.4.8.4.11,
1784 "The Security Options Dialog," respectively.
1785
1786 2.4.8.4.4. The Server Type Dialog
1787
1788 There are three different server types available to choose from.
1789 The server type that you choose affects the decisions that the
1790 MySQL Server Configuration Wizard makes with regard to memory,
1791 disk, and processor usage.
1792 MySQL Server Configuration Wizard: Server Type
1793 * Developer Machine: Choose this option for a typical desktop
1794 workstation where MySQL is intended only for personal use. It
1795 is assumed that many other desktop applications are running.
1796 The MySQL server is configured to use minimal system
1797 resources.
1798 * Server Machine: Choose this option for a server machine where
1799 the MySQL server is running alongside other server
1800 applications such as FTP, email, and Web servers. The MySQL
1801 server is configured to use a moderate portion of the system
1802 resources.
1803 * Dedicated MySQL Server Machine: Choose this option for a
1804 server machine that is intended to run only the MySQL server.
1805 It is assumed that no other applications are running. The
1806 MySQL server is configured to use all available system
1807 resources.
1808
1809 Note
1810
1811 By selecting one of the preconfigured configurations, the values
1812 and settings of various options in your my.cnf or my.ini will be
1813 altered accordingly. The default values and options as described
1814 in the reference manual may therefore be different to the options
1815 and values that were created during the execution of the
1816 configuration wizard.
1817
1818 2.4.8.4.5. The Database Usage Dialog
1819
1820 The Database Usage dialog allows you to indicate the storage
1821 engines that you expect to use when creating MySQL tables. The
1822 option you choose determines whether the InnoDB storage engine is
1823 available and what percentage of the server resources are
1824 available to InnoDB.
1825 MySQL Server Configuration Wizard: Usage Dialog
1826 * Multifunctional Database: This option enables both the InnoDB
1827 and MyISAM storage engines and divides resources evenly
1828 between the two. This option is recommended for users who use
1829 both storage engines on a regular basis.
1830 * Transactional Database Only: This option enables both the
1831 InnoDB and MyISAM storage engines, but dedicates most server
1832 resources to the InnoDB storage engine. This option is
1833 recommended for users who use InnoDB almost exclusively and
1834 make only minimal use of MyISAM.
1835 * Non-Transactional Database Only: This option disables the
1836 InnoDB storage engine completely and dedicates all server
1837 resources to the MyISAM storage engine. This option is
1838 recommended for users who do not use InnoDB.
1839
1840 The Configuration Wizard uses a template to generate the server
1841 configuration file. The Database Usage dialog sets one of the
1842 following option strings:
1843 Multifunctional Database: MIXED
1844 Transactional Database Only: INNODB
1845 Non-Transactional Database Only: MYISAM
1846
1847 When these options are processed through the default template
1848 (my-template.ini) the result is:
1849 Multifunctional Database:
1850 default-storage-engine=InnoDB
1851 _myisam_pct=50
1852
1853 Transactional Database Only:
1854 default-storage-engine=InnoDB
1855 _myisam_pct=5
1856
1857 Non-Transactional Database Only:
1858 default-storage-engine=MyISAM
1859 _myisam_pct=100
1860 skip-innodb
1861
1862 The _myisam_pct value is used to calculate the percentage of
1863 resources dedicated to MyISAM. The remaining resources are
1864 allocated to InnoDB.
1865
1866 2.4.8.4.6. The InnoDB Tablespace Dialog
1867
1868 Some users may want to locate the InnoDB tablespace files in a
1869 different location than the MySQL server data directory. Placing
1870 the tablespace files in a separate location can be desirable if
1871 your system has a higher capacity or higher performance storage
1872 device available, such as a RAID storage system.
1873 MySQL Server Configuration Wizard: InnoDB Data Tablespace
1874
1875 To change the default location for the InnoDB tablespace files,
1876 choose a new drive from the drop-down list of drive letters and
1877 choose a new path from the drop-down list of paths. To create a
1878 custom path, click the ... button.
1879
1880 If you are modifying the configuration of an existing server, you
1881 must click the Modify button before you change the path. In this
1882 situation you must move the existing tablespace files to the new
1883 location manually before starting the server.
1884
1885 2.4.8.4.7. The Concurrent Connections Dialog
1886
1887 To prevent the server from running out of resources, it is
1888 important to limit the number of concurrent connections to the
1889 MySQL server that can be established. The Concurrent Connections
1890 dialog allows you to choose the expected usage of your server, and
1891 sets the limit for concurrent connections accordingly. It is also
1892 possible to set the concurrent connection limit manually.
1893 MySQL Server Configuration Wizard: Connections
1894 * Decision Support (DSS)/OLAP: Choose this option if your server
1895 does not require a large number of concurrent connections. The
1896 maximum number of connections is set at 100, with an average
1897 of 20 concurrent connections assumed.
1898 * Online Transaction Processing (OLTP): Choose this option if
1899 your server requires a large number of concurrent connections.
1900 The maximum number of connections is set at 500.
1901 * Manual Setting: Choose this option to set the maximum number
1902 of concurrent connections to the server manually. Choose the
1903 number of concurrent connections from the drop-down box
1904 provided, or enter the maximum number of connections into the
1905 drop-down box if the number you desire is not listed.
1906
1907 2.4.8.4.8. The Networking and Strict Mode Options Dialog
1908
1909 Use the Networking Options dialog to enable or disable TCP/IP
1910 networking and to configure the port number that is used to
1911 connect to the MySQL server.
1912 MySQL Server Configuration Wizard: Network Configuration
1913
1914 TCP/IP networking is enabled by default. To disable TCP/IP
1915 networking, uncheck the box next to the Enable TCP/IP Networking
1916 option.
1917
1918 Port 3306 is used by default. To change the port used to access
1919 MySQL, choose a new port number from the drop-down box or type a
1920 new port number directly into the drop-down box. If the port
1921 number you choose is in use, you are prompted to confirm your
1922 choice of port number.
1923
1924 Set the Server SQL Mode to either enable or disable strict mode.
1925 Enabling strict mode (default) makes MySQL behave more like other
1926 database management systems. If you run applications that rely on
1927 MySQL's old "forgiving" behavior, make sure to either adapt those
1928 applications or to disable strict mode. For more information about
1929 strict mode, see Section 5.1.7, "SQL Modes."
1930
1931 2.4.8.4.9. The Character Set Dialog
1932
1933 The MySQL server supports multiple character sets and it is
1934 possible to set a default server character set that is applied to
1935 all tables, columns, and databases unless overridden. Use the
1936 Character Set dialog to change the default character set of the
1937 MySQL server.
1938 MySQL Server Configuration Wizard: Character Set
1939 * Standard Character Set: Choose this option if you want to use
1940 latin1 as the default server character set. latin1 is used for
1941 English and many Western European languages.
1942 * Best Support For Multilingualism: Choose this option if you
1943 want to use utf8 as the default server character set. This is
1944 a Unicode character set that can store characters from many
1945 different languages.
1946 * Manual Selected Default Character Set / Collation: Choose this
1947 option if you want to pick the server's default character set
1948 manually. Choose the desired character set from the provided
1949 drop-down list.
1950
1951 2.4.8.4.10. The Service Options Dialog
1952
1953 This section does not apply to MySQL Community Server users.
1954
1955 On Windows platforms, the MySQL server can be installed as a
1956 Windows service. When installed this way, the MySQL server can be
1957 started automatically during system startup, and even restarted
1958 automatically by Windows in the event of a service failure.
1959
1960 The MySQL Server Configuration Wizard installs the MySQL server as
1961 a service by default, using the service name MySQL. If you do not
1962 wish to install the service, uncheck the box next to the Install
1963 As Windows Service option. You can change the service name by
1964 picking a new service name from the drop-down box provided or by
1965 entering a new service name into the drop-down box.
1966
1967 Note
1968
1969 Service names can include any legal character except forward (/)
1970 or backward (\) slashes, and must be less than 256 characters
1971 long.
1972
1973 Warning
1974
1975 If you are installing multiple versions of MySQL onto the same
1976 machine, you must choose a different service name for each version
1977 that you install. If you do not choose a different service for
1978 each installed version then the service manager information will
1979 be inconsitent and this will cause problems when you try to
1980 uninstall a previous version.
1981
1982 If you have already installed multiple versions using the same
1983 service name, you must manually edit the contents of the
1984 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servicesparameters
1985 within the Windows registry to update the association of the
1986 service name with the correct server version.
1987
1988 Typically, when installing multiple versions you create a service
1989 name based on the version information. For example, you might
1990 install MySQL 5.x as mysql5, or specific versions such as MySQL
1991 5.0.56 as mysql5056.
1992
1993 To install the MySQL server as a service but not have it started
1994 automatically at startup, uncheck the box next to the Launch the
1995 MySQL Server Automatically option.
1996
1997 2.4.8.4.11. The Security Options Dialog
1998
1999 It is strongly recommended that you set a root password for your
2000 MySQL server, and the MySQL Server Configuration Wizard requires
2001 by default that you do so. If you do not wish to set a root
2002 password, uncheck the box next to the Modify Security Settings
2003 option.
2004 MySQL Server Configuration Wizard: Security
2005
2006 To set the root password, enter the desired password into both the
2007 New root password and Confirm boxes. If you are reconfiguring an
2008 existing server, you need to enter the existing root password into
2009 the Current root password box.
2010
2011 To prevent root logins from across the network, check the box next
2012 to the Root may only connect from localhost option. This increases
2013 the security of your root account.
2014
2015 To create an anonymous user account, check the box next to the
2016 Create An Anonymous Account option. Creating an anonymous account
2017 can decrease server security and cause login and permission
2018 difficulties. For this reason, it is not recommended.
2019
2020 2.4.8.4.12. The Confirmation Dialog
2021
2022 The final dialog in the MySQL Server Configuration Wizard is the
2023 Confirmation Dialog. To start the configuration process, click the
2024 Execute button. To return to a previous dialog, click the Back
2025 button. To exit the MySQL Server Configuration Wizard without
2026 configuring the server, click the Cancel button.
2027 MySQL Server Configuration Wizard: Confirmation
2028
2029 After you click the Execute button, the MySQL Server Configuration
2030 Wizard performs a series of tasks and displays the progress
2031 onscreen as the tasks are performed.
2032
2033 The MySQL Server Configuration Wizard first determines
2034 configuration file options based on your choices using a template
2035 prepared by MySQL AB developers and engineers. This template is
2036 named my-template.ini and is located in your server installation
2037 directory.
2038
2039 The MySQL Configuration Wizard then writes these options to the
2040 corresponding configuration file.
2041
2042 If you chose to create a service for the MySQL server, the MySQL
2043 Server Configuration Wizard creates and starts the service. If you
2044 are reconfiguring an existing service, the MySQL Server
2045 Configuration Wizard restarts the service to apply your
2046 configuration changes.
2047
2048 If you chose to set a root password, the MySQL Configuration
2049 Wizard connects to the server, sets your new root password, and
2050 applies any other security settings you may have selected.
2051
2052 After the MySQL Server Configuration Wizard has completed its
2053 tasks, it displays a summary. Click the Finish button to exit the
2054 MySQL Server Configuration Wizard.
2055
2056 2.4.8.5. Installing MySQL from a Noinstall Zip Archive
2057
2058 This section does not apply to MySQL Enterprise Server users.
2059
2060 Users who are installing from the Noinstall package can use the
2061 instructions in this section to manually install MySQL. The
2062 process for installing MySQL from a Zip archive is as follows:
2063 1. Extract the archive to the desired install directory
2064 2. Create an option file
2065 3. Choose a MySQL server type
2066 4. Start the MySQL server
2067 5. Secure the default user accounts
2068
2069 This process is described in the sections that follow.
2070
2071 2.4.8.6. Extracting the Install Archive
2072
2073 This section does not apply to MySQL Enterprise Server users.
2074
2075 To install MySQL manually, do the following:
2076 1. If you are upgrading from a previous version please refer to
2077 Section 2.4.8.14, "Upgrading MySQL on Windows," before
2078 beginning the upgrade process.
2079 2. Make sure that you are logged in as a user with administrator
2080 privileges.
2081 3. Choose an installation location. Traditionally, the MySQL
2082 server is installed in C:\mysql. The MySQL Installation Wizard
2083 installs MySQL under C:\Program Files\MySQL. If you do not
2084 install MySQL at C:\mysql, you must specify the path to the
2085 install directory during startup or in an option file. See
2086 Section 2.4.8.7, "Creating an Option File."
2087 4. Extract the install archive to the chosen installation
2088 location using your preferred Zip archive tool. Some tools may
2089 extract the archive to a folder within your chosen
2090 installation location. If this occurs, you can move the
2091 contents of the subfolder into the chosen installation
2092 location.
2093
2094 2.4.8.7. Creating an Option File
2095
2096 If you need to specify startup options when you run the server,
2097 you can indicate them on the command line or place them in an
2098 option file. For options that are used every time the server
2099 starts, you may find it most convenient to use an option file to
2100 specify your MySQL configuration. This is particularly true under
2101 the following circumstances:
2102 * The installation or data directory locations are different
2103 from the default locations (C:\Program Files\MySQL\MySQL
2104 Server 5.0 and C:\Program Files\MySQL\MySQL Server 5.0\data).
2105 * You need to tune the server settings.
2106
2107 When the MySQL server starts on Windows, it looks for options in
2108 two files: the my.ini file in the Windows directory, and the
2109 C:\my.cnf file. The Windows directory typically is named something
2110 like C:\WINDOWS. You can determine its exact location from the
2111 value of the WINDIR environment variable using the following
2112 command:
2113 C:\> echo %WINDIR%
2114
2115 MySQL looks for options first in the my.ini file, and then in the
2116 my.cnf file. However, to avoid confusion, it's best if you use
2117 only one file. If your PC uses a boot loader where C: is not the
2118 boot drive, your only option is to use the my.ini file. Whichever
2119 option file you use, it must be a plain text file.
2120
2121 You can also make use of the example option files included with
2122 your MySQL distribution; see Section 4.2.3.2.2, "Preconfigured
2123 Option Files."
2124
2125 An option file can be created and modified with any text editor,
2126 such as Notepad. For example, if MySQL is installed in E:\mysql
2127 and the data directory is in E:\mydata\data, you can create an
2128 option file containing a [mysqld] section to specify values for
2129 the basedir and datadir parameters:
2130 [mysqld]
2131 # set basedir to your installation path
2132 basedir=E:/mysql
2133 # set datadir to the location of your data directory
2134 datadir=E:/mydata/data
2135
2136 Note that Windows pathnames are specified in option files using
2137 (forward) slashes rather than backslashes. If you do use
2138 backslashes, you must double them:
2139 [mysqld]
2140 # set basedir to your installation path
2141 basedir=E:\\mysql
2142 # set datadir to the location of your data directory
2143 datadir=E:\\mydata\\data
2144
2145 On Windows, the MySQL installer places the data directory directly
2146 under the directory where you install MySQL. If you would like to
2147 use a data directory in a different location, you should copy the
2148 entire contents of the data directory to the new location. For
2149 example, if MySQL is installed in C:\Program Files\MySQL\MySQL
2150 Server 5.0, the data directory is by default in C:\Program
2151 Files\MySQL\MySQL Server 5.0\data. If you want to use E:\mydata as
2152 the data directory instead, you must do two things:
2153 1. Move the entire data directory and all of its contents from
2154 C:\Program Files\MySQL\MySQL Server 5.0\data to E:\mydata.
2155 2. Use a --datadir option to specify the new data directory
2156 location each time you start the server.
2157
2158 2.4.8.8. Selecting a MySQL Server Type
2159
2160 This section does not apply to MySQL Enterprise Server users.
2161
2162 The following table shows the available servers for Windows in
2163 MySQL 5.0.
2164 Binary Description
2165 mysqld-nt Optimized binary with named-pipe support
2166 mysqld Optimized binary without named-pipe support
2167 mysqld-debug Like mysqld-nt, but compiled with full debugging and
2168 automatic memory allocation checking
2169
2170 All of the preceding binaries are optimized for modern Intel
2171 processors, but should work on any Intel i386-class or higher
2172 processor.
2173
2174 Each of the servers in a distribution support the same set of
2175 storage engines. The SHOW ENGINES statement displays which engines
2176 a given server supports.
2177
2178 All Windows MySQL 5.0 servers have support for symbolic linking of
2179 database directories.
2180
2181 MySQL supports TCP/IP on all Windows platforms. MySQL servers on
2182 Windows support named pipes as indicated in the following list.
2183 However, the default is to use TCP/IP regardless of platform.
2184 (Named pipes are slower than TCP/IP in many Windows
2185 configurations.)
2186
2187 Use of named pipes is subject to these conditions:
2188 * Named pipes are enabled only if you start the server with the
2189 --enable-named-pipe option. It is necessary to use this option
2190 explicitly because some users have experienced problems with
2191 shutting down the MySQL server when named pipes were used.
2192 * Named-pipe connections are allowed only by the mysqld-nt and
2193 mysqld-debug servers.
2194
2195 Note
2196
2197 Most of the examples in this manual use mysqld as the server name.
2198 If you choose to use a different server, such as mysqld-nt, make
2199 the appropriate substitutions in the commands that are shown in
2200 the examples.
2201
2202 2.4.8.9. Starting the Server for the First Time
2203
2204 This section gives a general overview of starting the MySQL
2205 server. The following sections provide more specific information
2206 for starting the MySQL server from the command line or as a
2207 Windows service.
2208
2209 The information here applies primarily if you installed MySQL
2210 using the Noinstall version, or if you wish to configure and test
2211 MySQL manually rather than with the GUI tools.
2212
2213 The examples in these sections assume that MySQL is installed
2214 under the default location of C:\Program Files\MySQL\MySQL Server
2215 5.0. Adjust the pathnames shown in the examples if you have MySQL
2216 installed in a different location.
2217
2218 Clients have two options. They can use TCP/IP, or they can use a
2219 named pipe if the server supports named-pipe connections.
2220
2221 MySQL for Windows also supports shared-memory connections if the
2222 server is started with the --shared-memory option. Clients can
2223 connect through shared memory by using the --protocol=MEMORY
2224 option.
2225
2226 For information about which server binary to run, see Section
2227 2.4.8.8, "Selecting a MySQL Server Type."
2228
2229 Testing is best done from a command prompt in a console window (or
2230 "DOS window"). In this way you can have the server display status
2231 messages in the window where they are easy to see. If something is
2232 wrong with your configuration, these messages make it easier for
2233 you to identify and fix any problems.
2234
2235 To start the server, enter this command:
2236 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --console
2237
2238 For a server that includes InnoDB support, you should see the
2239 messages similar to those following as it starts (the pathnames
2240 and sizes may differ):
2241 InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
2242 InnoDB: a new database to be created!
2243 InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
2244 InnoDB: Database physically writes the file full: wait...
2245 InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be creat
2246 ed
2247 InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
2248 InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be creat
2249 ed
2250 InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
2251 InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be creat
2252 ed
2253 InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
2254 InnoDB: Doublewrite buffer not found: creating new
2255 InnoDB: Doublewrite buffer created
2256 InnoDB: creating foreign key constraint system tables
2257 InnoDB: foreign key constraint system tables created
2258 011024 10:58:25 InnoDB: Started
2259
2260 When the server finishes its startup sequence, you should see
2261 something like this, which indicates that the server is ready to
2262 service client connections:
2263 mysqld: ready for connections
2264 Version: '5.0.68' socket: '' port: 3306
2265
2266 The server continues to write to the console any further
2267 diagnostic output it produces. You can open a new console window
2268 in which to run client programs.
2269
2270 If you omit the --console option, the server writes diagnostic
2271 output to the error log in the data directory (C:\Program
2272 Files\MySQL\MySQL Server 5.0\data by default). The error log is
2273 the file with the .err extension.
2274
2275 Note
2276
2277 The accounts that are listed in the MySQL grant tables initially
2278 have no passwords. After starting the server, you should set up
2279 passwords for them using the instructions in Section 2.4.16,
2280 "Post-Installation Setup and Testing."
2281
2282 2.4.8.10. Starting MySQL from the Windows Command Line
2283
2284 The MySQL server can be started manually from the command line.
2285 This can be done on any version of Windows.
2286
2287 To start the mysqld server from the command line, you should start
2288 a console window (or "DOS window") and enter this command:
2289 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld"
2290
2291 The path to mysqld may vary depending on the install location of
2292 MySQL on your system.
2293
2294 You can stop the MySQL server by executing this command:
2295 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root
2296 shutdown
2297
2298 Note
2299
2300 If the MySQL root user account has a password, you need to invoke
2301 mysqladmin with the -p option and supply the password when
2302 prompted.
2303
2304 This command invokes the MySQL administrative utility mysqladmin
2305 to connect to the server and tell it to shut down. The command
2306 connects as the MySQL root user, which is the default
2307 administrative account in the MySQL grant system. Note that users
2308 in the MySQL grant system are wholly independent from any login
2309 users under Windows.
2310
2311 If mysqld doesn't start, check the error log to see whether the
2312 server wrote any messages there to indicate the cause of the
2313 problem. The error log is located in the C:\Program
2314 Files\MySQL\MySQL Server 5.0\data directory. It is the file with a
2315 suffix of .err. You can also try to start the server as mysqld
2316 --console; in this case, you may get some useful information on
2317 the screen that may help solve the problem.
2318
2319 The last option is to start mysqld with the --standalone and
2320 --debug options. In this case, mysqld writes a log file
2321 C:\mysqld.trace that should contain the reason why mysqld doesn't
2322 start. See MySQL Internals: Porting
2323 (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
2324
2325 Use mysqld --verbose --help to display all the options that mysqld
2326 understands.
2327
2328 2.4.8.11. Starting MySQL as a Windows Service
2329
2330 On Windows, the recommended way to run MySQL is to install it as a
2331 Windows service, whereby MySQL starts and stops automatically when
2332 Windows starts and stops. A MySQL server installed as a service
2333 can also be controlled from the command line using NET commands,
2334 or with the graphical Services utility. Generally, to install
2335 MySQL as a Windows service you should be logged in using an
2336 account that has administrator rights.
2337
2338 The Services utility (the Windows Service Control Manager) can be
2339 found in the Windows Control Panel (under Administrative Tools on
2340 Windows 2000, XP, Vista, and Server 2003). To avoid conflicts, it
2341 is advisable to close the Services utility while performing server
2342 installation or removal operations from the command line.
2343
2344 Before installing MySQL as a Windows service, you should first
2345 stop the current server if it is running by using the following
2346 command:
2347 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin"
2348 -u root shutdown
2349
2350 Note
2351
2352 If the MySQL root user account has a password, you need to invoke
2353 mysqladmin with the -p option and supply the password when
2354 prompted.
2355
2356 This command invokes the MySQL administrative utility mysqladmin
2357 to connect to the server and tell it to shut down. The command
2358 connects as the MySQL root user, which is the default
2359 administrative account in the MySQL grant system. Note that users
2360 in the MySQL grant system are wholly independent from any login
2361 users under Windows.
2362
2363 Install the server as a service using this command:
2364 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --install
2365
2366 The service-installation command does not start the server.
2367 Instructions for that are given later in this section.
2368
2369 To make it easier to invoke MySQL programs, you can add the
2370 pathname of the MySQL bin directory to your Windows system PATH
2371 environment variable:
2372 * On the Windows desktop, right-click on the My Computer icon,
2373 and select Properties
2374 * Next select the Advanced tab from the System Properties menu
2375 that appears, and click the Environment Variables button.
2376 * Under System Variables, select Path, and then click the Edit
2377 button. The Edit System Variable dialogue should appear.
2378 * Place your cursor at the end of the text appearing in the
2379 space marked Variable Value. (Use the End key to ensure that
2380 your cursor is positioned at the very end of the text in this
2381 space.) Then enter the complete pathname of your MySQL bin
2382 directory (for example, C:\Program Files\MySQL\MySQL Server
2383 5.0\bin), Note that there should be a semicolon separating
2384 this path from any values present in this field. Dismiss this
2385 dialogue, and each dialogue in turn, by clicking OK until all
2386 of the dialogues that were opened have been dismissed. You
2387 should now be able to invoke any MySQL executable program by
2388 typing its name at the DOS prompt from any directory on the
2389 system, without having to supply the path. This includes the
2390 servers, the mysql client, and all MySQL command-line
2391 utilities such as mysqladmin and mysqldump.
2392 You should not add the MySQL bin directory to your Windows
2393 PATH if you are running multiple MySQL servers on the same
2394 machine.
2395
2396 Warning
2397
2398 You must exercise great care when editing your system PATH by
2399 hand; accidental deletion or modification of any portion of the
2400 existing PATH value can leave you with a malfunctioning or even
2401 unusable system.
2402
2403 The following additional arguments can be used in MySQL 5.0 when
2404 installing the service:
2405 * You can specify a service name immediately following the
2406 --install option. The default service name is MySQL.
2407 * If a service name is given, it can be followed by a single
2408 option. By convention, this should be
2409 --defaults-file=file_name to specify the name of an option
2410 file from which the server should read options when it starts.
2411 The use of a single option other than --defaults-file is
2412 possible but discouraged. --defaults-file is more flexible
2413 because it enables you to specify multiple startup options for
2414 the server by placing them in the named option file. Also, in
2415 MySQL 5.0, use of an option different from --defaults-file is
2416 not supported until 5.0.3.
2417 * As of MySQL 5.0.1, you can also specify a --local-service
2418 option following the service name. This causes the server to
2419 run using the LocalService Windows account that has limited
2420 system privileges. This account is available only for Windows
2421 XP or newer. If both --defaults-file and --local-service are
2422 given following the service name, they can be in any order.
2423
2424 For a MySQL server that is installed as a Windows service, the
2425 following rules determine the service name and option files that
2426 the server uses:
2427 * If the service-installation command specifies no service name
2428 or the default service name (MySQL) following the --install
2429 option, the server uses the a service name of MySQL and reads
2430 options from the [mysqld] group in the standard option files.
2431 * If the service-installation command specifies a service name
2432 other than MySQL following the --install option, the server
2433 uses that service name. It reads options from the [mysqld]
2434 group and the group that has the same name as the service in
2435 the standard option files. This allows you to use the [mysqld]
2436 group for options that should be used by all MySQL services,
2437 and an option group with the service name for use by the
2438 server installed with that service name.
2439 * If the service-installation command specifies a
2440 --defaults-file option after the service name, the server
2441 reads options only from the [mysqld] group of the named file
2442 and ignores the standard option files.
2443
2444 As a more complex example, consider the following command:
2445 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld"
2446 --install MySQL --defaults-file=C:\my-opts.cnf
2447
2448 Here, the default service name (MySQL) is given after the
2449 --install option. If no --defaults-file option had been given,
2450 this command would have the effect of causing the server to read
2451 the [mysqld] group from the standard option files. However,
2452 because the --defaults-file option is present, the server reads
2453 options from the [mysqld] option group, and only from the named
2454 file.
2455
2456 You can also specify options as Start parameters in the Windows
2457 Services utility before you start the MySQL service.
2458
2459 Once a MySQL server has been installed as a service, Windows
2460 starts the service automatically whenever Windows starts. The
2461 service also can be started immediately from the Services utility,
2462 or by using a NET START MySQL command. The NET command is not case
2463 sensitive.
2464
2465 When run as a service, mysqld has no access to a console window,
2466 so no messages can be seen there. If mysqld does not start, check
2467 the error log to see whether the server wrote any messages there
2468 to indicate the cause of the problem. The error log is located in
2469 the MySQL data directory (for example, C:\Program
2470 Files\MySQL\MySQL Server 5.0\data). It is the file with a suffix
2471 of .err.
2472
2473 When a MySQL server has been installed as a service, and the
2474 service is running, Windows stops the service automatically when
2475 Windows shuts down. The server also can be stopped manually by
2476 using the Services utility, the NET STOP MySQL command, or the
2477 mysqladmin shutdown command.
2478
2479 You also have the choice of installing the server as a manual
2480 service if you do not wish for the service to be started
2481 automatically during the boot process. To do this, use the
2482 --install-manual option rather than the --install option:
2483 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --install-m
2484 anual
2485
2486 To remove a server that is installed as a service, first stop it
2487 if it is running by executing NET STOP MySQL. Then use the
2488 --remove option to remove it:
2489 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --remove
2490
2491 If mysqld is not running as a service, you can start it from the
2492 command line. For instructions, see Section 2.4.8.10, "Starting
2493 MySQL from the Windows Command Line."
2494
2495 Please see Section 2.4.8.13, "Troubleshooting a MySQL Installation
2496 Under Windows," if you encounter difficulties during installation.
2497
2498 2.4.8.12. Testing The MySQL Installation
2499
2500 You can test whether the MySQL server is working by executing any
2501 of the following commands:
2502 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlshow"
2503 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlshow" -u root
2504 mysql
2505 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" version
2506 status proc
2507 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql" test
2508
2509 If mysqld is slow to respond to TCP/IP connections from client
2510 programs, there is probably a problem with your DNS. In this case,
2511 start mysqld with the --skip-name-resolve option and use only
2512 localhost and IP numbers in the Host column of the MySQL grant
2513 tables.
2514
2515 You can force a MySQL client to use a named-pipe connection rather
2516 than TCP/IP by specifying the --pipe or --protocol=PIPE option, or
2517 by specifying . (period) as the host name. Use the --socket option
2518 to specify the name of the pipe if you do not want to use the
2519 default pipe name.
2520
2521 Note that if you have set a password for the root account, deleted
2522 the anonymous account, or created a new user account, then you
2523 must use the appropriate -u and -p options with the commands shown
2524 above in order to connect with the MySQL Server. See Section
2525 4.2.2, "Connecting to the MySQL Server."
2526
2527 For more information about mysqlshow, see Section 4.5.6,
2528 "mysqlshow --- Display Database, Table, and Column Information."
2529
2530 2.4.8.13. Troubleshooting a MySQL Installation Under Windows
2531
2532 When installing and running MySQL for the first time, you may
2533 encounter certain errors that prevent the MySQL server from
2534 starting. The purpose of this section is to help you diagnose and
2535 correct some of these errors.
2536
2537 Your first resource when troubleshooting server issues is the
2538 error log. The MySQL server uses the error log to record
2539 information relevant to the error that prevents the server from
2540 starting. The error log is located in the data directory specified
2541 in your my.ini file. The default data directory location is
2542 C:\Program Files\MySQL\MySQL Server 5.0\data. See Section 5.2.1,
2543 "The Error Log."
2544
2545 Another source of information regarding possible errors is the
2546 console messages displayed when the MySQL service is starting. Use
2547 the NET START MySQL command from the command line after installing
2548 mysqld as a service to see any error messages regarding the
2549 starting of the MySQL server as a service. See Section 2.4.8.11,
2550 "Starting MySQL as a Windows Service."
2551
2552 The following examples show other common error messages you may
2553 encounter when installing MySQL and starting the server for the
2554 first time:
2555 * If the MySQL server cannot find the mysql privileges database
2556 or other critical files, you may see these messages:
2557 System error 1067 has occurred.
2558 Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't
2559 exist
2560 These messages often occur when the MySQL base or data
2561 directories are installed in different locations than the
2562 default locations (C:\Program Files\MySQL\MySQL Server 5.0 and
2563 C:\Program Files\MySQL\MySQL Server 5.0\data, respectively).
2564 This situation may occur when MySQL is upgraded and installed
2565 to a new location, but the configuration file is not updated
2566 to reflect the new location. In addition, there may be old and
2567 new configuration files that conflict. Be sure to delete or
2568 rename any old configuration files when upgrading MySQL.
2569 If you have installed MySQL to a directory other than
2570 C:\Program Files\MySQL\MySQL Server 5.0, you need to ensure
2571 that the MySQL server is aware of this through the use of a
2572 configuration (my.ini) file. The my.ini file needs to be
2573 located in your Windows directory, typically C:\WINDOWS. You
2574 can determine its exact location from the value of the WINDIR
2575 environment variable by issuing the following command from the
2576 command prompt:
2577 C:\> echo %WINDIR%
2578 An option file can be created and modified with any text
2579 editor, such as Notepad. For example, if MySQL is installed in
2580 E:\mysql and the data directory is D:\MySQLdata, you can
2581 create the option file and set up a [mysqld] section to
2582 specify values for the basedir and datadir parameters:
2583 [mysqld]
2584 # set basedir to your installation path
2585 basedir=E:/mysql
2586 # set datadir to the location of your data directory
2587 datadir=D:/MySQLdata
2588 Note that Windows pathnames are specified in option files
2589 using (forward) slashes rather than backslashes. If you do use
2590 backslashes, you must double them:
2591 [mysqld]
2592 # set basedir to your installation path
2593 basedir=C:\\Program Files\\MySQL\\MySQL Server 5.0
2594 # set datadir to the location of your data directory
2595 datadir=D:\\MySQLdata
2596 MySQL Enterprise For expert advice on the start-up options
2597 appropriate to your circumstances, subscribe to the MySQL
2598 Enterprise Monitor. For more information, see
2599 http://www.mysql.com/products/enterprise/advisors.html.
2600 If you change the datadir value in your MySQL configuration
2601 file, you must move the contents of the existing MySQL data
2602 directory before restarting the MySQL server.
2603 See Section 2.4.8.7, "Creating an Option File."
2604 * If you reinstall or upgrade MySQL without first stopping and
2605 removing the existing MySQL service and install MySQL using
2606 the MySQL Configuration Wizard, you may see this error:
2607 Error: Cannot create Windows service for MySql. Error: 0
2608 This occurs when the Configuration Wizard tries to install the
2609 service and finds an existing service with the same name.
2610 One solution to this problem is to choose a service name other
2611 than mysql when using the configuration wizard. This allows
2612 the new service to be installed correctly, but leaves the
2613 outdated service in place. Although this is harmless, it is
2614 best to remove old services that are no longer in use.
2615 To permanently remove the old mysql service, execute the
2616 following command as a user with administrative privileges, on
2617 the command-line:
2618 C:\> sc delete mysql
2619 [SC] DeleteService SUCCESS
2620 If the sc utility is not available for your version of
2621 Windows, download the delsrv utility from
2622 http://www.microsoft.com/windows2000/techinfo/reskit/tools/exi
2623 sting/delsrv-o.asp and use the delsrv mysql syntax.
2624
2625 2.4.8.14. Upgrading MySQL on Windows
2626
2627 This section does not apply to MySQL Enterprise Server users.
2628
2629 This section lists some of the steps you should take when
2630 upgrading MySQL on Windows.
2631 1. Review Section 2.4.17, "Upgrading MySQL," for additional
2632 information on upgrading MySQL that is not specific to
2633 Windows.
2634 2. You should always back up your current MySQL installation
2635 before performing an upgrade. See Section 6.1, "Database
2636 Backups."
2637 3. Download the latest Windows distribution of MySQL from
2638 http://dev.mysql.com/downloads/.
2639 4. Before upgrading MySQL, you must stop the server. If the
2640 server is installed as a service, stop the service with the
2641 following command from the command prompt:
2642 C:\> NET STOP MySQL
2643 If you are not running the MySQL server as a service, use the
2644 following command to stop it:
2645 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root
2646 shutdown
2647
2648 Note
2649 If the MySQL root user account has a password, you need to
2650 invoke mysqladmin with the -p option and supply the password
2651 when prompted.
2652 5. When upgrading to MySQL 5.0 from a version previous to 4.1.5,
2653 or when upgrading from a version of MySQL installed from a Zip
2654 archive to a version of MySQL installed with the MySQL
2655 Installation Wizard, you must manually remove the previous
2656 installation and MySQL service (if the server is installed as
2657 a service).
2658 To remove the MySQL service, use the following command:
2659 C:\> C:\mysql\bin\mysqld --remove
2660 If you do not remove the existing service, the MySQL
2661 Installation Wizard may fail to properly install the new MySQL
2662 service.
2663 6. If you are using the MySQL Installation Wizard, start the
2664 wizard as described in Section 2.4.8.3, "Using the MySQL
2665 Installation Wizard."
2666 7. If you are installing MySQL from a Zip archive, extract the
2667 archive. You may either overwrite your existing MySQL
2668 installation (usually located at C:\mysql), or install it into
2669 a different directory, such as C:\mysql5. Overwriting the
2670 existing installation is recommended.
2671 8. If you were running MySQL as a Windows service and you had to
2672 remove the service earlier in this procedure, reinstall the
2673 service. (See Section 2.4.8.11, "Starting MySQL as a Windows
2674 Service.")
2675 9. Restart the server. For example, use NET START MySQL if you
2676 run MySQL as a service, or invoke mysqld directly otherwise.
2677 10. If you encounter errors, see Section 2.4.8.13,
2678 "Troubleshooting a MySQL Installation Under Windows."
2679
2680 2.4.8.15. MySQL on Windows Compared to MySQL on Unix
2681
2682 MySQL for Windows has proven itself to be very stable. The Windows
2683 version of MySQL has the same features as the corresponding Unix
2684 version, with the following exceptions:
2685 * Limited number of ports
2686 Windows systems have about 4,000 ports available for client
2687 connections, and after a connection on a port closes, it takes
2688 two to four minutes before the port can be reused. In
2689 situations where clients connect to and disconnect from the
2690 server at a high rate, it is possible for all available ports
2691 to be used up before closed ports become available again. If
2692 this happens, the MySQL server appears to be unresponsive even
2693 though it is running. Note that ports may be used by other
2694 applications running on the machine as well, in which case the
2695 number of ports available to MySQL is lower.
2696 For more information about this problem, see
2697 http://support.microsoft.com/default.aspx?scid=kb;en-us;196271
2698 .
2699 * Concurrent reads
2700 MySQL depends on the pread() and pwrite() system calls to be
2701 able to mix INSERT and SELECT. Currently, we use mutexes to
2702 emulate pread() and pwrite(). We intend to replace the file
2703 level interface with a virtual interface in the future so that
2704 we can use the readfile()/writefile() interface to get more
2705 speed. The current implementation limits the number of open
2706 files that MySQL 5.0 can use to 2,048, which means that you
2707 cannot run as many concurrent threads on Windows as on Unix.
2708 * Blocking read
2709 MySQL uses a blocking read for each connection. That has the
2710 following implications if named-pipe connections are enabled:
2711 + A connection is not disconnected automatically after
2712 eight hours, as happens with the Unix version of MySQL.
2713 + If a connection hangs, it is not possible to break it
2714 without killing MySQL.
2715 + mysqladmin kill does not work on a sleeping connection.
2716 + mysqladmin shutdown cannot abort as long as there are
2717 sleeping connections.
2718 We plan to fix this problem in the future.
2719 * ALTER TABLE
2720 While you are executing an ALTER TABLE statement, the table is
2721 locked from being used by other threads. This has to do with
2722 the fact that on Windows, you can't delete a file that is in
2723 use by another thread. In the future, we may find some way to
2724 work around this problem.
2725 * DROP TABLE
2726 DROP TABLE on a table that is in use by a MERGE table does not
2727 work on Windows because the MERGE handler does the table
2728 mapping hidden from the upper layer of MySQL. Because Windows
2729 does not allow dropping files that are open, you first must
2730 flush all MERGE tables (with FLUSH TABLES) or drop the MERGE
2731 table before dropping the table.
2732 * DATA DIRECTORY and INDEX DIRECTORY
2733 The DATA DIRECTORY and INDEX DIRECTORY options for CREATE
2734 TABLE are ignored on Windows, because Windows doesn't support
2735 symbolic links. These options also are ignored on systems that
2736 have a non-functional realpath() call.
2737 * DROP DATABASE
2738 You cannot drop a database that is in use by some thread.
2739 * Case-insensitive names
2740 Filenames are not case sensitive on Windows, so MySQL database
2741 and table names are also not case sensitive on Windows. The
2742 only restriction is that database and table names must be
2743 specified using the same case throughout a given statement.
2744 See Section 8.2.2, "Identifier Case Sensitivity."
2745 * The "\" pathname separator character
2746 Pathname components in Windows are separated by the "\"
2747 character, which is also the escape character in MySQL. If you
2748 are using LOAD DATA INFILE or SELECT ... INTO OUTFILE, use
2749 Unix-style filenames with "/" characters:
2750 mysql> LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr;
2751 mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
2752 Alternatively, you must double the "\" character:
2753 mysql> LOAD DATA INFILE 'C:\\tmp\\skr.txt' INTO TABLE skr;
2754 mysql> SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
2755 * Problems with pipes
2756 Pipes do not work reliably from the Windows command-line
2757 prompt. If the pipe includes the character ^Z / CHAR(24),
2758 Windows thinks that it has encountered end-of-file and aborts
2759 the program.
2760 This is mainly a problem when you try to apply a binary log as
2761 follows:
2762 C:\> mysqlbinlog binary_log_file | mysql --user=root
2763 If you have a problem applying the log and suspect that it is
2764 because of a ^Z / CHAR(24) character, you can use the
2765 following workaround:
2766 C:\> mysqlbinlog binary_log_file --result-file=/tmp/bin.sql
2767 C:\> mysql --user=root --execute "source /tmp/bin.sql"
2768 The latter command also can be used to reliably read in any
2769 SQL file that may contain binary data.
2770 * Access denied for user error
2771 If MySQL cannot resolve your hostname properly, you may get
2772 the following error when you attempt to run a MySQL client
2773 program to connect to a server running on the same machine:
2774 Access denied for user 'some_user'@'unknown'
2775 to database 'mysql'
2776 To fix this problem, you should create a file named
2777 \windows\hosts containing the following information:
2778 127.0.0.1 localhost
2779
2780 Here are some open issues for anyone who might want to help us
2781 improve MySQL on Windows:
2782 * Add macros to use the faster thread-safe increment/decrement
2783 methods provided by Windows.
2784
2785 2.4.9. Installing MySQL from RPM Packages on Linux
2786
2787 The recommended way to install MySQL on RPM-based Linux
2788 distributions is by using the RPM packages. The RPMs provided by
2789 MySQL AB to the community should work on all versions of Linux
2790 that support RPM packages and use glibc 2.3. MySQL AB also
2791 provides RPMs with binaries that are statically linked to a
2792 patched version of glibc 2.2, but only for the x86 (32-bit)
2793 architecture. To obtain RPM packages, see Section 2.4.4, "How to
2794 Get MySQL."
2795
2796 For non-RPM Linux distributions, you can install MySQL using a
2797 .tar.gz package. See Section 2.4.14, "Installing MySQL from tar.gz
2798 Packages on Other Unix-Like Systems."
2799
2800 MySQL AB does provide some platform-specific RPMs; the difference
2801 between a platform-specific RPM and a generic RPM is that a
2802 platform-specific RPM is built on the targeted platform and is
2803 linked dynamically whereas a generic RPM is linked statically with
2804 LinuxThreads.
2805
2806 Note
2807
2808 RPM distributions of MySQL often are provided by other vendors. Be
2809 aware that they may differ in features and capabilities from those
2810 built by MySQL AB, and that the instructions in this manual do not
2811 necessarily apply to installing them. The vendor's instructions
2812 should be consulted instead.
2813
2814 If you have problems with an RPM file (for example, if you receive
2815 the error Sorry, the host 'xxxx' could not be looked up), see
2816 Section 2.4.19.1.2, "Linux Binary Distribution Notes."
2817
2818 In most cases, you need to install only the MySQL-server and
2819 MySQL-client packages to get a functional MySQL installation. The
2820 other packages are not required for a standard installation.
2821
2822 For upgrades, if your installation was originally produced by
2823 installing multiple RPM packages, it is best to upgrade all the
2824 packages, not just some. For example, if you previously installed
2825 the server and client RPMs, do not upgrade just the server RPM.
2826
2827 If you get a dependency failure when trying to install MySQL
2828 packages (for example, error: removing these packages would break
2829 dependencies: libmysqlclient.so.10 is needed by ...), you should
2830 also install the MySQL-shared-compat package, which includes both
2831 the shared libraries for backward compatibility
2832 (libmysqlclient.so.12 for MySQL 4.0 and libmysqlclient.so.10 for
2833 MySQL 3.23).
2834
2835 Some Linux distributions still ship with MySQL 3.23 and they
2836 usually link applications dynamically to save disk space. If these
2837 shared libraries are in a separate package (for example,
2838 MySQL-shared), it is sufficient to simply leave this package
2839 installed and just upgrade the MySQL server and client packages
2840 (which are statically linked and do not depend on the shared
2841 libraries). For distributions that include the shared libraries in
2842 the same package as the MySQL server (for example, Red Hat Linux),
2843 you could either install our 3.23 MySQL-shared RPM, or use the
2844 MySQL-shared-compat package instead. (Do not install both.)
2845
2846 The RPM packages shown in the following list are available. The
2847 names shown here use a suffix of .glibc23.i386.rpm, but particular
2848 packages can have different suffixes, as described later. Packages
2849 that have community in the names are Community Server builds,
2850 available from MySQL 5.0.27 on.
2851 * MySQL-server-VERSION.glibc23.i386.rpm,
2852 MySQL-server-community-VERSION.glibc23.i386.rpm
2853 The MySQL server. You need this unless you only want to
2854 connect to a MySQL server running on another machine.
2855 * MySQL-client-VERSION.glibc23.i386.rpm,
2856 MySQL-client-community-VERSION.glibc23.i386.rpm
2857 The standard MySQL client programs. You probably always want
2858 to install this package.
2859 * MySQL-bench-VERSION.glibc23.i386.rpm
2860 Tests and benchmarks. Requires Perl and the DBI and DBD::mysql
2861 modules.
2862 * MySQL-devel-VERSION.glibc23.i386.rpm,
2863 MySQL-devel-community-VERSION.glibc23.i386.rpm
2864 The libraries and include files that are needed if you want to
2865 compile other MySQL clients, such as the Perl modules.
2866 * MySQL-debuginfo-VERSION.glibc23.i386.rpm,
2867 MySQL-community-debuginfo-VERSION.glibc23.i386.rpm
2868 This package contains debugging information. debuginfo RPMs
2869 are never needed to use MySQL software; this is true both for
2870 the server and for client programs. However, they contain
2871 additional information that might be needed by a debugger to
2872 analyze a crash.
2873 * MySQL-shared-VERSION.glibc23.i386.rpm,
2874 MySQL-shared-community-VERSION.glibc23.i386.rpm
2875 This package contains the shared libraries
2876 (libmysqlclient.so*) that certain languages and applications
2877 need to dynamically load and use MySQL. It contains
2878 single-threaded and thread-safe libraries. If you install this
2879 package, do not install the MySQL-shared-compat package.
2880 * MySQL-shared-compat-VERSION.glibc23.i386.rpm
2881 This package includes the shared libraries for MySQL 3.23,
2882 4.0, 4.1, and 5.0. It contains single-threaded and thread-safe
2883 libraries. Install this package instead of MySQL-shared if you
2884 have applications installed that are dynamically linked
2885 against older versions of MySQL but you want to upgrade to the
2886 current version without breaking the library dependencies.
2887 * MySQL-clustermanagement-communityVERSION.glibc23.i386.rpm,
2888 MySQL-clusterstorage-communityVERSION.glibc23.i386.rpm,
2889 MySQL-clustertools-communityVERSION.glibc23.i386.rpm,
2890 MySQL-clusterextra-communityVERSION.glibc23.i386.rpm
2891 Packages that contain additional files for MySQL Cluster
2892 installations. These are platform-specific RPMs, in contrast
2893 to the platform-independent ndb-xxx RPMs.
2894
2895 Note
2896 The MySQL-clustertools RPM requires a working installation of
2897 perl and the DBI and HTML::Template packages. See Section
2898 2.4.21, "Perl Installation Notes," and Section 19.10.14,
2899 "ndb_size.pl --- NDBCLUSTER Size Requirement Estimator," for
2900 more information.
2901 * MySQL-ndb-management-VERSION.glibc23.i386.rpm,
2902 MySQL-ndb-storage-VERSION.glibc23.i386.rpm,
2903 MySQL-ndb-tools-VERSION.glibc23.i386.rpm,
2904 MySQL-ndb-extra-VERSION.glibc23.i386.rpm
2905 Packages that contain additional files for MySQL Cluster
2906 installations. These are platform-independent RPMs, in
2907 contrast to the platform-specific clusterxxx-community RPMs.
2908 * MySQL-test-community-VERSION.glibc23.i386.rpm
2909 This package includes the MySQL test suite.
2910 * MySQL-VERSION.src.rpm
2911 This contains the source code for all of the previous
2912 packages. It can also be used to rebuild the RPMs on other
2913 architectures (for example, Alpha or SPARC).
2914
2915 The suffix of RPM package names (following the VERSION value) has
2916 the following syntax:
2917 [.PLATFORM].CPU.rpm
2918
2919 The PLATFORM and CPU values indicate the type of system for which
2920 the package is built. PLATFORM, if present, indicates the
2921 platform, and CPU indicates the processor type or family.
2922
2923 If the PLATFORM value is missing (for example,
2924 MySQL-server-VERSION.i386.rpm), the package is statically linked
2925 against a version of glibc 2.2 that has been patched to handle
2926 larger numbers of threads with larger stack sizes than the stock
2927 library.
2928
2929 If PLATFORM is present, the package is dynamically linked against
2930 glibc 2.3 and the PLATFORM value indicates whether the package is
2931 platform independent or intended for a specific platform:
2932 glibc23 Platform independent, should run on any Linux distribution
2933 that supports glibc 2.3
2934 rhel3, rhel4 Red Hat Enterprise Linux 3 or 4
2935 sles9, sles10 SuSE Linux Enterprise Server 9 or 10
2936
2937 The CPU value indicates the processor type or family for which the
2938 package is built:
2939 i386 x86 processor, 386 and up
2940 i586 x86 processor, Pentium and up
2941 x86_64 64-bit x86 processor
2942 ia64 Itanium (IA-64) processor
2943
2944 To see all files in an RPM package (for example, a MySQL-server
2945 RPM), run a command like this:
2946 shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm
2947
2948 To perform a standard minimal installation, install the server and
2949 client RPMs:
2950 shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm
2951 shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
2952
2953 To install only the client programs, install just the client RPM:
2954 shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
2955
2956 RPM provides a feature to verify the integrity and authenticity of
2957 packages before installing them. If you would like to learn more
2958 about this feature, see Section 2.4.5, "Verifying Package
2959 Integrity Using MD5 Checksums or GnuPG."
2960
2961 The server RPM places data under the /var/lib/mysql directory. The
2962 RPM also creates a login account for a user named mysql (if one
2963 does not exist) to use for running the MySQL server, and creates
2964 the appropriate entries in /etc/init.d/ to start the server
2965 automatically at boot time. (This means that if you have performed
2966 a previous installation and have made changes to its startup
2967 script, you may want to make a copy of the script so that you
2968 don't lose it when you install a newer RPM.) See Section
2969 2.4.16.2.2, "Starting and Stopping MySQL Automatically," for more
2970 information on how MySQL can be started automatically on system
2971 startup.
2972
2973 If you want to install the MySQL RPM on older Linux distributions
2974 that do not support initialization scripts in /etc/init.d
2975 (directly or via a symlink), you should create a symbolic link
2976 that points to the location where your initialization scripts
2977 actually are installed. For example, if that location is
2978 /etc/rc.d/init.d, use these commands before installing the RPM to
2979 create /etc/init.d as a symbolic link that points there:
2980 shell> cd /etc
2981 shell> ln -s rc.d/init.d .
2982
2983 However, all current major Linux distributions should support the
2984 new directory layout that uses /etc/init.d, because it is required
2985 for LSB (Linux Standard Base) compliance.
2986
2987 If the RPM files that you install include MySQL-server, the mysqld
2988 server should be up and running after installation. You should be
2989 able to start using MySQL.
2990
2991 If something goes wrong, you can find more information in the
2992 binary installation section. See Section 2.4.14, "Installing MySQL
2993 from tar.gz Packages on Other Unix-Like Systems."
2994
2995 Note
2996
2997 The accounts that are listed in the MySQL grant tables initially
2998 have no passwords. After starting the server, you should set up
2999 passwords for them using the instructions in Section 2.4.16,
3000 "Post-Installation Setup and Testing."
3001
3002 2.4.10. Installing MySQL on Mac OS X
3003
3004 You can install MySQL on Mac OS X 10.3.x ("Panther") or newer
3005 using a Mac OS X binary package in PKG format instead of the
3006 binary tarball distribution. Please note that older versions of
3007 Mac OS X (for example, 10.1.x or 10.2.x) are not supported by this
3008 package.
3009
3010 The package is located inside a disk image (.dmg) file that you
3011 first need to mount by double-clicking its icon in the Finder. It
3012 should then mount the image and display its contents.
3013
3014 To obtain MySQL, see Section 2.4.4, "How to Get MySQL."
3015
3016 Note
3017
3018 Before proceeding with the installation, be sure to shut down all
3019 running MySQL server instances by either using the MySQL Manager
3020 Application (on Mac OS X Server) or via mysqladmin shutdown on the
3021 command line.
3022
3023 To actually install the MySQL PKG file, double-click on the
3024 package icon. This launches the Mac OS X Package Installer, which
3025 guides you through the installation of MySQL.
3026
3027 Due to a bug in the Mac OS X package installer, you may see this
3028 error message in the destination disk selection dialog:
3029 You cannot install this software on this disk. (null)
3030
3031 If this error occurs, simply click the Go Back button once to
3032 return to the previous screen. Then click Continue to advance to
3033 the destination disk selection again, and you should be able to
3034 choose the destination disk correctly. We have reported this bug
3035 to Apple and it is investigating this problem.
3036
3037 The Mac OS X PKG of MySQL installs itself into
3038 /usr/local/mysql-VERSION and also installs a symbolic link,
3039 /usr/local/mysql, that points to the new location. If a directory
3040 named /usr/local/mysql exists, it is renamed to
3041 /usr/local/mysql.bak first. Additionally, the installer creates
3042 the grant tables in the mysql database by executing
3043 mysql_install_db.
3044
3045 The installation layout is similar to that of a tar file binary
3046 distribution; all MySQL binaries are located in the directory
3047 /usr/local/mysql/bin. The MySQL socket file is created as
3048 /tmp/mysql.sock by default. See Section 2.4.6, "Installation
3049 Layouts."
3050
3051 MySQL installation requires a Mac OS X user account named mysql. A
3052 user account with this name should exist by default on Mac OS X
3053 10.2 and up.
3054
3055 If you are running Mac OS X Server, a version of MySQL should
3056 already be installed. The following table shows the versions of
3057 MySQL that ship with Mac OS X Server versions.
3058 Mac OS X Server Version MySQL Version
3059 10.2-10.2.2 3.23.51
3060 10.2.3-10.2.6 3.23.53
3061 10.3 4.0.14
3062 10.3.2 4.0.16
3063 10.4.0 4.1.10a
3064
3065 This manual section covers the installation of the official MySQL
3066 Mac OS X PKG only. Make sure to read Apple's help information
3067 about installing MySQL: Run the "Help View" application, select
3068 "Mac OS X Server" help, do a search for "MySQL," and read the item
3069 entitled "Installing MySQL."
3070
3071 For preinstalled versions of MySQL on Mac OS X Server, note
3072 especially that you should start mysqld with safe_mysqld instead
3073 of mysqld_safe if MySQL is older than version 4.0.
3074
3075 If you previously used Marc Liyanage's MySQL packages for Mac OS X
3076 from http://www.entropy.ch, you can simply follow the update
3077 instructions for packages using the binary installation layout as
3078 given on his pages.
3079
3080 If you are upgrading from Marc's 3.23.x versions or from the Mac
3081 OS X Server version of MySQL to the official MySQL PKG, you also
3082 need to convert the existing MySQL privilege tables to the current
3083 format, because some new security privileges have been added. See
3084 Section 4.4.9, "mysql_upgrade --- Check Tables for MySQL Upgrade."
3085
3086 If you want MySQL to start automatically during system startup,
3087 you also need to install the MySQL Startup Item. It is part of the
3088 Mac OS X installation disk images as a separate installation
3089 package. Simply double-click the MySQLStartupItem.pkg icon and
3090 follow the instructions to install it. The Startup Item need be
3091 installed only once. There is no need to install it each time you
3092 upgrade the MySQL package later.
3093
3094 The Startup Item for MySQL is installed into
3095 /Library/StartupItems/MySQLCOM. (Before MySQL 4.1.2, the location
3096 was /Library/StartupItems/MySQL, but that collided with the MySQL
3097 Startup Item installed by Mac OS X Server.) Startup Item
3098 installation adds a variable MYSQLCOM=-YES- to the system
3099 configuration file /etc/hostconfig. If you want to disable the
3100 automatic startup of MySQL, simply change this variable to
3101 MYSQLCOM=-NO-.
3102
3103 On Mac OS X Server, the default MySQL installation uses the
3104 variable MYSQL in the /etc/hostconfig file. The MySQL AB Startup
3105 Item installer disables this variable by setting it to MYSQL=-NO-.
3106 This avoids boot time conflicts with the MYSQLCOM variable used by
3107 the MySQL AB Startup Item. However, it does not shut down a
3108 running MySQL server. You should do that yourself.
3109
3110 After the installation, you can start up MySQL by running the
3111 following commands in a terminal window. You must have
3112 administrator privileges to perform this task.
3113
3114 If you have installed the Startup Item, use this command:
3115 shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
3116 (Enter your password, if necessary)
3117 (Press Control-D or enter "exit" to exit the shell)
3118
3119 If you don't use the Startup Item, enter the following command
3120 sequence:
3121 shell> cd /usr/local/mysql
3122 shell> sudo ./bin/mysqld_safe
3123 (Enter your password, if necessary)
3124 (Press Control-Z)
3125 shell> bg
3126 (Press Control-D or enter "exit" to exit the shell)
3127
3128 You should be able to connect to the MySQL server, for example, by
3129 running /usr/local/mysql/bin/mysql.
3130
3131 Note
3132
3133 The accounts that are listed in the MySQL grant tables initially
3134 have no passwords. After starting the server, you should set up
3135 passwords for them using the instructions in Section 2.4.16,
3136 "Post-Installation Setup and Testing."
3137
3138 You might want to add aliases to your shell's resource file to
3139 make it easier to access commonly used programs such as mysql and
3140 mysqladmin from the command line. The syntax for bash is:
3141 alias mysql=/usr/local/mysql/bin/mysql
3142 alias mysqladmin=/usr/local/mysql/bin/mysqladmin
3143
3144 For tcsh, use:
3145 alias mysql /usr/local/mysql/bin/mysql
3146 alias mysqladmin /usr/local/mysql/bin/mysqladmin
3147
3148 Even better, add /usr/local/mysql/bin to your PATH environment
3149 variable. You can do this by modifying the appropriate startup
3150 file for your shell. For more information, see Section 4.2.1,
3151 "Invoking MySQL Programs."
3152
3153 If you are upgrading an existing installation, note that
3154 installing a new MySQL PKG does not remove the directory of an
3155 older installation. Unfortunately, the Mac OS X Installer does not
3156 yet offer the functionality required to properly upgrade
3157 previously installed packages.
3158
3159 To use your existing databases with the new installation, you'll
3160 need to copy the contents of the old data directory to the new
3161 data directory. Make sure that neither the old server nor the new
3162 one is running when you do this. After you have copied over the
3163 MySQL database files from the previous installation and have
3164 successfully started the new server, you should consider removing
3165 the old installation files to save disk space. Additionally, you
3166 should also remove older versions of the Package Receipt
3167 directories located in /Library/Receipts/mysql-VERSION.pkg.
3168
3169 2.4.11. Installing MySQL on Solaris
3170
3171 If you install MySQL using a binary tarball distribution on
3172 Solaris, you may run into trouble even before you get the MySQL
3173 distribution unpacked, as the Solaris tar cannot handle long
3174 filenames. This means that you may see errors when you try to
3175 unpack MySQL.
3176
3177 If this occurs, you must use GNU tar (gtar) to unpack the
3178 distribution. You can find a precompiled copy for Solaris at
3179 http://dev.mysql.com/downloads/os-solaris.html.
3180
3181 You can install MySQL on Solaris using a binary package in PKG
3182 format instead of the binary tarball distribution. Before
3183 installing using the binary PKG format, you should create the
3184 mysql user and group, for example:
3185 groupadd mysql
3186 useradd -g mysql mysql
3187
3188 Some basic PKG-handling commands follow:
3189 * To add a package:
3190 pkgadd -d package_name.pkg
3191 * To remove a package:
3192 pkgrm package_name
3193 * To get a full list of installed packages:
3194 pkginfo
3195 * To get detailed information for a package:
3196 pkginfo -l package_name
3197 * To list the files belonging to a package:
3198 pkgchk -v package_name
3199 * To get packaging information for an arbitrary file:
3200 pkgchk -l -p file_name
3201
3202 For additional information about installing MySQL on Solaris, see
3203 Section 2.4.19.3, "Solaris Notes."
3204
3205 2.4.12. Installing MySQL on i5/OS
3206
3207 The i5/OS POWER MySQL package was created in cooperation with IBM.
3208 MySQL works within the Portable Application Solution Environment
3209 (PASE) on the System i series of hardware and will also provide
3210 database services for the Zend Core for i5/OS.
3211
3212 MySQL for i5/OS is provided as a save file (.savf) package that
3213 can be downloaded and installed directly without any additional
3214 installation steps required.
3215
3216 MySQL is only supported on i5/OS V5R4 or later releases. The i5/OS
3217 PASE must be installed for MySQL to operate. You must be able to
3218 login as a user in *SECOFR class.
3219
3220 You should the installation notes and tips for i5/OS before
3221 starting installation. See i5/OS Installation Notes.
3222
3223 Note
3224
3225 The installation package will use an existing configuration if you
3226 have previously installed MySQL (which is identified by looking
3227 for the file /etc/my.cnf). The values for the data directory
3228 (DATADIR) and owner of the MySQL files (USRPRF) specified during
3229 the installation will be ignored, and the values determined from
3230 the /etc/my.cnf will be used instead.
3231
3232 If you want to change these parameters during a new install, you
3233 should temporarily rename /etc/my.cnf, install MySQL using the new
3234 parameters you want to use, and then merge your previous
3235 /etc/my.cnf configuration settings with the new /etc/my.cnf file
3236 that is created during installation.
3237
3238 To install MySQL on i5/OS, follow these steps:
3239 1. Create a user profile MYSQL. The MYSQL user profile will own
3240 all the MySQL files and databases and be the active user used
3241 when the MySQL server is running. The profile should be
3242 disabled so that you cannot log in as the MySQL user. To
3243 create a user profile, use CRTUSRPRF:
3244 CRTUSRPRF USRPRF(MYSQL) STATUS(*DISABLED) TEXT('MySQL user id')
3245 2. On the System i machine, create a save file that will be used
3246 to receive the downloaded installation save file. The file
3247 should be located within the General Purpose Library (QGPL):
3248 CRTSAVF FILE(QGPL/MYSQLINST)
3249 3. Download the MySQL installation save file in 32-bit
3250 (mysql-5.0.42-i5os-power-32bit.savf) or 64-bit
3251 (mysql-5.0.42-i5os-power-64bit.savf) from MySQL Downloads
3252 (http://dev.mysql.com/downloads).
3253 4. You need to FTP the downloaded .savf file directly into the
3254 QGPL/MYSQLINST file on the System i server. You can do this
3255 through FTP using the following steps after logging in to the
3256 System i machine:
3257 ftp> bin
3258 ftp> cd qgpl
3259 ftp> put mysql-5.0.42-i5os-power.savf mysqlinst
3260 5. Log into the System i server using a user in the *SECOFR
3261 class, such as the QSECOFR user ID.
3262 6. You need to restore the installation library stored in the
3263 .savf save file:
3264 RSTLIB MYSQLINST DEV(*SAVF) SAVF(QGPL/MYSQLINST)
3265 7. You need to execute the installation command,
3266 MYSQLINST/INSMYSQL. You can specify three parameter settings
3267 during installation:
3268 + DIR('/opt/mysql') sets the installation location for the
3269 MySQL files. The directory will be created if it does not
3270 already exist.
3271 + DATADIR('/QOpenSys/mysal/data') sets the location of the
3272 directory that will be used to store the database files
3273 and binary logs. The default setting is
3274 /QOpenSys/mysql/data. Note that if the installer detects
3275 an existing installation (due to the existence of
3276 /etc/my.cnf), then this parameter will be ignored.
3277 + USRPRF(MYSQL) sets the user profile that will own the
3278 files that are installed. The profile will be created if
3279 it does not already exist.
3280 MySQL can be installed anywhere, for this example we will
3281 assume MySQL has been installed into /opt/mysql. The MYSQL
3282 user profile that was created earlier in this sequence should
3283 be used for the profile:
3284 MYSQLINST/INSMYSQL DIR('/opt/mysql') DATADIR('/opt/mysqldata') USRPRF
3285 (MYSQL)
3286 If you are updating an installation over an existing MySQL
3287 installation, you should use the same parameter values that
3288 were used when MySQL was originally installed.
3289 The installation copies all the necessary files into a
3290 directory matching the package version (for example
3291 mysql-5.0.42-i5os-power-32bit), sets the ownership on those
3292 files, sets up the MySQL environment and creates the MySQL
3293 configuration file (in /etc/my.cnf) completing all the steps
3294 in a typical binary installation process automatically. If
3295 this is a new installation of MySQL, or if the installer
3296 detects that this is a new version (because the /etc/my.cnf
3297 file does not exist), then the initial core MySQL databases
3298 will also be created during installation.
3299 8. Once the installation has completed, you can delete the
3300 installation file:
3301 DLTLIB LIB(MYSQLINST)
3302
3303 To start MySQL:
3304 1. Log into the System i server using a user within the *SECOFR
3305 class, such as the QSECOFR user ID.
3306
3307 Note
3308 You should start mysqld_safe using a user that in the PASE
3309 environment has the id=0 (the equivalent of the standard Unix
3310 root user). If you do not use a user with this ID then the
3311 system will be unable to change the user when executing mysqld
3312 as set using --user option. If this happens, mysqld may be
3313 unable to read the files located within the MySQL data
3314 directory and the execution will fail.
3315 2. Enter the PASE environment using call qp2term.
3316 3. Start the MySQL server by changing to the installation
3317 directory and running mysqld_safe, specifying the user name
3318 used to install the server. The installer conveniently
3319 installs a symbolic link to the installation directory
3320 (mysql-5.0.42-i5os-power-32bit) as /opt/mysql/mysql:
3321 > cd /opt/mysql/mysql
3322 > bin/mysqld_safe --user=mysql &
3323 You should see a message similar to the following:
3324 Starting mysqld daemon with databases ��
3325 from /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data
3326
3327 If you are having problems starting MySQL server, see Section
3328 2.4.16.2.3, "Starting and Troubleshooting the MySQL Server."
3329
3330 To stop MySQL:
3331 1. Log into the System i server using the *SECOFR class, such as
3332 the QSECOFR user ID.
3333 2. Enter the PASE environment using call qp2term.
3334 3. Stop the MySQL server by changing into the installation
3335 directory and running mysqladmin, specifying the user name
3336 used to install the server:
3337 > cd /opt/mysql/mysql
3338 > bin/mysqladmin -u root shutdown
3339 If the session that you started and stopped MySQL are the
3340 same, you may get the log output from mysqld:
3341 STOPPING server from pid file ��
3342 /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data/I5DBX.R
3343 CHLAND.IBM.COM.pid
3344 070718 10:34:20 mysqld ended
3345 If the sessions used to start and stop MySQL are different,
3346 you will not receive any confirmation of the shutdown.
3347
3348 Note and tips
3349 * A problem has been identified with the installation process on
3350 DBCS systems. If you are having problems install MySQL on a
3351 DBCS system, you need to change your job's coded character set
3352 identifier (CSSID) to 37 (EBCDIC) before executing the install
3353 command, INSMYSQL. To do this, determine your existing CSSID
3354 (using DSPJOB and selecting option 2), execute CHGJOB
3355 CSSID(37), run INSMYSQL to install MySQL and then execute
3356 CHGJOB again with your original CSSID.
3357 * If you want to use the Perl scripts that are included with
3358 MySQL, you need to download the iSeries Tools for Developers
3359 (5799-PTL). See
3360 http://www-03.ibm.com/servers/enable/site/porting/tools/.
3361
3362 2.4.13. Installing MySQL on NetWare
3363
3364 This section does not apply to MySQL Enterprise Server users.
3365
3366 Porting MySQL to NetWare was an effort spearheaded by Novell.
3367 Novell customers should be pleased to note that NetWare 6.5 ships
3368 with bundled MySQL binaries, complete with an automatic commercial
3369 use license for all servers running that version of NetWare.
3370
3371 MySQL for NetWare is compiled using a combination of Metrowerks
3372 CodeWarrior for NetWare and special cross-compilation versions of
3373 the GNU autotools.
3374
3375 The latest binary packages for NetWare can be obtained at
3376 http://dev.mysql.com/downloads/. See Section 2.4.4, "How to Get
3377 MySQL."
3378
3379 To host MySQL, the NetWare server must meet these requirements:
3380 * The latest Support Pack of NetWare 6.5
3381 (http://support.novell.com/filefinder/18197/index.html)must
3382 be installed.
3383 * The system must meet Novell's minimum requirements to run the
3384 respective version of NetWare.
3385 * MySQL data and the program binaries must be installed on an
3386 NSS volume; traditional volumes are not supported.
3387
3388 To install MySQL for NetWare, use the following procedure:
3389 1. If you are upgrading from a prior installation, stop the MySQL
3390 server. This is done from the server console, using the
3391 following command:
3392 SERVER: mysqladmin -u root shutdown
3393
3394 Note
3395 If the MySQL root user account has a password, you need to
3396 invoke mysqladmin with the -p option and supply the password
3397 when prompted.
3398 2. Log on to the target server from a client machine with access
3399 to the location where you are installing MySQL.
3400 3. Extract the binary package Zip file onto the server. Be sure
3401 to allow the paths in the Zip file to be used. It is safe to
3402 simply extract the file to SYS:\.
3403 If you are upgrading from a prior installation, you may need
3404 to copy the data directory (for example, SYS:MYSQL\DATA), as
3405 well as my.cnf, if you have customized it. You can then delete
3406 the old copy of MySQL.
3407 4. You might want to rename the directory to something more
3408 consistent and easy to use. The examples in this manual use
3409 SYS:MYSQL to refer to the installation directory.
3410 Note that MySQL installation on NetWare does not detect if a
3411 version of MySQL is already installed outside the NetWare
3412 release. Therefore, if you have installed the latest MySQL
3413 version from the Web (for example, MySQL 4.1 or later) in
3414 SYS:\MYSQL, you must rename the folder before upgrading the
3415 NetWare server; otherwise, files in SYS:\MySQL are overwritten
3416 by the MySQL version present in NetWare Support Pack.
3417 5. At the server console, add a search path for the directory
3418 containing the MySQL NLMs. For example:
3419 SERVER: SEARCH ADD SYS:MYSQL\BIN
3420 6. Initialize the data directory and the grant tables, if
3421 necessary, by executing mysql_install_db at the server
3422 console.
3423 7. Start the MySQL server using mysqld_safe at the server
3424 console.
3425 8. To finish the installation, you should also add the following
3426 commands to autoexec.ncf. For example, if your MySQL
3427 installation is in SYS:MYSQL and you want MySQL to start
3428 automatically, you could add these lines:
3429 #Starts the MySQL 5.0.x database server
3430 SEARCH ADD SYS:MYSQL\BIN
3431 MYSQLD_SAFE
3432 If you are running MySQL on NetWare 6.0, we strongly suggest
3433 that you use the --skip-external-locking option on the command
3434 line:
3435 #Starts the MySQL 5.0.x database server
3436 SEARCH ADD SYS:MYSQL\BIN
3437 MYSQLD_SAFE --skip-external-locking
3438 It is also necessary to use CHECK TABLE and REPAIR TABLE
3439 instead of myisamchk, because myisamchk makes use of external
3440 locking. External locking is known to have problems on NetWare
3441 6.0; the problem has been eliminated in NetWare 6.5. Note that
3442 the use of MySQL on Netware 6.0 is not officially supported.
3443 mysqld_safe on NetWare provides a screen presence. When you
3444 unload (shut down) the mysqld_safe NLM, the screen does not go
3445 away by default. Instead, it prompts for user input:
3446 *<NLM has terminated; Press any key to close the screen>*
3447 If you want NetWare to close the screen automatically instead,
3448 use the --autoclose option to mysqld_safe. For example:
3449 #Starts the MySQL 5.0.x database server
3450 SEARCH ADD SYS:MYSQL\BIN
3451 MYSQLD_SAFE --autoclose
3452 The behavior of mysqld_safe on NetWare is described further in
3453 Section 4.3.2, "mysqld_safe --- MySQL Server Startup Script."
3454 9. When installing MySQL, either for the first time or upgrading
3455 from a previous version, download and install the latest and
3456 appropriate Perl module and PHP extensions for NetWare:
3457 + Perl:
3458 http://forge.novell.com/modules/xfcontent/downloads.php/p
3459 erl/Modules/
3460 + PHP:
3461 http://forge.novell.com/modules/xfcontent/downloads.php/p
3462 hp/Modules/
3463
3464 If there was an existing installation of MySQL on the NetWare
3465 server, be sure to check for existing MySQL startup commands in
3466 autoexec.ncf, and edit or delete them as necessary.
3467
3468 Note
3469
3470 The accounts that are listed in the MySQL grant tables initially
3471 have no passwords. After starting the server, you should set up
3472 passwords for them using the instructions in Section 2.4.16,
3473 "Post-Installation Setup and Testing."
3474
3475 2.4.14. Installing MySQL from tar.gz Packages on Other Unix-Like
3476 Systems
3477
3478 This section does not apply to MySQL Enterprise Server users.
3479
3480 This section covers the installation of MySQL binary distributions
3481 that are provided for various platforms in the form of compressed
3482 tar files (files with a .tar.gz extension). See Section 2.4.3.4,
3483 "MySQL Binaries Compiled by MySQL AB," for a detailed list.
3484
3485 To obtain MySQL, see Section 2.4.4, "How to Get MySQL."
3486
3487 MySQL tar file binary distributions have names of the form
3488 mysql-VERSION-OS.tar.gz, where VERSION is a number (for example,
3489 5.0.68), and OS indicates the type of operating system for which
3490 the distribution is intended (for example, pc-linux-i686).
3491
3492 In addition to these generic packages, we also offer binaries in
3493 platform-specific package formats for selected platforms. See
3494 Section 2.4.7, "Standard MySQL Installation Using a Binary
3495 Distribution," for more information on how to install these.
3496
3497 You need the following tools to install a MySQL tar file binary
3498 distribution:
3499 * GNU gunzip to uncompress the distribution.
3500 * A reasonable tar to unpack the distribution. GNU tar is known
3501 to work. Some operating systems come with a preinstalled
3502 version of tar that is known to have problems. For example,
3503 Mac OS X tar and Sun tar are known to have problems with long
3504 filenames. On Mac OS X, you can use the preinstalled gnutar
3505 program. On other systems with a deficient tar, you should
3506 install GNU tar first.
3507
3508 If you run into problems and need to file a bug report, please use
3509 the instructions in Section 1.7, "How to Report Bugs or Problems."
3510
3511 The basic commands that you must execute to install and use a
3512 MySQL binary distribution are:
3513 shell> groupadd mysql
3514 shell> useradd -g mysql mysql
3515 shell> cd /usr/local
3516 shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
3517 shell> ln -s full-path-to-mysql-VERSION-OS mysql
3518 shell> cd mysql
3519 shell> chown -R mysql .
3520 shell> chgrp -R mysql .
3521 shell> scripts/mysql_install_db --user=mysql
3522 shell> chown -R root .
3523 shell> chown -R mysql data
3524 shell> bin/mysqld_safe --user=mysql &
3525
3526 Note
3527
3528 This procedure does not set up any passwords for MySQL accounts.
3529 After following the procedure, proceed to Section 2.4.16,
3530 "Post-Installation Setup and Testing."
3531
3532 A more detailed version of the preceding description for
3533 installing a binary distribution follows:
3534 1. Add a login user and group for mysqld to run as:
3535 shell> groupadd mysql
3536 shell> useradd -g mysql mysql
3537 These commands add the mysql group and the mysql user. The
3538 syntax for useradd and groupadd may differ slightly on
3539 different versions of Unix, or they may have different names
3540 such as adduser and addgroup.
3541 You might want to call the user and group something else
3542 instead of mysql. If so, substitute the appropriate name in
3543 the following steps.
3544 2. Pick the directory under which you want to unpack the
3545 distribution and change location into it. In the following
3546 example, we unpack the distribution under /usr/local. (The
3547 instructions, therefore, assume that you have permission to
3548 create files and directories in /usr/local. If that directory
3549 is protected, you must perform the installation as root.)
3550 shell> cd /usr/local
3551 3. Obtain a distribution file using the instructions in Section
3552 2.4.4, "How to Get MySQL." For a given release, binary
3553 distributions for all platforms are built from the same MySQL
3554 source distribution.
3555 4. Unpack the distribution, which creates the installation
3556 directory. Then create a symbolic link to that directory:
3557 shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
3558 shell> ln -s full-path-to-mysql-VERSION-OS mysql
3559 The tar command creates a directory named mysql-VERSION-OS.
3560 The ln command makes a symbolic link to that directory. This
3561 lets you refer more easily to the installation directory as
3562 /usr/local/mysql.
3563 With GNU tar, no separate invocation of gunzip is necessary.
3564 You can replace the first line with the following alternative
3565 command to uncompress and extract the distribution:
3566 shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
3567 5. Change location into the installation directory:
3568 shell> cd mysql
3569 You will find several files and subdirectories in the mysql
3570 directory. The most important for installation purposes are
3571 the bin and scripts subdirectories:
3572 + The bin directory contains client programs and the
3573 server. You should add the full pathname of this
3574 directory to your PATH environment variable so that your
3575 shell finds the MySQL programs properly. See Section
3576 2.4.20, "Environment Variables."
3577 + The scripts directory contains the mysql_install_db
3578 script used to initialize the mysql database containing
3579 the grant tables that store the server access
3580 permissions.
3581 6. Ensure that the distribution contents are accessible to mysql.
3582 If you unpacked the distribution as mysql, no further action
3583 is required. If you unpacked the distribution as root, its
3584 contents will be owned by root. Change its ownership to mysql
3585 by executing the following commands as root in the
3586 installation directory:
3587 shell> chown -R mysql .
3588 shell> chgrp -R mysql .
3589 The first command changes the owner attribute of the files to
3590 the mysql user. The second changes the group attribute to the
3591 mysql group.
3592 7. If you have not installed MySQL before, you must create the
3593 MySQL data directory and initialize the grant tables:
3594 shell> scripts/mysql_install_db --user=mysql
3595 If you run the command as root, include the --user option as
3596 shown. If you run the command while logged in as that user,
3597 you can omit the --user option.
3598 The command should create the data directory and its contents
3599 with mysql as the owner.
3600 After creating or updating the grant tables, you need to
3601 restart the server manually.
3602 8. Most of the MySQL installation can be owned by root if you
3603 like. The exception is that the data directory must be owned
3604 by mysql. To accomplish this, run the following commands as
3605 root in the installation directory:
3606 shell> chown -R root .
3607 shell> chown -R mysql data
3608 9. If you want MySQL to start automatically when you boot your
3609 machine, you can copy support-files/mysql.server to the
3610 location where your system has its startup files. More
3611 information can be found in the support-files/mysql.server
3612 script itself and in Section 2.4.16.2.2, "Starting and
3613 Stopping MySQL Automatically."
3614 10. You can set up new accounts using the bin/mysql_setpermission
3615 script if you install the DBI and DBD::mysql Perl modules. See
3616 Section 4.6.16, "mysql_setpermission --- Interactively Set
3617 Permissions in Grant Tables." For Perl module installation
3618 instructions, see Section 2.4.21, "Perl Installation Notes."
3619 11. If you would like to use mysqlaccess and have the MySQL
3620 distribution in some non-standard location, you must change
3621 the location where mysqlaccess expects to find the mysql
3622 client. Edit the bin/mysqlaccess script at approximately line
3623 18. Search for a line that looks like this:
3624 $MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
3625 Change the path to reflect the location where mysql actually
3626 is stored on your system. If you do not do this, a Broken pipe
3627 error will occur when you run mysqlaccess.
3628
3629 After everything has been unpacked and installed, you should test
3630 your distribution. To start the MySQL server, use the following
3631 command:
3632 shell> bin/mysqld_safe --user=mysql &
3633
3634 If you run the command as root, you must use the --user option as
3635 shown. The value of the option is the name of the login account
3636 that you created in the first step to use for running the server.
3637 If you run the command while logged in as mysql, you can omit the
3638 --user option.
3639
3640 If the command fails immediately and prints mysqld ended, you can
3641 find some information in the host_name.err file in the data
3642 directory.
3643
3644 More information about mysqld_safe is given in Section 4.3.2,
3645 "mysqld_safe --- MySQL Server Startup Script."
3646
3647 Note
3648
3649 The accounts that are listed in the MySQL grant tables initially
3650 have no passwords. After starting the server, you should set up
3651 passwords for them using the instructions in Section 2.4.16,
3652 "Post-Installation Setup and Testing."
3653
3654 2.4.15. MySQL Installation Using a Source Distribution
3655
3656 This section does not apply to MySQL Enterprise Server users.
3657
3658 Before you proceed with an installation from source, first check
3659 whether our binary is available for your platform and whether it
3660 works for you. We put a great deal of effort into ensuring that
3661 our binaries are built with the best possible options.
3662
3663 To obtain a source distribution for MySQL, Section 2.4.4, "How to
3664 Get MySQL." If you want to build MySQL from source on Windows, see
3665 Section 2.4.15.6, "Installing MySQL from Source on Windows."
3666
3667 MySQL source distributions are provided as compressed tar archives
3668 and have names of the form mysql-VERSION.tar.gz, where VERSION is
3669 a number like 5.0.68.
3670
3671 You need the following tools to build and install MySQL from
3672 source:
3673 * GNU gunzip to uncompress the distribution.
3674 * A reasonable tar to unpack the distribution. GNU tar is known
3675 to work. Some operating systems come with a preinstalled
3676 version of tar that is known to have problems. For example,
3677 the tar provided with early versions of Mac OS X tar, SunOS
3678 4.x and Solaris 8 and earlier are known to have problems with
3679 long filenames. On Mac OS X, you can use the preinstalled
3680 gnutar program. On other systems with a deficient tar, you
3681 should install GNU tar first.
3682 * A working ANSI C++ compiler. gcc 2.95.2 or later, SGI C++, and
3683 SunPro C++ are some of the compilers that are known to work.
3684 libg++ is not needed when using gcc. gcc 2.7.x has a bug that
3685 makes it impossible to compile some perfectly legal C++ files,
3686 such as sql/sql_base.cc. If you have only gcc 2.7.x, you must
3687 upgrade your gcc to be able to compile MySQL. gcc 2.8.1 is
3688 also known to have problems on some platforms, so it should be
3689 avoided if a newer compiler exists for the platform. gcc
3690 2.95.2 or later is recommended.
3691 * A good make program. GNU make is always recommended and is
3692 sometimes required. (BSD make fails, and vendor-provided make
3693 implementations may fail as well.) If you have problems, we
3694 recommend GNU make 3.75 or newer.
3695 * libtool 1.5.24 or later is also recommended.
3696
3697 If you are using a version of gcc recent enough to understand the
3698 -fno-exceptions option, it is very important that you use this
3699 option. Otherwise, you may compile a binary that crashes randomly.
3700 We also recommend that you use -felide-constructors and -fno-rtti
3701 along with -fno-exceptions. When in doubt, do the following:
3702 CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
3703 -fno-exceptions -fno-rtti" ./configure \
3704 --prefix=/usr/local/mysql --enable-assembler \
3705 --with-mysqld-ldflags=-all-static
3706
3707 On most systems, this gives you a fast and stable binary.
3708
3709 If you run into problems and need to file a bug report, please use
3710 the instructions in Section 1.7, "How to Report Bugs or Problems."
3711
3712 2.4.15.1. Source Installation Overview
3713
3714 This section does not apply to MySQL Enterprise Server users.
3715
3716 The basic commands that you must execute to install a MySQL source
3717 distribution are:
3718 shell> groupadd mysql
3719 shell> useradd -g mysql mysql
3720 shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
3721 shell> cd mysql-VERSION
3722 shell> ./configure --prefix=/usr/local/mysql
3723 shell> make
3724 shell> make install
3725 shell> cp support-files/my-medium.cnf /etc/my.cnf
3726 shell> cd /usr/local/mysql
3727 shell> chown -R mysql .
3728 shell> chgrp -R mysql .
3729 shell> bin/mysql_install_db --user=mysql
3730 shell> chown -R root .
3731 shell> chown -R mysql var
3732 shell> bin/mysqld_safe --user=mysql &
3733
3734 If you start from a source RPM, do the following:
3735 shell> rpmbuild --rebuild --clean MySQL-VERSION.src.rpm
3736
3737 This makes a binary RPM that you can install. For older versions
3738 of RPM, you may have to replace the command rpmbuild with rpm
3739 instead.
3740
3741 Note
3742
3743 This procedure does not set up any passwords for MySQL accounts.
3744 After following the procedure, proceed to Section 2.4.16,
3745 "Post-Installation Setup and Testing," for post-installation setup
3746 and testing.
3747
3748 A more detailed version of the preceding description for
3749 installing MySQL from a source distribution follows:
3750 1. Add a login user and group for mysqld to run as:
3751 shell> groupadd mysql
3752 shell> useradd -g mysql mysql
3753 These commands add the mysql group and the mysql user. The
3754 syntax for useradd and groupadd may differ slightly on
3755 different versions of Unix, or they may have different names
3756 such as adduser and addgroup.
3757 You might want to call the user and group something else
3758 instead of mysql. If so, substitute the appropriate name in
3759 the following steps.
3760 2. Perform the following steps as the mysql user, except as
3761 noted.
3762 3. Pick the directory under which you want to unpack the
3763 distribution and change location into it.
3764 4. Obtain a distribution file using the instructions in Section
3765 2.4.4, "How to Get MySQL."
3766 5. Unpack the distribution into the current directory:
3767 shell> gunzip < /path/to/mysql-VERSION.tar.gz | tar xvf -
3768 This command creates a directory named mysql-VERSION.
3769 With GNU tar, no separate invocation of gunzip is necessary.
3770 You can use the following alternative command to uncompress
3771 and extract the distribution:
3772 shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
3773 6. Change location into the top-level directory of the unpacked
3774 distribution:
3775 shell> cd mysql-VERSION
3776 Note that currently you must configure and build MySQL from
3777 this top-level directory. You cannot build it in a different
3778 directory.
3779 7. Configure the release and compile everything:
3780 shell> ./configure --prefix=/usr/local/mysql
3781 shell> make
3782 When you run configure, you might want to specify other
3783 options. Run ./configure --help for a list of options. Section
3784 2.4.15.2, "Typical configure Options," discusses some of the
3785 more useful options.
3786 If configure fails and you are going to send mail to a MySQL
3787 mailing list to ask for assistance, please include any lines
3788 from config.log that you think can help solve the problem.
3789 Also include the last couple of lines of output from
3790 configure. To file a bug report, please use the instructions
3791 in Section 1.7, "How to Report Bugs or Problems."
3792 If the compile fails, see Section 2.4.15.4, "Dealing with
3793 Problems Compiling MySQL," for help.
3794 8. Install the distribution:
3795 shell> make install
3796 You might need to run this command as root.
3797 If you want to set up an option file, use one of those present
3798 in the support-files directory as a template. For example:
3799 shell> cp support-files/my-medium.cnf /etc/my.cnf
3800 You might need to run this command as root.
3801 If you want to configure support for InnoDB tables, you should
3802 edit the /etc/my.cnf file, remove the # character before the
3803 option lines that start with innodb_..., and modify the option
3804 values to be what you want. See Section 4.2.3.2, "Using Option
3805 Files," and Section 13.2.3, "InnoDB Configuration."
3806 9. Change location into the installation directory:
3807 shell> cd /usr/local/mysql
3808 10. If you ran the make install command as root, the installed
3809 files will be owned by root. Ensure that the installation is
3810 accessible to mysql by executing the following commands as
3811 root in the installation directory:
3812 shell> chown -R mysql .
3813 shell> chgrp -R mysql .
3814 The first command changes the owner attribute of the files to
3815 the mysql user. The second changes the group attribute to the
3816 mysql group.
3817 11. If you have not installed MySQL before, you must create the
3818 MySQL data directory and initialize the grant tables:
3819 shell> bin/mysql_install_db --user=mysql
3820 If you run the command as root, include the --user option as
3821 shown. If you run the command while logged in as mysql, you
3822 can omit the --user option.
3823 The command should create the data directory and its contents
3824 with mysql as the owner.
3825 After using mysql_install_db to create the grant tables for
3826 MySQL, you must restart the server manually. The mysqld_safe
3827 command to do this is shown in a later step.
3828 12. Most of the MySQL installation can be owned by root if you
3829 like. The exception is that the data directory must be owned
3830 by mysql. To accomplish this, run the following commands as
3831 root in the installation directory:
3832 shell> chown -R root .
3833 shell> chown -R mysql var
3834 13. If you want MySQL to start automatically when you boot your
3835 machine, you can copy support-files/mysql.server to the
3836 location where your system has its startup files. More
3837 information can be found in the support-files/mysql.server
3838 script itself; see also Section 2.4.16.2.2, "Starting and
3839 Stopping MySQL Automatically."
3840 14. You can set up new accounts using the bin/mysql_setpermission
3841 script if you install the DBI and DBD::mysql Perl modules. See
3842 Section 4.6.16, "mysql_setpermission --- Interactively Set
3843 Permissions in Grant Tables." For Perl module installation
3844 instructions, see Section 2.4.21, "Perl Installation Notes."
3845
3846 After everything has been installed, you should test your
3847 distribution. To start the MySQL server, use the following
3848 command:
3849 shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
3850
3851 If you run the command as root, you should use the --user option
3852 as shown. The value of the option is the name of the login account
3853 that you created in the first step to use for running the server.
3854 If you run the command while logged in as that user, you can omit
3855 the --user option.
3856
3857 If the command fails immediately and prints mysqld ended, you can
3858 find some information in the host_name.err file in the data
3859 directory.
3860
3861 More information about mysqld_safe is given in Section 4.3.2,
3862 "mysqld_safe --- MySQL Server Startup Script."
3863
3864 Note
3865
3866 The accounts that are listed in the MySQL grant tables initially
3867 have no passwords. After starting the server, you should set up
3868 passwords for them using the instructions in Section 2.4.16,
3869 "Post-Installation Setup and Testing."
3870
3871 2.4.15.2. Typical configure Options
3872
3873 This section does not apply to MySQL Enterprise Server users.
3874
3875 The configure script gives you a great deal of control over how
3876 you configure a MySQL source distribution. Typically you do this
3877 using options on the configure command line. You can also affect
3878 configure using certain environment variables. See Section 2.4.20,
3879 "Environment Variables." For a full list of options supported by
3880 configure, run this command:
3881 shell> ./configure --help
3882
3883 A list of the available configure options is provided in the table
3884 below.
3885
3886 Table 2.1. Build (configure) Reference
3887 Formats Description Default Introduced Removed
3888 --bindir=DIR User executables EPREFIX/bin
3889 --build=BUILD Configure for building on BUILD guessed
3890 --cache-file=FILE Cache test results in FILE disabled
3891 -C Alias for `--cache-file=config.cache'
3892 --config-cache
3893 --datadir=DIR Read-only architecture-independent data PREFIX/share
3894
3895 --disable-FEATURE Do not include FEATURE
3896 --disable-dependency-tracking Disable dependency tracking
3897 --disable-grant-options Disable GRANT options 5.0.34
3898 --disable-largefile Omit support for large files
3899 --disable-libtool-lock Disable libtool lock
3900 --disable-profiling Build a version without query profiling code
3901 5.0.37 5.0.45
3902 --enable-FEATURE Enable FEATURE
3903 --enable-assembler Use assembler versions of some string functions
3904 if available
3905 --enable-dependency-tracking Do not reject slow dependency
3906 extractors
3907 --enable-fast-install Optimize for fast installation yes
3908 --enable-local-infile Enable LOAD DATA LOCAL INFILE disabled
3909 --enable-shared Build shared libraries yes
3910 --enable-static Build static libraries yes
3911 --enable-thread-safe-client Compile the client with threads
3912 --exec-prefix=EPREFIX Install architecture-dependent files in
3913 EPREFIX
3914 -h Display this help and exit
3915 --help
3916 --help=short Display options specific to this package
3917 --help=recursive Display the short help of all the included
3918 packages
3919 --host=HOST Cross-compile to build programs to run on HOST
3920 --includedir=DIR C header files PREFIX/include
3921 --infodir=DIR Info documentation PREFIX/info
3922 --libdir=DIR Object code libraries EPREFIX/lib
3923 --libexecdir=DIR Program executables EPREFIX/libexec
3924 --localstatedir=DIR Modifiable single-machine data PREFIX/var
3925 --mandir=DIR man documentation PREFIX/man
3926 -n Do not create output files
3927 --no-create
3928 --oldincludedir=DIR C header files for non-gcc /usr/include
3929 --prefix=PREFIX Install architecture-independent files in PREFIX
3930
3931 --program-prefix=PREFIX Prepend PREFIX to installed program names
3932
3933 --program-suffix=SUFFIX Append SUFFIX to installed program names
3934
3935 --program-transform-name=PROGRAM run sed PROGRAM on installed
3936 program names
3937 -q Do not print `checking...' messages
3938 --quiet
3939 --sbindir=DIR System admin executables EPREFIX/sbin
3940 --sharedstatedir=DIR Modifiable architecture-independent data
3941 PREFIX/com
3942 --srcdir=DIR Find the sources in DIR configure directory or ..
3943 --sysconfdir=DIR Read-only single-machine data PREFIX/etc
3944 --target=TARGET Configure for building compilers for TARGET
3945 -V Display version information and exit
3946 --version
3947 --with-PACKAGE Use PACKAGE
3948 --with-archive-storage-engine Enable the Archive Storage Engine no
3949
3950 --with-berkeley-db Use BerkeleyDB located in DIR no
3951 --with-berkeley-db-includes Find Berkeley DB headers in DIR
3952 --with-berkeley-db-libs Find Berkeley DB libraries in DIR
3953 --with-big-tables Support tables with more than 4 G rows even on
3954 32 bit platforms 5.0.4
3955 --with-blackhole-storage-engine Enable the Blackhole Storage
3956 Engine no 5.0.4
3957 --with-charset Default character set
3958 --with-client-ldflags Extra linking arguments for clients
3959 --with-collation Default collation
3960 --with-comment Comment about compilation environment
3961 --with-csv-storage-engine Enable the CSV Storage Engine yes
3962 --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS
3963 X/Darwin 5.0.6
3964 --with-embedded-privilege-control Build parts to check user's
3965 privileges (only affects embedded library)
3966 --with-embedded-server Build the embedded server
3967 --with-example-storage-engine Enable the Example Storage Engine no
3968
3969 --with-extra-charsets Use charsets in addition to default
3970 --with-gnu-ld Assume the C compiler uses GNU ld no
3971 --with-isam Enable the ISAM table type
3972 --with-lib-ccflags Extra CC options for libraries
3973 --with-libwrap=DIR Compile in libwrap (tcp_wrappers) support
3974 --with-low-memory Try to use less memory to compile to avoid
3975 memory limitations
3976 --with-machine-type Set the machine type, like "powerpc" 5.0.44
3977
3978 --with-max-indexes=N Sets the maximum number of indexes per table
3979 64
3980 --with-mit-threads Always use included thread lib
3981 --with-mysqld-ldflags Extra linking arguments for mysqld
3982 --with-mysqld-libs Extra libraries to link with for mysqld
3983 5.0.44
3984 --with-mysqld-user What user the mysqld daemon shall be run as
3985
3986 --with-mysqlfs Include the corba-based MySQL file system
3987 --with-mysqlmanager Build the mysqlmanager binary Build if server
3988 is built
3989 --with-named-curses-libs Use specified curses libraries
3990 --with-named-thread-libs Use specified thread libraries
3991 --with-ndb-ccflags Extra CC options for ndb compile 5.0.3
3992 --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi
3993 documentation
3994 --with-ndb-port Port for NDB Cluster management server
3995 --with-ndb-port-base Port for NDB Cluster management server
3996 5.0.3
3997 --with-ndb-sci=DIR Provide MySQL with a custom location of sci
3998 library
3999 --with-ndb-shm Include the NDB Cluster shared memory transporter
4000
4001 --with-ndb-test Include the NDB Cluster ndbapi test programs
4002 --with-ndbcluster Include the NDB Cluster table handler no
4003 --with-openssl=DIR Include the OpenSSL support
4004 --with-openssl-includes Find OpenSSL headers in DIR
4005 --with-openssl-libs Find OpenSSL libraries in DIR
4006 --with-other-libc=DIR Link against libc and other standard
4007 libraries installed in the specified non-standard location
4008 --with-pic Try to use only PIC/non-PIC objects Use both
4009 --with-pstack Use the pstack backtrace library
4010 --with-pthread Force use of pthread library
4011 --with-raid Enable RAID Support
4012 --with-server-suffix Append value to the version string
4013 --with-system-type Set the system type, like "sun-solaris10"
4014 5.0.44
4015 --with-tags Include additional configurations automatic
4016 --with-tcp-port Which port to use for MySQL services 3306
4017 --with-unix-socket-path Where to put the unix-domain socket
4018 --with-vio Include the Virtual IO support
4019 --with-yassl Include the yaSSL support 5.0.6
4020 --with-zlib-dir=no|bundled|DIR Provide MySQL with a custom
4021 location of compression library
4022 --without-PACKAGE Do not use PACKAGE
4023 --without-bench Skip building of the benchmark suite
4024 --without-debug Build a production version without debugging code
4025
4026 --without-docs Skip building of the documentation
4027 --without-extra-tools Skip building utilites in the tools
4028 directory
4029 --without-geometry Do not build geometry-related parts
4030 --without-innodb Do not include the InnoDB table handler
4031 --without-libedit Use system libedit instead of bundled copy
4032 --without-man Skip building of the man pages
4033 --without-ndb-debug Disable special ndb debug features 5.0.3
4034 --without-query-cache Do not build query cache
4035 --without-readline Use system readline instead of bundled copy
4036
4037 --without-server Only build the client
4038 --without-uca Skip building of the national Unicode collations
4039 5.0.3
4040
4041 Some of the configure options available are described here:
4042 * To compile just the MySQL client libraries and client programs
4043 and not the server, use the --without-server option:
4044 shell> ./configure --without-server
4045 If you have no C++ compiler, some client programs such as
4046 mysql cannot be compiled because they require C++.. In this
4047 case, you can remove the code in configure that tests for the
4048 C++ compiler and then run ./configure with the
4049 --without-server option. The compile step should still try to
4050 build all clients, but you can ignore any warnings about files
4051 such as mysql.cc. (If make stops, try make -k to tell it to
4052 continue with the rest of the build even if errors occur.)
4053 * If you want to build the embedded MySQL library (libmysqld.a),
4054 use the --with-embedded-server option.
4055 * If you don't want your log files and database directories
4056 located under /usr/local/var, use a configure command
4057 something like one of these:
4058 shell> ./configure --prefix=/usr/local/mysql
4059 shell> ./configure --prefix=/usr/local \
4060 --localstatedir=/usr/local/mysql/data
4061 The first command changes the installation prefix so that
4062 everything is installed under /usr/local/mysql rather than the
4063 default of /usr/local. The second command preserves the
4064 default installation prefix, but overrides the default
4065 location for database directories (normally /usr/local/var)
4066 and changes it to /usr/local/mysql/data.
4067 You can also specify the installation directory and data
4068 directory locations at server startup time by using the
4069 --basedir and --datadir options. These can be given on the
4070 command line or in an MySQL option file, although it is more
4071 common to use an option file. See Section 4.2.3.2, "Using
4072 Option Files."
4073 * If you are using Unix and you want the MySQL socket file
4074 location to be somewhere other than the default location
4075 (normally in the directory /tmp or /var/run), use a configure
4076 command like this:
4077 shell> ./configure \
4078 --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
4079 The socket filename must be an absolute pathname. You can also
4080 change the location of mysql.sock at server startup by using a
4081 MySQL option file. See Section B.1.4.5, "How to Protect or
4082 Change the MySQL Unix Socket File."
4083 * If you want to compile statically linked programs (for
4084 example, to make a binary distribution, to get better
4085 performance, or to work around problems with some Red Hat
4086 Linux distributions), run configure like this:
4087 shell> ./configure --with-client-ldflags=-all-static \
4088 --with-mysqld-ldflags=-all-static
4089 * If you are using gcc and don't have libg++ or libstdc++
4090 installed, you can tell configure to use gcc as your C++
4091 compiler:
4092 shell> CC=gcc CXX=gcc ./configure
4093 When you use gcc as your C++ compiler, it does not attempt to
4094 link in libg++ or libstdc++. This may be a good thing to do
4095 even if you have those libraries installed. Some versions of
4096 them have caused strange problems for MySQL users in the past.
4097 The following list indicates some compilers and environment
4098 variable settings that are commonly used with each one.
4099 + gcc 2.7.2:
4100 CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
4101 + gcc 2.95.2:
4102 CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
4103 -felide-constructors -fno-exceptions -fno-rtti"
4104 + pgcc 2.90.29 or newer:
4105 CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc \
4106 CXXFLAGS="-O3 -mpentiumpro -mstack-align-double \
4107 -felide-constructors -fno-exceptions -fno-rtti"
4108 In most cases, you can get a reasonably optimized MySQL binary
4109 by using the options from the preceding list and adding the
4110 following options to the configure line:
4111 --prefix=/usr/local/mysql --enable-assembler \
4112 --with-mysqld-ldflags=-all-static
4113 The full configure line would, in other words, be something
4114 like the following for all recent gcc versions:
4115 CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
4116 -felide-constructors -fno-exceptions -fno-rtti" ./configure \
4117 --prefix=/usr/local/mysql --enable-assembler \
4118 --with-mysqld-ldflags=-all-static
4119 The binaries we provide on the MySQL Web site at
4120 http://dev.mysql.com/downloads/ are all compiled with full
4121 optimization and should be perfect for most users. See Section
4122 2.4.3.4, "MySQL Binaries Compiled by MySQL AB." There are some
4123 configuration settings you can tweak to build an even faster
4124 binary, but these are only for advanced users. See Section
4125 7.5.6, "How Compiling and Linking Affects the Speed of MySQL."
4126 If the build fails and produces errors about your compiler or
4127 linker not being able to create the shared library
4128 libmysqlclient.so.N (where N is a version number), you can
4129 work around this problem by giving the --disable-shared option
4130 to configure. In this case, configure does not build a shared
4131 libmysqlclient.so.N library.
4132 * By default, MySQL uses the latin1 (cp1252 West European)
4133 character set. To change the default set, use the
4134 --with-charset option:
4135 shell> ./configure --with-charset=CHARSET
4136 CHARSET may be one of binary, armscii8, ascii, big5, cp1250,
4137 cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8,
4138 eucjpms, euckr, gb2312, gbk, geostd8, greek, hebrew, hp8,
4139 keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce,
4140 macroman, sjis, swe7, tis620, ucs2, ujis, utf8. See Section
4141 9.2, "The Character Set Used for Data and Sorting."
4142 (Additional character sets might be available. Check the
4143 output from ./configure --help for the current list.)
4144 The default collation may also be specified. MySQL uses the
4145 latin1_swedish_ci collation by default. To change this, use
4146 the --with-collation option:
4147 shell> ./configure --with-collation=COLLATION
4148 To change both the character set and the collation, use both
4149 the --with-charset and --with-collation options. The collation
4150 must be a legal collation for the character set. (Use the SHOW
4151 COLLATION statement to determine which collations are
4152 available for each character set.)
4153
4154 Warning
4155 If you change character sets after having created any tables,
4156 you must run myisamchk -r -q --set-collation=collation_name on
4157 every MyISAM table. Your indexes may be sorted incorrectly
4158 otherwise. This can happen if you install MySQL, create some
4159 tables, and then reconfigure MySQL to use a different
4160 character set and reinstall it.
4161 With the configure option --with-extra-charsets=LIST, you can
4162 define which additional character sets should be compiled into
4163 the server. LIST is one of the following:
4164 + A list of character set names separated by spaces
4165 + complex to include all character sets that can't be
4166 dynamically loaded
4167 + all to include all character sets into the binaries
4168 Clients that want to convert characters between the server and
4169 the client should use the SET NAMES statement. See Section
4170 5.1.4, "Session System Variables," and Section 9.1.4,
4171 "Connection Character Sets and Collations."
4172 * To configure MySQL with debugging code, use the --with-debug
4173 option:
4174 shell> ./configure --with-debug
4175 This causes a safe memory allocator to be included that can
4176 find some errors and that provides output about what is
4177 happening. See MySQL Internals: Porting
4178 (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
4179 As of MySQL 5.0.25, using --with-debug to configure MySQL with
4180 debugging support enables you to use the
4181 --debug="d,parser_debug" option when you start the server.
4182 This causes the Bison parser that is used to process SQL
4183 statements to dump a parser trace to the server's standard
4184 error output. Typically, this output is written to the error
4185 log.
4186 * If your client programs are using threads, you must compile a
4187 thread-safe version of the MySQL client library with the
4188 --enable-thread-safe-client configure option. This creates a
4189 libmysqlclient_r library with which you should link your
4190 threaded applications. See Section 26.2.16, "How to Make a
4191 Threaded Client."
4192 * Some features require that the server be built with
4193 compression library support, such as the COMPRESS() and
4194 UNCOMPRESS() functions, and compression of the client/server
4195 protocol. The --with-zlib-dir=no|bundled|DIR option provides
4196 control for compression library support. The value no
4197 explicitly disables compression support. bundled causes the
4198 zlib library bundled in the MySQL sources to be used. A DIR
4199 pathname specifies where to find the compression library
4200 sources.
4201 * It is possible to build MySQL 5.0 with large table support
4202 using the --with-big-tables option, beginning with MySQL
4203 5.0.4.
4204 This option causes the variables that store table row counts
4205 to be declared as unsigned long long rather than unsigned
4206 long. This enables tables to hold up to approximately
4207 1.844E+19 ((2^32)^2) rows rather than 2^32 (~4.295E+09) rows.
4208 Previously it was necessary to pass -DBIG_TABLES to the
4209 compiler manually in order to enable this feature.
4210 * Run configure with the --disable-grant-options option to cause
4211 the the --bootstrap, --skip-grant-tables, and --init-file
4212 options for mysqld to be disabled. For Windows, the
4213 configure.js script recognizes the DISABLE_GRANT_OPTIONS flag,
4214 which has the same effect. The capability is available as of
4215 MySQL 5.0.34.
4216 * In MySQL Community Server, this option enables the statement
4217 profiling capability exposed by the SHOW PROFILE and SHOW
4218 PROFILES statements. (See Section 12.5.5.25, "SHOW PROFILES
4219 and SHOW PROFILE Syntax.") The option was added in MySQL
4220 5.0.37.
4221 * See Section 2.4.19, "Operating System-Specific Notes," for
4222 options that pertain to particular operating systems.
4223 * See Section 5.5.7.2, "Using SSL Connections," for options that
4224 pertain to configuring MySQL to support secure (encrypted)
4225 connections.
4226
4227 2.4.15.3. Installing from the Development Source Tree
4228
4229 This section does not apply to MySQL Enterprise Server users.
4230
4231 Caution
4232
4233 You should read this section only if you are interested in helping
4234 us test our new code. If you just want to get MySQL up and running
4235 on your system, you should use a standard release distribution
4236 (either a binary or source distribution).
4237
4238 To obtain the most recent development source tree, you first need
4239 to download and install Bazaar. You can obtain Bazaar from the
4240 Bazaar VCS Website (http://bazaar-vcs.org). Bazaar is supported by
4241 any platform that supports Python, and is therefore compatible
4242 with any Linux, Unix, Windows or Mac OS X host. Instructions for
4243 downloading and installing Bazaar on the different platforms are
4244 available on the Bazaar website.
4245
4246 All MySQL projects are hosted on Launchpad
4247 (http://launchpad.net/). MySQL projects, including MySQL server,
4248 MySQL Workbench and others are available from the Sun/MySQL
4249 Engineering (http://launchpad.net/~mysql) page. For the
4250 repositories related only to MySQL server, see the MySQL Server
4251 (http://launchpad.net/mysql-server) page.
4252
4253 To build under Unix/Linux, you must have the following tools
4254 installed:
4255 * GNU make, available from http://www.gnu.org/software/make/.
4256 Although some platforms come with their own make
4257 implementations, it is highly recommended that you use GNU
4258 make. It may already be available on your system as gmake.
4259 * autoconf 2.58 (or newer), available from
4260 http://www.gnu.org/software/autoconf/.
4261 * automake 1.8.1, available from
4262 http://www.gnu.org/software/automake/.
4263 * libtool 1.5, available from
4264 http://www.gnu.org/software/libtool/.
4265 * m4, available from http://www.gnu.org/software/m4/.
4266 * bison, available from http://www.gnu.org/software/bison/. You
4267 should use the latest version of bison where possible. Version
4268 1.75 and version 2.1 are known to work. There have been
4269 reported problems with bison 1.875. If you experience
4270 problems, upgrade to a later, rather than earlier, version.
4271 Versions of bison older than 1.75 may report this error:
4272 sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded
4273 The maximum table size is not actually exceeded; the error is
4274 caused by bugs in older versions of bison.
4275
4276 To build under Windows you will need a copy of Microsoft Visual
4277 C++ 2005 Express Edition, Visual Studio .Net 2003 (7.1), or Visual
4278 Studio 2005 (8.0) compiler system.
4279
4280 Once you have the necessary tools installed, you first need to
4281 create a local branch of the MySQL source code on your machine:
4282 1. To obtain a copy of the MySQL source code, you must create a
4283 new Bazaar branch. If you do not already have a Bazaar
4284 repository directory set up, you need to initialize a new
4285 directory:
4286 shell> mkdir mysql-server
4287 shell> bzr init-repo --trees mysql-server
4288 Once you have an initialized directory, you can branch from
4289 the public MySQL server repositories. To create a branch of a
4290 specific version:
4291 shell> cd mysql-server
4292 shell> bzr branch lp:mysql-server/5.0 mysql-5.0
4293 The initial download will take some time to complete,
4294 depending on the speed of your connection. Please be patient.
4295 Once you have downloaded the first tree, additional trees
4296 should take significantly less time to download.
4297 When building from the Bazaar branch, you may want to create a
4298 copy of your active branch so that you can make configuration
4299 and other changes without affecting the original branch
4300 contents. You can achieve this by branching from the original
4301 branch:
4302 shell> bzr branch mysql-5.0 mysql-5.0-build
4303
4304 Once you have the local branch, you can start to build MySQL
4305 server from the source code. On Windows, the build process is
4306 different from Unix/Linux. To continue building MySQL on Windows,
4307 see Section 2.4.15.6, "Installing MySQL from Source on Windows."
4308
4309 On Unix/Linux you need to use the autoconf system to create the
4310 configure script so that you can configure the build environment
4311 before building.
4312 1. The following example shows the typical commands required to
4313 configure a source tree. The first cd command changes location
4314 into the top-level directory of the tree; replace mysql-5.0
4315 with the appropriate directory name.
4316
4317 Note
4318 For MySQL 5.1.12 and earlier, you must separately configure
4319 the INNODB storage engine. You can do this by running the
4320 following command from the main source directory:
4321 shell> cd mysql-5.0
4322 shell> (cd bdb/deist; sh s_all)
4323 shell> (cd innobase; autoreconf --force --install)
4324 shell> autoreconf --force --install
4325 shell> ./configure # Add your favorite options here
4326 shell> make
4327 Or you can use BUILD/autorun.sh as a shortcut for the
4328 following sequence of commands:
4329 shell> aclocal; autoheader
4330 shell> libtoolize --automake --force
4331 shell> automake --force --add-missing; autoconf
4332 shell> (cd bdb/deist; sh s_all)
4333 shell> (cd innobase; aclocal; autoheader; autoconf; automake)
4334 The command line that changes directory into the
4335 storage/innobase directory is used to configure the InnoDB
4336 storage engine. You can omit this lines if you do not require
4337 InnoDB support.
4338 If you get some strange errors during this stage, verify that
4339 you have the correct version of the libtool installed.
4340 A collection of our standard configuration scripts is located
4341 in the BUILD/ subdirectory. For example, you may find it more
4342 convenient to use the BUILD/compile-pentium-debug script than
4343 the preceding set of shell commands. To compile on a different
4344 architecture, modify the script by removing flags that are
4345 Pentium-specific, or use another script that may be more
4346 appropriate. These scripts are provided on an "as-is" basis.
4347 They are not officially maintained and their contents may
4348 change from release to release.
4349 2. When the build is done, run make install. Be careful with this
4350 on a production machine; the command may overwrite your live
4351 release installation. If you have another installation of
4352 MySQL, we recommend that you run ./configure with different
4353 values for the --prefix, --with-tcp-port, and
4354 --unix-socket-path options than those used for your production
4355 server.
4356 3. Play hard with your new installation and try to make the new
4357 features crash. Start by running make test. See Section
4358 28.1.2, "MySQL Test Suite."
4359 4. If you have gotten to the make stage, but the distribution
4360 does not compile, please enter the problem into our bugs
4361 database using the instructions given in Section 1.7, "How to
4362 Report Bugs or Problems." If you have installed the latest
4363 versions of the required GNU tools, and they crash trying to
4364 process our configuration files, please report that also.
4365 However, if you execute aclocal and get a command not found
4366 error or a similar problem, do not report it. Instead, make
4367 sure that all the necessary tools are installed and that your
4368 PATH variable is set correctly so that your shell can find
4369 them.
4370 5. After initially copying the repository with bzr to obtain the
4371 source tree, you should use pull option to periodically update
4372 your local copy. To do this any time after you have set up the
4373 repository, use this command:
4374 shell> bzr pull
4375 6. You can examine the changeset comments for the tree by using
4376 the log option to bzr:
4377 shell> bzr log
4378 You can also browse changesets, comments, and source code
4379 online. To browse this information for MySQL 5.0, go to
4380 http://launchpad.net/mysql-server/.
4381 If you see diffs or code that you have a question about, do
4382 not hesitate to send email to the MySQL internals mailing
4383 list. See Section 1.6.1, "MySQL Mailing Lists." Also, if you
4384 think you have a better idea on how to do something, send an
4385 email message to the list with a patch.
4386
4387 2.4.15.4. Dealing with Problems Compiling MySQL
4388
4389 This section does not apply to MySQL Enterprise Server users.
4390
4391 All MySQL programs compile cleanly for us with no warnings on
4392 Solaris or Linux using gcc. On other systems, warnings may occur
4393 due to differences in system include files. See Section 2.4.15.5,
4394 "MIT-pthreads Notes," for warnings that may occur when using
4395 MIT-pthreads. For other problems, check the following list.
4396
4397 The solution to many problems involves reconfiguring. If you do
4398 need to reconfigure, take note of the following:
4399 * If configure is run after it has previously been run, it may
4400 use information that was gathered during its previous
4401 invocation. This information is stored in config.cache. When
4402 configure starts up, it looks for that file and reads its
4403 contents if it exists, on the assumption that the information
4404 is still correct. That assumption is invalid when you
4405 reconfigure.
4406 * Each time you run configure, you must run make again to
4407 recompile. However, you may want to remove old object files
4408 from previous builds first because they were compiled using
4409 different configuration options.
4410
4411 To prevent old configuration information or object files from
4412 being used, run these commands before re-running configure:
4413 shell> rm config.cache
4414 shell> make clean
4415
4416 Alternatively, you can run make distclean.
4417
4418 The following list describes some of the problems when compiling
4419 MySQL that have been found to occur most often:
4420 * If you get errors such as the ones shown here when compiling
4421 sql_yacc.cc, you probably have run out of memory or swap
4422 space:
4423 Internal compiler error: program cc1plus got fatal signal 11
4424 Out of virtual memory
4425 Virtual memory exhausted
4426 The problem is that gcc requires a huge amount of memory to
4427 compile sql_yacc.cc with inline functions. Try running
4428 configure with the --with-low-memory option:
4429 shell> ./configure --with-low-memory
4430 This option causes -fno-inline to be added to the compile line
4431 if you are using gcc and -O0 if you are using something else.
4432 You should try the --with-low-memory option even if you have
4433 so much memory and swap space that you think you can't
4434 possibly have run out. This problem has been observed to occur
4435 even on systems with generous hardware configurations, and the
4436 --with-low-memory option usually fixes it.
4437 * By default, configure picks c++ as the compiler name and GNU
4438 c++ links with -lg++. If you are using gcc, that behavior can
4439 cause problems during configuration such as this:
4440 configure: error: installation or configuration problem:
4441 C++ compiler cannot create executables.
4442 You might also observe problems during compilation related to
4443 g++, libg++, or libstdc++.
4444 One cause of these problems is that you may not have g++, or
4445 you may have g++ but not libg++, or libstdc++. Take a look at
4446 the config.log file. It should contain the exact reason why
4447 your C++ compiler didn't work. To work around these problems,
4448 you can use gcc as your C++ compiler. Try setting the
4449 environment variable CXX to "gcc -O3". For example:
4450 shell> CXX="gcc -O3" ./configure
4451 This works because gcc compiles C++ source files as well as
4452 g++ does, but does not link in libg++ or libstdc++ by default.
4453 Another way to fix these problems is to install g++, libg++,
4454 and libstdc++. However, we recommend that you not use libg++
4455 or libstdc++ with MySQL because this only increases the binary
4456 size of mysqld without providing any benefits. Some versions
4457 of these libraries have also caused strange problems for MySQL
4458 users in the past.
4459 * If your compile fails with errors such as any of the
4460 following, you must upgrade your version of make to GNU make:
4461 making all in mit-pthreads
4462 make: Fatal error in reader: Makefile, line 18:
4463 Badly formed macro assignment
4464 Or:
4465 make: file `Makefile' line 18: Must be a separator (:
4466 Or:
4467 pthread.h: No such file or directory
4468 Solaris and FreeBSD are known to have troublesome make
4469 programs.
4470 GNU make 3.75 is known to work.
4471 * If you want to define flags to be used by your C or C++
4472 compilers, do so by adding the flags to the CFLAGS and
4473 CXXFLAGS environment variables. You can also specify the
4474 compiler names this way using CC and CXX. For example:
4475 shell> CC=gcc
4476 shell> CFLAGS=-O3
4477 shell> CXX=gcc
4478 shell> CXXFLAGS=-O3
4479 shell> export CC CFLAGS CXX CXXFLAGS
4480 See Section 2.4.3.4, "MySQL Binaries Compiled by MySQL AB,"
4481 for a list of flag definitions that have been found to be
4482 useful on various systems.
4483 * If you get errors such as those shown here when compiling
4484 mysqld, configure did not correctly detect the type of the
4485 last argument to accept(), getsockname(), or getpeername():
4486 cxx: Error: mysqld.cc, line 645: In this statement, the referenced
4487 type of the pointer value ''length'' is ''unsigned long'',
4488 which is not compatible with ''int''.
4489 new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
4490 To fix this, edit the config.h file (which is generated by
4491 configure). Look for these lines:
4492 /* Define as the base type of the last arg to accept */
4493 #define SOCKET_SIZE_TYPE XXX
4494 Change XXX to size_t or int, depending on your operating
4495 system. (You must do this each time you run configure because
4496 configure regenerates config.h.)
4497 * The sql_yacc.cc file is generated from sql_yacc.yy. Normally,
4498 the build process does not need to create sql_yacc.cc because
4499 MySQL comes with a pre-generated copy. However, if you do need
4500 to re-create it, you might encounter this error:
4501 "sql_yacc.yy", line xxx fatal: default action causes potential...
4502 This is a sign that your version of yacc is deficient. You
4503 probably need to install bison (the GNU version of yacc) and
4504 use that instead.
4505 * On Debian Linux 3.0, you need to install gawk instead of the
4506 default mawk if you want to compile MySQL with Berkeley DB
4507 support.
4508 * If you need to debug mysqld or a MySQL client, run configure
4509 with the --with-debug option, and then recompile and link your
4510 clients with the new client library. See MySQL Internals:
4511 Porting(http://forge.mysql.com/wiki/MySQL_Internals_Porting).
4512 * If you get a compilation error on Linux (for example, SuSE
4513 Linux 8.1 or Red Hat Linux 7.3) similar to the following one,
4514 you probably do not have g++ installed:
4515 libmysql.c:1329: warning: passing arg 5 of `gethostbyname_r' from
4516 incompatible pointer type
4517 libmysql.c:1329: too few arguments to function `gethostbyname_r'
4518 libmysql.c:1329: warning: assignment makes pointer from integer
4519 without a cast
4520 make[2]: *** [libmysql.lo] Error 1
4521 By default, the configure script attempts to determine the
4522 correct number of arguments by using g++ (the GNU C++
4523 compiler). This test yields incorrect results if g++ is not
4524 installed. There are two ways to work around this problem:
4525 + Make sure that the GNU C++ g++ is installed. On some
4526 Linux distributions, the required package is called gpp;
4527 on others, it is named gcc-c++.
4528 + Use gcc as your C++ compiler by setting the CXX
4529 environment variable to gcc:
4530 export CXX="gcc"
4531 You must run configure again after making either of those
4532 changes.
4533
4534 2.4.15.5. MIT-pthreads Notes
4535
4536 This section does not apply to MySQL Enterprise Server users.
4537
4538 This section describes some of the issues involved in using
4539 MIT-pthreads.
4540
4541 On Linux, you should not use MIT-pthreads. Use the installed
4542 LinuxThreads implementation instead. See Section 2.4.19.1, "Linux
4543 Notes."
4544
4545 If your system does not provide native thread support, you should
4546 build MySQL using the MIT-pthreads package. This includes older
4547 FreeBSD systems, SunOS 4.x, Solaris 2.4 and earlier, and some
4548 others. See Section 2.4.2, "Operating Systems Supported by MySQL
4549 Community Server."
4550
4551 MIT-pthreads is not part of the MySQL 5.0 source distribution. If
4552 you require this package, you need to download it separately from
4553 http://dev.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-mysql.t
4554 ar.gz
4555
4556 After downloading, extract this source archive into the top level
4557 of the MySQL source directory. It creates a new subdirectory named
4558 mit-pthreads.
4559 * On most systems, you can force MIT-pthreads to be used by
4560 running configure with the --with-mit-threads option:
4561 shell> ./configure --with-mit-threads
4562 Building in a non-source directory is not supported when using
4563 MIT-pthreads because we want to minimize our changes to this
4564 code.
4565 * The checks that determine whether to use MIT-pthreads occur
4566 only during the part of the configuration process that deals
4567 with the server code. If you have configured the distribution
4568 using --without-server to build only the client code, clients
4569 do not know whether MIT-pthreads is being used and use Unix
4570 socket file connections by default. Because Unix socket files
4571 do not work under MIT-pthreads on some platforms, this means
4572 you need to use -h or --host with a value other than localhost
4573 when you run client programs.
4574 * When MySQL is compiled using MIT-pthreads, system locking is
4575 disabled by default for performance reasons. You can tell the
4576 server to use system locking with the --external-locking
4577 option. This is needed only if you want to be able to run two
4578 MySQL servers against the same data files, but that is not
4579 recommended, anyway.
4580 * Sometimes the pthread bind() command fails to bind to a socket
4581 without any error message (at least on Solaris). The result is
4582 that all connections to the server fail. For example:
4583 shell> mysqladmin version
4584 mysqladmin: connect to server at '' failed;
4585 error: 'Can't connect to mysql server on localhost (146)'
4586 The solution to this problem is to kill the mysqld server and
4587 restart it. This has happened to us only when we have forcibly
4588 stopped the server and restarted it immediately.
4589 * With MIT-pthreads, the sleep() system call isn't interruptible
4590 with SIGINT (break). This is noticeable only when you run
4591 mysqladmin --sleep. You must wait for the sleep() call to
4592 terminate before the interrupt is served and the process
4593 stops.
4594 * When linking, you might receive warning messages like these
4595 (at least on Solaris); they can be ignored:
4596 ld: warning: symbol `_iob' has differing sizes:
4597 (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
4598 file /usr/lib/libc.so value=0x140);
4599 /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
4600 ld: warning: symbol `__iob' has differing sizes:
4601 (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
4602 file /usr/lib/libc.so value=0x140);
4603 /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
4604 * Some other warnings also can be ignored:
4605 implicit declaration of function `int strtoll(...)'
4606 implicit declaration of function `int strtoul(...)'
4607 * We have not been able to make readline work with MIT-pthreads.
4608 (This is not necessary, but may be of interest to some.)
4609
4610 2.4.15.6. Installing MySQL from Source on Windows
4611
4612 This section does not apply to MySQL Enterprise Server users.
4613
4614 These instructions describe how to build binaries from source for
4615 MySQL 5.0 on Windows. Instructions are provided for building
4616 binaries from a standard source distribution or from the Bazaar
4617 tree that contains the latest development source.
4618
4619 Note
4620
4621 The instructions here are strictly for users who want to test
4622 MySQL on Microsoft Windows from the latest source distribution or
4623 from the Bazaar tree. For production use, MySQL AB does not advise
4624 using a MySQL server built by yourself from source. Normally, it
4625 is best to use precompiled binary distributions of MySQL that are
4626 built specifically for optimal performance on Windows by MySQL AB.
4627 Instructions for installing binary distributions are available in
4628 Section 2.4.8, "Installing MySQL on Windows."
4629
4630 To build MySQL on Windows from source, you must satisfy the
4631 following system, compiler, and resource requirements:
4632 * Windows 2000, Windows XP, or newer version.
4633 Windows Vista is supported when using Visual Studio 2005
4634 provided you have installed the following updates:
4635 + Microsoft Visual Studio 2005 Professional Edition - ENU
4636 Service Pack 1 (KB926601)
4637 (http://support.microsoft.com/?kbid=926601)
4638 + Security Update for Microsoft Visual Studio 2005
4639 Professional Edition - ENU (KB937061)
4640 (http://support.microsoft.com/?kbid=937061)
4641 + Update for Microsoft Visual Studio 2005 Professional
4642 Edition - ENU (KB932232)
4643 (http://support.microsoft.com/?kbid=932232)
4644 * To build from the standard source distribution, you will need
4645 CMake, which can be downloaded from http://www.cmake.org.
4646 After installing, modify your path to include the cmake
4647 binary.
4648 * Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net
4649 2003 (7.1), or Visual Studio 2005 (8.0) compiler system.
4650 * If you are using Visual C++ 2005 Express Edition, you must
4651 also install an appropriate Platform SDK. More information and
4652 links to downloads for various Windows platforms is available
4653 from
4654 http://www.microsoft.com/downloads/details.aspx?familyid=0baf2
4655 b35-c656-4969-ace8-e4c0c0716adb/.
4656 * If you are compiling from a Bazaar tree or making changes to
4657 the parser, you need bison for Windows, which can be
4658 downloaded from
4659 http://gnuwin32.sourceforge.net/packages/bison.htm.Download
4660 the package labeled "Complete package, excluding sources".
4661 After installing the package, modify your path to include the
4662 bison binary and ensure that this binary is accessible from
4663 Visual Studio.
4664 * Cygwin might be necessary if you want to run the test script
4665 or package the compiled binaries and support files into a Zip
4666 archive. (Cygwin is needed only to test or package the
4667 distribution, not to build it.) Cygwin is available from
4668 http://cygwin.com.
4669 * 3GB to 5GB of disk space.
4670
4671 The exact system requirements can be found here:
4672 http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as
4673 px and
4674 http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx
4675
4676 There are three solutions available for building from the source
4677 code on Windows:
4678 * Build from the standard MySQL source distribution. For this
4679 you will need CMake and Visual C++ Express Edition or Visual
4680 Studio. Using this method you can select the storage engines
4681 that are included in your build. To use this method, see
4682 Section 2.4.15.6.1, "Building MySQL from the Standard Source
4683 Distribution."
4684 * Build from the MySQL Windows source distribution. The Windows
4685 source distribution includes ready-made Visual Studio solution
4686 files that enable support for all storage engines (except
4687 NDB). To build using using method you only need Visual C++
4688 Express Edition or Visual Studio. To use this method, see
4689 Section 2.4.15.6.2, "Building MySQL from a Windows Source
4690 Distribution."
4691 * Build directly from the Bazaar source repository. For this you
4692 will need CMake, Visual C++ Express Edition or Visual Studio,
4693 and bison. For this method you need to create the distribution
4694 on a Unix system and then copy the generated files to your
4695 Windows build environment. To use this method, see Section
4696 2.4.15.6.5, "Creating a Windows Source Package from the Bazaar
4697 Repository."
4698
4699 If you find something not working as expected, or you have
4700 suggestions about ways to improve the current build process on
4701 Windows, please send a message to the win32 mailing list. See
4702 Section 1.6.1, "MySQL Mailing Lists."
4703
4704 2.4.15.6.1. Building MySQL from the Standard Source Distribution
4705
4706 This section does not apply to MySQL Enterprise Server users.
4707
4708 You can build MySQL on Windows by using a combination of cmake and
4709 Microsoft Visual Studio .NET 2003 (7.1), Micrsofot Visual Studio
4710 2005 (8.0) or Microsoft Visual C++ 2005 Express Edition. You must
4711 have the appropriate Microsoft Platform SDK installed.
4712
4713 Note
4714
4715 To compile from the source code usin CMake you must use the
4716 standard source distribution (for example, mysql-5.0.45.tar.gz).
4717 You build from the same distribution as used to build MySQL on
4718 Unix, Linux and other platforms. Do not use the Windows Source
4719 distributions as they do not contain the necessary configuration
4720 script and other files.
4721
4722 Follow this procedure to build MySQL:
4723 1. If you are installing from a packaged source distribution,
4724 create a work directory (for example, C:\workdir), and unpack
4725 the source distribution there using WinZip or another Windows
4726 tool that can read .zip files. This directory is the work
4727 directory in the following instructions.
4728 2. If you are installing from a Bazaar tree, the root directory
4729 of that tree is the work directory in the following
4730 instructions.
4731 3. Using a command shell, navigate to the work directory and run
4732 the following command:
4733 C:\workdir>win\configure options
4734 These options are available:
4735 + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage
4736 engine.
4737 + WITH_PARTITION_STORAGE_ENGINE: Enable user-defined
4738 partitioning.
4739 + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage
4740 engine.
4741 + WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE
4742 storage engine.
4743 + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage
4744 engine.
4745 + WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED
4746 storage engine.
4747 + __NT__: Enable support for named pipes.
4748 + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none.
4749 + COMPILATION_COMMENT=comment: Server comment, default
4750 "Source distribution".
4751 + MYSQL_TCP_PORT=port: Server port, default 3306.
4752 + DISABLE_GRANT_OPTIONS: Disables the the --bootstrap,
4753 --skip-grant-tables, and --init-file options for mysqld.
4754 This option is available as of MySQL 5.0.36.
4755 For example (type the command on one line):
4756 C:\workdir>win\configure WITH_INNOBASE_STORAGE_ENGINE ��
4757 WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
4758 4. From the work directory, execute the win\build-vs8.bat or
4759 win\build-vs71.bat file, depending on the version of Visual
4760 Studio you have installed. The script invokes CMake, which
4761 generates the mysql.sln solution file you will need to build
4762 MySQL using Visual Studio..
4763 You can also use win\build-vs8_x64.bat to build the 64-bit
4764 version of MySQL. However, you cannot build the 64-bit version
4765 with Visual Studio Express Edition. You must use Visual Studio
4766 2005 (8.0) or higher.
4767 5. From the work directory, open the generated mysql.sln file
4768 with Visual Studio and select the proper configuration using
4769 the Configuration menu. The menu provides Debug, Release,
4770 RelwithDebInfo, MinRelInfo options. Then select Solution >
4771 Build to build the solution.
4772 The build process will take some time. Please be patient.
4773 Remember the configuration that you use in this step. It is
4774 important later when you run the test script because that
4775 script needs to know which configuration you used.
4776 6. You should test you build before installation. See Section
4777 2.4.15.6.4, "Testing a Windows Source Build."
4778 7. To install, use the instructions in Section 2.4.15.6.3,
4779 "Installing MySQL from a Source Build on Windows."
4780
4781 2.4.15.6.2. Building MySQL from a Windows Source Distribution
4782
4783 This section does not apply to MySQL Enterprise Server users.
4784
4785 The Windows source distribution includes the necessary solution
4786 file and the vcproj files required to build each component. Using
4787 this method you are not able to select the storage engines that
4788 are included in your build.
4789
4790 Note
4791
4792 VC++ workspace files for MySQL 4.1 and above are compatible with
4793 Microsoft Visual Studio 7.1 and tested by MySQL AB staff before
4794 each release.
4795
4796 Follow this procedure to build MySQL:
4797 1. Create a work directory (for example, C:\workdir).
4798 2. Unpack the source distribution in the aforementioned directory
4799 using WinZip or another Windows tool that can read .zip files.
4800 3. Start Visual Studio .Net 2003 (7.1).
4801 4. From the File menu, select Open Solution....
4802 5. Open the mysql.sln solution you find in the work directory.
4803 6. From the Build menu, select Configuration Manager....
4804 7. In the Active Solution Configuration pop-up menu, select the
4805 configuration to use. You likely want to use one of nt (normal
4806 server), Max nt (more engines and features), or Debug
4807 configuration.
4808 8. From the Build menu, select Build Solution.
4809 9. Debug versions of the programs and libraries are placed in the
4810 client_debug and lib_debug directories. Release versions of
4811 the programs and libraries are placed in the client_release
4812 and lib_release directories.
4813 10. You should test you build before installation. See Section
4814 2.4.15.6.4, "Testing a Windows Source Build."
4815 11. To install, use the instructions in Section 2.4.15.6.3,
4816 "Installing MySQL from a Source Build on Windows."
4817
4818 2.4.15.6.3. Installing MySQL from a Source Build on Windows
4819
4820 When you are satisfied that the program you have built is working
4821 correctly, stop the server. Now you can install the distribution.
4822 There are two ways to do this, either by using the supplied
4823 installation script or by copying the files individually by hand.
4824
4825 To use the script method you must have Cygwin installed as the
4826 script is a Shell script. To execute the installation process, run
4827 the make_win_bin_dist script in the scripts directory of the MySQL
4828 source distribution (see Section 4.4.2, "make_win_bin_dist ---
4829 Package MySQL Distribution as ZIP Archive"). This is a shell
4830 script, so you must have Cygwin installed if you want to use it.
4831 It creates a Zip archive of the built executables and support
4832 files that you can unpack to your desired installation location.
4833
4834 It is also possible to install MySQL by copying directories and
4835 files manually:
4836 1. Create the directories where you want to install MySQL. For
4837 example, to install into C:\mysql, use these commands:
4838 C:\> mkdir C:\mysql
4839 C:\> mkdir C:\mysql\bin
4840 C:\> mkdir C:\mysql\data
4841 C:\> mkdir C:\mysql\share
4842 C:\> mkdir C:\mysql\scripts
4843 If you want to compile other clients and link them to MySQL,
4844 you should also create several additional directories:
4845 C:\> mkdir C:\mysql\include
4846 C:\> mkdir C:\mysql\lib
4847 C:\> mkdir C:\mysql\lib\debug
4848 C:\> mkdir C:\mysql\lib\opt
4849 If you want to benchmark MySQL, create this directory:
4850 C:\> mkdir C:\mysql\sql-bench
4851 Benchmarking requires Perl support. See Section 2.4.21, "Perl
4852 Installation Notes."
4853 2. From the work directory, copy into the C:\mysql directory the
4854 following directories:
4855 C:\> cd \workdir
4856 C:\workdir> copy client_release\*.exe C:\mysql\bin
4857 C:\workdir> copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.ex
4858 e
4859 C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E
4860 C:\workdir> xcopy share\*.* C:\mysql\share /E
4861 If you want to compile other clients and link them to MySQL,
4862 you should also copy several libraries and header files:
4863 C:\workdir> copy lib_debug\mysqlclient.lib C:\mysql\lib\debug
4864 C:\workdir> copy lib_debug\libmysql.* C:\mysql\lib\debug
4865 C:\workdir> copy lib_debug\zlib.* C:\mysql\lib\debug
4866 C:\workdir> copy lib_release\mysqlclient.lib C:\mysql\lib\opt
4867 C:\workdir> copy lib_release\libmysql.* C:\mysql\lib\opt
4868 C:\workdir> copy lib_release\zlib.* C:\mysql\lib\opt
4869 C:\workdir> copy include\*.h C:\mysql\include
4870 C:\workdir> copy libmysql\libmysql.def C:\mysql\include
4871 If you want to benchmark MySQL, you should also do this:
4872 C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E
4873
4874 After installation, set up and start the server in the same way as
4875 for binary Windows distributions. See Section 2.4.8, "Installing
4876 MySQL on Windows."
4877
4878 2.4.15.6.4. Testing a Windows Source Build
4879
4880 You should test the server that you have built from source before
4881 using the distribution.
4882
4883 To test the server you need to run the built mysqld. By default,
4884 using the source build examples, the MySQL base directory and data
4885 directory are C:\mysql and C:\mysql\data. If you want to test your
4886 server using the source tree root directory and its data directory
4887 as the base directory and data directory, you need to tell the
4888 server their pathnames. You can either do this on the command line
4889 with the --basedir and --datadir options, or by placing
4890 appropriate options in an option file. (See Section 4.2.3.2,
4891 "Using Option Files.") If you have an existing data directory
4892 elsewhere that you want to use, you can specify its pathname
4893 instead.
4894
4895 When the server is running in standalone fashion or as a service
4896 based on your configuration, try to connect to it from the mysql
4897 interactive command-line utility.
4898
4899 You can also run the standard test script, mysql-test-run.pl. This
4900 script is written in Perl, so you'll need either Cygwin or
4901 ActiveState Perl to run it. You may also need to install the
4902 modules required by the script. To run the test script, change
4903 location into the mysql-test directory under the work directory,
4904 set the MTR_VS_CONFIG environment variable to the configuration
4905 you selected earlier (or use the --vs-config option), and invoke
4906 mysql-test-run.pl. For example (using Cygwin and the bash shell):
4907 shell> cd mysql-test
4908 shell> export MTS_VS_CONFIG=debug
4909 shell> ./mysqltest-run.pl --force --timer
4910 shell> ./mysqltest-run.pl --force --timer --ps-protocol
4911
4912 2.4.15.6.5. Creating a Windows Source Package from the Bazaar
4913 Repository
4914
4915 This section does not apply to MySQL Enterprise Server users.
4916
4917 To create a Windows source package from the current Bazaar source
4918 tree, use the instructions here. This procedure must be performed
4919 on a system running a Unix or Unix-like operating system because
4920 some of the configuration and build steps require tools that work
4921 only on Unix. For example, the following procedure is known to
4922 work well on Linux.
4923 1. Copy the Bazaar source tree for MySQL 5.0. For instructions on
4924 how to do this, see Section 2.4.15.3, "Installing from the
4925 Development Source Tree."
4926 2. Configure and build the distribution so that you have a server
4927 binary to work with. One way to do this is to run the
4928 following command in the top-level directory of your source
4929 tree:
4930 shell> ./BUILD/compile-pentium-max
4931 3. After making sure that the build process completed
4932 successfully, run the following utility script from top-level
4933 directory of your source tree:
4934 shell> ./scripts/make_win_src_distribution
4935 This script creates a Windows source package to be used on
4936 your Windows system. You can supply different options to the
4937 script based on your needs. See Section 4.4.3,
4938 "make_win_src_distribution --- Create Source Distribution for
4939 Windows," for a list of allowable options.
4940 By default, make_win_src_distribution creates a Zip-format
4941 archive with the name mysql-VERSION-win-src.zip, where VERSION
4942 represents the version of your MySQL source tree.
4943 4. Copy or upload the Windows source package that you have just
4944 created to your Windows machine. To compile it, use the
4945 instructions in Section 2.4.15.6.2, "Building MySQL from a
4946 Windows Source Distribution."
4947
4948 2.4.15.7. Compiling MySQL Clients on Windows
4949
4950 This section does not apply to MySQL Enterprise Server users.
4951
4952 In your source files, you should include my_global.h before
4953 mysql.h:
4954 #include <my_global.h>
4955 #include <mysql.h>
4956
4957 my_global.h includes any other files needed for Windows
4958 compatibility (such as windows.h) if you compile your program on
4959 Windows.
4960
4961 You can either link your code with the dynamic libmysql.lib
4962 library, which is just a wrapper to load in libmysql.dll on
4963 demand, or link with the static mysqlclient.lib library.
4964
4965 The MySQL client libraries are compiled as threaded libraries, so
4966 you should also compile your code to be multi-threaded.
4967
4968 2.4.16. Post-Installation Setup and Testing
4969
4970 After installing MySQL, there are some issues that you should
4971 address. For example, on Unix, you should initialize the data
4972 directory and create the MySQL grant tables. On all platforms, an
4973 important security concern is that the initial accounts in the
4974 grant tables have no passwords. You should assign passwords to
4975 prevent unauthorized access to the MySQL server. Optionally, you
4976 can create time zone tables to enable recognition of named time
4977 zones.
4978
4979 The following sections include post-installation procedures that
4980 are specific to Windows systems and to Unix systems. Another
4981 section, Section 2.4.16.2.3, "Starting and Troubleshooting the
4982 MySQL Server," applies to all platforms; it describes what to do
4983 if you have trouble getting the server to start. Section 2.4.16.3,
4984 "Securing the Initial MySQL Accounts," also applies to all
4985 platforms. You should follow its instructions to make sure that
4986 you have properly protected your MySQL accounts by assigning
4987 passwords to them.
4988
4989 When you are ready to create additional user accounts, you can
4990 find information on the MySQL access control system and account
4991 management in Section 5.4, "The MySQL Access Privilege System,"
4992 and Section 5.5, "MySQL User Account Management."
4993
4994 2.4.16.1. Windows Post-Installation Procedures
4995
4996 On Windows, the data directory and the grant tables do not have to
4997 be created. MySQL Windows distributions include the grant tables
4998 with a set of preinitialized accounts in the mysql database under
4999 the data directory. It is unnecessary to run the mysql_install_db
5000 script that is used on Unix. Regarding passwords, if you installed
5001 MySQL using the Windows Installation Wizard, you may have already
5002 assigned passwords to the accounts. (See Section 2.4.8.3, "Using
5003 the MySQL Installation Wizard.") Otherwise, use the
5004 password-assignment procedure given in Section 2.4.16.3, "Securing
5005 the Initial MySQL Accounts."
5006
5007 Before setting up passwords, you might want to try running some
5008 client programs to make sure that you can connect to the server
5009 and that it is operating properly. Make sure that the server is
5010 running (see Section 2.4.8.9, "Starting the Server for the First
5011 Time"), and then issue the following commands to verify that you
5012 can retrieve information from the server. The output should be
5013 similar to what is shown here:
5014 C:\> C:\mysql\bin\mysqlshow
5015 +--------------------+
5016 | Databases |
5017 +--------------------+
5018 | information_schema |
5019 | mysql |
5020 | test |
5021 +--------------------+
5022
5023 C:\> C:\mysql\bin\mysqlshow mysql
5024 Database: mysql
5025 +---------------------------+
5026 | Tables |
5027 +---------------------------+
5028 | columns_priv |
5029 | db |
5030 | func |
5031 | help_category |
5032 | help_keyword |
5033 | help_relation |
5034 | help_topic |
5035 | host |
5036 | proc |
5037 | procs_priv |
5038 | tables_priv |
5039 | time_zone |
5040 | time_zone_leap_second |
5041 | time_zone_name |
5042 | time_zone_transition |
5043 | time_zone_transition_type |
5044 | user |
5045 +---------------------------+
5046
5047 C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM db" mysql
5048 +------+-------+------+
5049 | host | db | user |
5050 +------+-------+------+
5051 | % | test% | |
5052 +------+-------+------+
5053
5054 You may need to specify a different directory from the one shown;
5055 if you used the Windows Installation Wizard, then the default
5056 directory is C:\Program Files\MySQL\MySQL Server 5.0, and the
5057 mysql and mysqlshow client programs are in C:\Program
5058 Files\MySQL\MySQL Server 5.0\bin. See Section 2.4.8.3, "Using the
5059 MySQL Installation Wizard," for more information.
5060
5061 If you have already secured the initial MySQL accounts, you may
5062 need to use the -u and -p options to supply a username and
5063 password to the mysqlshow and mysql client programs; otherwise the
5064 programs may fail with an error, or you may not be able to view
5065 all databases. For example, if you have assigned the password
5066 "secretpass" to the MySQL root account, then you can invoke
5067 mysqlshowand mysql as shown here:
5068 C:\> C:\mysql\bin\mysqlshow -uroot -psecretpass
5069 +--------------------+
5070 | Databases |
5071 +--------------------+
5072 | information_schema |
5073 | mysql |
5074 | test |
5075 +--------------------+
5076
5077 C:\> C:\mysql\bin\mysqlshow -uroot -psecretpass mysql
5078 Database: mysql
5079 +---------------------------+
5080 | Tables |
5081 +---------------------------+
5082 | columns_priv |
5083 | db |
5084 | func |
5085 | help_category |
5086 | help_keyword |
5087 | help_relation |
5088 | help_topic |
5089 | host |
5090 | proc |
5091 | procs_priv |
5092 | tables_priv |
5093 | time_zone |
5094 | time_zone_leap_second |
5095 | time_zone_name |
5096 | time_zone_transition |
5097 | time_zone_transition_type |
5098 | user |
5099 +---------------------------+
5100
5101 C:\> C:\mysql\bin\mysql -uroot -psecretpass -e "SELECT Host,Db,User F
5102 ROM db" mysql
5103 +------+-------+------+
5104 | host | db | user |
5105 +------+-------+------+
5106 | % | test% | |
5107 +------+-------+------+
5108
5109 For more information about these programs, see Section 4.5.6,
5110 "mysqlshow --- Display Database, Table, and Column Information,"
5111 and Section 4.5.1, "mysql --- The MySQL Command-Line Tool."
5112
5113 If you are running a version of Windows that supports services and
5114 you want the MySQL server to run automatically when Windows
5115 starts, see Section 2.4.8.11, "Starting MySQL as a Windows
5116 Service."
5117
5118 2.4.16.2. Unix Post-Installation Procedures
5119
5120 After installing MySQL on Unix, you need to initialize the grant
5121 tables, start the server, and make sure that the server works
5122 satisfactorily. You may also wish to arrange for the server to be
5123 started and stopped automatically when your system starts and
5124 stops. You should also assign passwords to the accounts in the
5125 grant tables.
5126
5127 On Unix, the grant tables are set up by the mysql_install_db
5128 program. For some installation methods, this program is run for
5129 you automatically:
5130 * If you install MySQL on Linux using RPM distributions, the
5131 server RPM runs mysql_install_db.
5132 * If you install MySQL on Mac OS X using a PKG distribution, the
5133 installer runs mysql_install_db.
5134
5135 Otherwise, you will need to run mysql_install_db yourself.
5136
5137 The following procedure describes how to initialize the grant
5138 tables (if that has not previously been done) and then start the
5139 server. It also suggests some commands that you can use to test
5140 whether the server is accessible and working properly. For
5141 information about starting and stopping the server automatically,
5142 see Section 2.4.16.2.2, "Starting and Stopping MySQL
5143 Automatically."
5144
5145 After you complete the procedure and have the server running, you
5146 should assign passwords to the accounts created by
5147 mysql_install_db. Instructions for doing so are given in Section
5148 2.4.16.3, "Securing the Initial MySQL Accounts."
5149
5150 In the examples shown here, the server runs under the user ID of
5151 the mysql login account. This assumes that such an account exists.
5152 Either create the account if it does not exist, or substitute the
5153 name of a different existing login account that you plan to use
5154 for running the server.
5155 1. Change location into the top-level directory of your MySQL
5156 installation, represented here by BASEDIR:
5157 shell> cd BASEDIR
5158 BASEDIR is likely to be something like /usr/local/mysql or
5159 /usr/local. The following steps assume that you are located in
5160 this directory.
5161 2. If necessary, run the mysql_install_db program to set up the
5162 initial MySQL grant tables containing the privileges that
5163 determine how users are allowed to connect to the server.
5164 You'll need to do this if you used a distribution type for
5165 which the installation procedure doesn't run the program for
5166 you.
5167 Typically, mysql_install_db needs to be run only the first
5168 time you install MySQL, so you can skip this step if you are
5169 upgrading an existing installation, However, mysql_install_db
5170 does not overwrite any existing privilege tables, so it should
5171 be safe to run in any circumstances.
5172 To initialize the grant tables, use one of the following
5173 commands, depending on whether mysql_install_db is located in
5174 the bin or scripts directory:
5175 shell> bin/mysql_install_db --user=mysql
5176 shell> scripts/mysql_install_db --user=mysql
5177 The mysql_install_db script creates the server's data
5178 directory. Under the data directory, it creates directories
5179 for the mysql database that holds all database privileges and
5180 the test database that you can use to test MySQL. The script
5181 also creates privilege table entries for root and
5182 anonymous-user accounts. The accounts have no passwords
5183 initially. A description of their initial privileges is given
5184 in Section 2.4.16.3, "Securing the Initial MySQL Accounts."
5185 Briefly, these privileges allow the MySQL root user to do
5186 anything, and allow anybody to create or use databases with a
5187 name of test or starting with test_.
5188 It is important to make sure that the database directories and
5189 files are owned by the mysql login account so that the server
5190 has read and write access to them when you run it later. To
5191 ensure this, the --user option should be used as shown if you
5192 run mysql_install_db as root. Otherwise, you should execute
5193 the script while logged in as mysql, in which case you can
5194 omit the --user option from the command.
5195 mysql_install_db creates several tables in the mysql database,
5196 including user, db, host, tables_priv, columns_priv, func, and
5197 others. See Section 5.4, "The MySQL Access Privilege System,"
5198 for a complete listing and description of these tables.
5199 If you don't want to have the test database, you can remove it
5200 with mysqladmin -u root drop test after starting the server.
5201 If you have trouble with mysql_install_db at this point, see
5202 Section 2.4.16.2.1, "Problems Running mysql_install_db."
5203 3. Start the MySQL server:
5204 shell> bin/mysqld_safe --user=mysql &
5205 It is important that the MySQL server be run using an
5206 unprivileged (non-root) login account. To ensure this, the
5207 --user option should be used as shown if you run mysqld_safe
5208 as system root. Otherwise, you should execute the script while
5209 logged in to the system as mysql, in which case you can omit
5210 the --user option from the command.
5211 Further instructions for running MySQL as an unprivileged user
5212 are given in Section 5.3.5, "How to Run MySQL as a Normal
5213 User."
5214 If you neglected to create the grant tables before proceeding
5215 to this step, the following message appears in the error log
5216 file when you start the server:
5217 mysqld: Can't find file: 'host.frm'
5218 If you have other problems starting the server, see Section
5219 2.4.16.2.3, "Starting and Troubleshooting the MySQL Server."
5220 4. Use mysqladmin to verify that the server is running. The
5221 following commands provide simple tests to check whether the
5222 server is up and responding to connections:
5223 shell> bin/mysqladmin version
5224 shell> bin/mysqladmin variables
5225 The output from mysqladmin version varies slightly depending
5226 on your platform and version of MySQL, but should be similar
5227 to that shown here:
5228 shell> bin/mysqladmin version
5229 mysqladmin Ver 14.12 Distrib 5.0.68, for pc-linux-gnu on i686
5230 Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
5231 This software comes with ABSOLUTELY NO WARRANTY. This is free softwar
5232 e,
5233 and you are welcome to modify and redistribute it under the GPL licen
5234 se
5235
5236 Server version 5.0.68
5237 Protocol version 10
5238 Connection Localhost via UNIX socket
5239 UNIX socket /var/lib/mysql/mysql.sock
5240 Uptime: 14 days 5 hours 5 min 21 sec
5241
5242 Threads: 1 Questions: 366 Slow queries: 0
5243 Opens: 0 Flush tables: 1 Open tables: 19
5244 Queries per second avg: 0.000
5245 To see what else you can do with mysqladmin, invoke it with
5246 the --help option.
5247 5. Verify that you can shut down the server:
5248 shell> bin/mysqladmin -u root shutdown
5249 6. Verify that you can start the server again. Do this by using
5250 mysqld_safe or by invoking mysqld directly. For example:
5251 shell> bin/mysqld_safe --user=mysql --log &
5252 If mysqld_safe fails, see Section 2.4.16.2.3, "Starting and
5253 Troubleshooting the MySQL Server."
5254 7. Run some simple tests to verify that you can retrieve
5255 information from the server. The output should be similar to
5256 what is shown here:
5257 shell> bin/mysqlshow
5258 +-----------+
5259 | Databases |
5260 +-----------+
5261 | mysql |
5262 | test |
5263 +-----------+
5264
5265 shell> bin/mysqlshow mysql
5266 Database: mysql
5267 +---------------------------+
5268 | Tables |
5269 +---------------------------+
5270 | columns_priv |
5271 | db |
5272 | func |
5273 | help_category |
5274 | help_keyword |
5275 | help_relation |
5276 | help_topic |
5277 | host |
5278 | proc |
5279 | procs_priv |
5280 | tables_priv |
5281 | time_zone |
5282 | time_zone_leap_second |
5283 | time_zone_name |
5284 | time_zone_transition |
5285 | time_zone_transition_type |
5286 | user |
5287 +---------------------------+
5288
5289 shell> bin/mysql -e "SELECT Host,Db,User FROM db" mysql
5290 +------+--------+------+
5291 | host | db | user |
5292 +------+--------+------+
5293 | % | test | |
5294 | % | test_% | |
5295 +------+--------+------+
5296 8. There is a benchmark suite in the sql-bench directory (under
5297 the MySQL installation directory) that you can use to compare
5298 how MySQL performs on different platforms. The benchmark suite
5299 is written in Perl. It requires the Perl DBI module that
5300 provides a database-independent interface to the various
5301 databases, and some other additional Perl modules:
5302 DBI
5303 DBD::mysql
5304 Data::Dumper
5305 Data::ShowTable
5306 These modules can be obtained from CPAN
5307 (http://www.cpan.org/). See also Section 2.4.21.1, "Installing
5308 Perl on Unix."
5309 The sql-bench/Results directory contains the results from many
5310 runs against different databases and platforms. To run all
5311 tests, execute these commands:
5312 shell> cd sql-bench
5313 shell> perl run-all-tests
5314 If you don't have the sql-bench directory, you probably
5315 installed MySQL using RPM files other than the source RPM.
5316 (The source RPM includes the sql-bench benchmark directory.)
5317 In this case, you must first install the benchmark suite
5318 before you can use it. There are separate benchmark RPM files
5319 named mysql-bench-VERSION.i386.rpm that contain benchmark code
5320 and data.
5321 If you have a source distribution, there are also tests in its
5322 tests subdirectory that you can run. For example, to run
5323 auto_increment.tst, execute this command from the top-level
5324 directory of your source distribution:
5325 shell> mysql -vvf test < ./tests/auto_increment.tst
5326 The expected result of the test can be found in the
5327 ./tests/auto_increment.res file.
5328 9. At this point, you should have the server running. However,
5329 none of the initial MySQL accounts have a password, so you
5330 should assign passwords using the instructions found in
5331 Section 2.4.16.3, "Securing the Initial MySQL Accounts."
5332
5333 The MySQL 5.0 installation procedure creates time zone tables in
5334 the mysql database. However, you must populate the tables manually
5335 using the instructions in Section 9.7, "MySQL Server Time Zone
5336 Support."
5337
5338 2.4.16.2.1. Problems Running mysql_install_db
5339
5340 This section does not apply to MySQL Enterprise Server users.
5341
5342 The purpose of the mysql_install_db script is to generate new
5343 MySQL privilege tables. It does not overwrite existing MySQL
5344 privilege tables, and it does not affect any other data.
5345
5346 If you want to re-create your privilege tables, first stop the
5347 mysqld server if it's running. Then rename the mysql directory
5348 under the data directory to save it, and then run
5349 mysql_install_db. Suppose that your current directory is the MySQL
5350 installation directory and that mysql_install_db is located in the
5351 bin directory and the data directory is named data. To rename the
5352 mysql database and re-run mysql_install_db, use these commands.
5353 shell> mv data/mysql data/mysql.old
5354 shell> bin/mysql_install_db --user=mysql
5355
5356 When you run mysql_install_db, you might encounter the following
5357 problems:
5358 * mysql_install_db fails to install the grant tables
5359 You may find that mysql_install_db fails to install the grant
5360 tables and terminates after displaying the following messages:
5361 Starting mysqld daemon with databases from XXXXXX
5362 mysqld ended
5363 In this case, you should examine the error log file very
5364 carefully. The log should be located in the directory XXXXXX
5365 named by the error message and should indicate why mysqld
5366 didn't start. If you do not understand what happened, include
5367 the log when you post a bug report. See Section 1.7, "How to
5368 Report Bugs or Problems."
5369 * There is a mysqld process running
5370 This indicates that the server is running, in which case the
5371 grant tables have probably been created already. If so, there
5372 is no need to run mysql_install_db at all because it needs to
5373 be run only once (when you install MySQL the first time).
5374 * Installing a second mysqld server does not work when one
5375 server is running
5376 This can happen when you have an existing MySQL installation,
5377 but want to put a new installation in a different location.
5378 For example, you might have a production installation, but you
5379 want to create a second installation for testing purposes.
5380 Generally the problem that occurs when you try to run a second
5381 server is that it tries to use a network interface that is in
5382 use by the first server. In this case, you should see one of
5383 the following error messages:
5384 Can't start server: Bind on TCP/IP port:
5385 Address already in use
5386 Can't start server: Bind on unix socket...
5387 For instructions on setting up multiple servers, see Section
5388 5.6, "Running Multiple MySQL Servers on the Same Machine."
5389 * You do not have write access to the /tmp directory
5390 If you do not have write access to create temporary files or a
5391 Unix socket file in the default location (the /tmp directory),
5392 an error occurs when you run mysql_install_db or the mysqld
5393 server.
5394 You can specify different locations for the temporary
5395 directory and Unix socket file by executing these commands
5396 prior to starting mysql_install_db or mysqld, where
5397 some_tmp_dir is the full pathname to some directory for which
5398 you have write permission:
5399 shell> TMPDIR=/some_tmp_dir/
5400 shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysql.sock
5401 shell> export TMPDIR MYSQL_UNIX_PORT
5402 Then you should be able to run mysql_install_db and start the
5403 server with these commands:
5404 shell> bin/mysql_install_db --user=mysql
5405 shell> bin/mysqld_safe --user=mysql &
5406 If mysql_install_db is located in the scripts directory,
5407 modify the first command to scripts/mysql_install_db.
5408 See Section B.1.4.5, "How to Protect or Change the MySQL Unix
5409 Socket File," and Section 2.4.20, "Environment Variables."
5410
5411 There are some alternatives to running the mysql_install_db script
5412 provided in the MySQL distribution:
5413 * If you want the initial privileges to be different from the
5414