Develop and Download Open Source Software

Browse Subversion Repository

Contents of /tags/tritonn-1.0.10-mysql-5.0.51a/INSTALL-SOURCE

Parent Directory Parent Directory | Revision Log Revision Log


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

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 BitKeeper
459 repositories. These are not "releases" as such, but are available
460 as previews of 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 25.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 6.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 6.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 BitKeeper
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 BitKeeper 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.56-linux-i686.tar.gz
1003 aaab65abbec64d5e907dcd41b8699945 mysql-standard-5.0.56-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.56-linux-i686.tar.gz
1101 Signature file mysql-standard-5.0.56-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.56-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.56-0.glibc23.i386.rpm
1132 MySQL-server-5.0.56-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 23, "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 11.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 The following section describes how to install MySQL on Windows
1317 using a binary distribution. To use an installation package that
1318 does not include an installer, follow the procedure described in
1319 Section 2.4.8.5, "Installing MySQL from a Noinstall Zip Archive."
1320 To install using a source distribution, see Section 2.4.15.6,
1321 "Installing MySQL from Source on Windows."
1322
1323 MySQL distributions for Windows can be downloaded from
1324 http://dev.mysql.com/downloads/. See Section 2.4.4, "How to Get
1325 MySQL."
1326
1327 2.4.8.1. Choosing An Installation Package
1328
1329 This section does not apply to MySQL Enterprise Server users.
1330
1331 For MySQL 5.0, there are three installation packages to choose
1332 from when installing MySQL on Windows:
1333 * The Essentials package. This package has a filename similar
1334 to mysql-essential-5.0.56-win32.msi and contains the minimum
1335 set of files needed to install MySQL on Windows, including the
1336 Configuration Wizard. This package does not include optional
1337 components such as the embedded server and benchmark suite.
1338 * The Complete package. This package has a filename similar to
1339 mysql-5.0.56-win32.zip and contains all files needed for a
1340 complete Windows installation, including the Configuration
1341 Wizard. This package includes optional components such as the
1342 embedded server and benchmark suite.
1343 * The no-install archive. This package has a filename similar
1344 to mysql-noinstall-5.0.56-win32.zip and contains all the files
1345 found in the Complete install package, with the exception of
1346 the Configuration Wizard. This package does not include an
1347 automated installer, and must be manually installed and
1348 configured.
1349
1350 The Essentials package is recommended for most users. It is
1351 provided as an .msi file for use with the Windows Installer. The
1352 Complete and Noinstall distributions are packaged as Zip archives.
1353 To use them, you must have a tool that can unpack .zip files.
1354
1355 Your choice of install package affects the installation process
1356 you must follow. If you choose to install either the Essentials or
1357 Complete install packages, see Section 2.4.8.2, "Installing MySQL
1358 with the Automated Installer." If you choose to install MySQL from
1359 the Noinstall archive, see Section 2.4.8.5, "Installing MySQL from
1360 a Noinstall Zip Archive."
1361
1362 2.4.8.2. Installing MySQL with the Automated Installer
1363
1364 New MySQL users can use the MySQL Installation Wizard and MySQL
1365 Configuration Wizard to install MySQL on Windows. These are
1366 designed to install and configure MySQL in such a way that new
1367 users can immediately get started using MySQL.
1368
1369 The MySQL Installation Wizard and MySQL Configuration Wizard are
1370 available in the Essentials and Complete install packages. They
1371 are recommended for most standard MySQL installations. Exceptions
1372 include users who need to install multiple instances of MySQL on a
1373 single server host and advanced users who want complete control of
1374 server configuration.
1375
1376 2.4.8.3. Using the MySQL Installation Wizard
1377
1378 2.4.8.3.1. Introduction to the Installation Wizard
1379
1380 MySQL Installation Wizard is an installer for the MySQL server
1381 that uses the latest installer technologies for Microsoft Windows.
1382 The MySQL Installation Wizard, in combination with the MySQL
1383 Configuration Wizard, allows a user to install and configure a
1384 MySQL server that is ready for use immediately after installation.
1385
1386 The MySQL Installation Wizard is the standard installer for all
1387 MySQL server distributions, version 4.1.5 and higher. Users of
1388 previous versions of MySQL need to shut down and remove their
1389 existing MySQL installations manually before installing MySQL with
1390 the MySQL Installation Wizard. See Section 2.4.8.3.7, "Upgrading
1391 MySQL with the Installation Wizard," for more information on
1392 upgrading from a previous version.
1393
1394 The Microsoft Windows Installer (MSI) is the standard for
1395 application installations on Windows 2000 and later versions. The
1396 MySQL Installation Wizard makes use of this technology to provide
1397 a smoother and more flexible installation process.
1398
1399 The Microsoft Windows Installer Engine was updated with the
1400 release of Windows XP; those using a previous version of Windows
1401 can reference this Microsoft Knowledge Base article
1402 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;292539)
1403 for information on upgrading to the latest version of the Windows
1404 Installer Engine.
1405
1406 In addition, Microsoft has introduced the WiX (Windows Installer
1407 XML) toolkit, which is the first highly acknowledged Open Source
1408 project from Microsoft. We have switched to WiX because it is an
1409 Open Source project and it allows us to handle the complete
1410 Windows installation process in a flexible manner using scripts.
1411
1412 Improving the MySQL Installation Wizard depends on the support and
1413 feedback of users. If you find that the MySQL Installation Wizard
1414 is lacking some feature important to you, or if you discover a
1415 bug, please report it in our bugs database using the instructions
1416 given in Section 1.7, "How to Report Bugs or Problems."
1417
1418 2.4.8.3.2. Downloading and Starting the MySQL Installation Wizard
1419
1420 MySQL installation packages can be downloaded from
1421 http://dev.mysql.com/downloads/. If the package you download is
1422 contained within a Zip archive, you need to extract the archive
1423 first.
1424
1425 Note
1426
1427 If you are installing on Windows Vista it is best to open a port
1428 for MySQL to use before beginning the installation. To do this,
1429 first ensure that you are logged in as an administrator, then go
1430 to the Control Panel and double-click the Windows Firewall icon.
1431 Choose the Allow a program through Windows Firewall option and
1432 click the Add port button. Enter MySQL into the Name text box and
1433 3306 (or other port of your choice) into the Port number text box.
1434 Also ensure that the TCP protocol radio button is selected. If you
1435 wish, you can also limit access to the MySQL server by choosing
1436 the Change scope button. Confirm your choices by clicking the OK
1437 button. If you do not open a port prior to installation, you
1438 cannot configure the MySQL server immediately after installation.
1439 Additionally, when running the MySQL Installation Wizard on
1440 Windows Vista, ensure that you are logged in as a user with
1441 administrative rights.
1442
1443 The process for starting the wizard depends on the contents of the
1444 installation package you download. If there is a setup.exe file
1445 present, double-click it to start the installation process. If
1446 there is an .msi file present, double-click it to start the
1447 installation process.
1448 MySQL Installer Main Screen (Windows)
1449
1450 2.4.8.3.3. Choosing an Installation Type
1451
1452 There are three installation types available: Typical, Complete,
1453 and Custom.
1454 MySQL Installer Setup type (Windows)
1455
1456 The Typical installation type installs the MySQL server, the mysql
1457 command-line client, and the command-line utilities. The
1458 command-line clients and utilities include mysqldump, myisamchk,
1459 and several other tools to help you manage the MySQL server.
1460
1461 The Complete installation type installs all components included in
1462 the installation package. The full installation package includes
1463 components such as the embedded server library, the benchmark
1464 suite, support scripts, and documentation.
1465
1466 The Custom installation type gives you complete control over which
1467 packages you wish to install and the installation path that is
1468 used. See Section 2.4.8.3.4, "The Custom Installation Dialog," for
1469 more information on performing a custom install.
1470
1471 If you choose the Typical or Complete installation types and click
1472 the Next button, you advance to the confirmation screen to verify
1473 your choices and begin the installation. If you choose the Custom
1474 installation type and click the Next button, you advance to the
1475 custom installation dialog, described in Section 2.4.8.3.4, "The
1476 Custom Installation Dialog."
1477
1478 2.4.8.3.4. The Custom Installation Dialog
1479
1480 This section does not apply to MySQL Enterprise Server users.
1481
1482 If you wish to change the installation path or the specific
1483 components that are installed by the MySQL Installation Wizard,
1484 choose the Custom installation type.
1485 MySQL Installer Custom Installation (Windows)
1486
1487 A tree view on the left side of the custom install dialog lists
1488 all available components. Components that are not installed have a
1489 red X icon; components that are installed have a gray icon. To
1490 change whether a component is installed, click on that component's
1491 icon and choose a new option from the drop-down list that appears.
1492
1493 You can change the default installation path by clicking the
1494 Change... button to the right of the displayed installation path.
1495
1496 After choosing your installation components and installation path,
1497 click the Next button to advance to the confirmation dialog.
1498
1499 2.4.8.3.5. The Confirmation Dialog
1500
1501 This section does not apply to MySQL Enterprise Server users.
1502
1503 Once you choose an installation type and optionally choose your
1504 installation components, you advance to the confirmation dialog.
1505 Your installation type and installation path are displayed for you
1506 to review.
1507 MySQL Installer Installation Summary (Windows)
1508
1509 To install MySQL if you are satisfied with your settings, click
1510 the Install button. To change your settings, click the Back
1511 button. To exit the MySQL Installation Wizard without installing
1512 MySQL, click the Cancel button.
1513
1514 After installation is complete, you have the option of registering
1515 with the MySQL web site. Registration gives you access to post in
1516 the MySQL forums at forums.mysql.com (http://forums.mysql.com),
1517 along with the ability to report bugs at bugs.mysql.com
1518 (http://bugs.mysql.com) and to subscribe to our newsletter. The
1519 final screen of the installer provides a summary of the
1520 installation and gives you the option to launch the MySQL
1521 Configuration Wizard, which you can use to create a configuration
1522 file, install the MySQL service, and configure security settings.
1523
1524 2.4.8.3.6. Changes Made by MySQL Installation Wizard
1525
1526 This section does not apply to MySQL Enterprise Server users.
1527
1528 Once you click the Install button, the MySQL Installation Wizard
1529 begins the installation process and makes certain changes to your
1530 system which are described in the sections that follow.
1531
1532 Changes to the Registry
1533
1534 The MySQL Installation Wizard creates one Windows registry key in
1535 a typical install situation, located in
1536 HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB.
1537
1538 The MySQL Installation Wizard creates a key named after the major
1539 version of the server that is being installed, such as MySQL
1540 Server 5.0. It contains two string values, Location and Version.
1541 The Location string contains the path to the installation
1542 directory. In a default installation it contains C:\Program
1543 Files\MySQL\MySQL Server 5.0\. The Version string contains the
1544 release number. For example, for an installation of MySQL Server
1545 5.0.56, the key contains a value of 5.0.56.
1546
1547 These registry keys are used to help external tools identify the
1548 installed location of the MySQL server, preventing a complete scan
1549 of the hard-disk to determine the installation path of the MySQL
1550 server. The registry keys are not required to run the server, and
1551 if you install MySQL using the noinstall Zip archive, the registry
1552 keys are not created.
1553
1554 Changes to the Start Menu
1555
1556 The MySQL Installation Wizard creates a new entry in the Windows
1557 Start menu under a common MySQL menu heading named after the major
1558 version of MySQL that you have installed. For example, if you
1559 install MySQL 5.0, the MySQL Installation Wizard creates a MySQL
1560 Server 5.0 section in the Start menu.
1561
1562 The following entries are created within the new Start menu
1563 section:
1564 * MySQL Command Line Client: This is a shortcut to the mysql
1565 command-line client and is configured to connect as the root
1566 user. The shortcut prompts for a root user password when you
1567 connect.
1568 * MySQL Server Instance Config Wizard: This is a shortcut to the
1569 MySQL Configuration Wizard. Use this shortcut to configure a
1570 newly installed server, or to reconfigure an existing server.
1571 * MySQL Documentation: This is a link to the MySQL server
1572 documentation that is stored locally in the MySQL server
1573 installation directory. This option is not available when the
1574 MySQL server is installed using the Essentials installation
1575 package.
1576
1577 Changes to the File System
1578
1579 The MySQL Installation Wizard by default installs the MySQL 5.0
1580 server to C:\Program Files\MySQL\MySQL Server 5.0, where Program
1581 Files is the default location for applications in your system, and
1582 5.0 is the major version of your MySQL server. This is the
1583 recommended location for the MySQL server, replacing the former
1584 default location C:\mysql.
1585
1586 By default, all MySQL applications are stored in a common
1587 directory at C:\Program Files\MySQL, where Program Files is the
1588 default location for applications in your Windows installation. A
1589 typical MySQL installation on a developer machine might look like
1590 this:
1591 C:\Program Files\MySQL\MySQL Server 5.0
1592 C:\Program Files\MySQL\MySQL Administrator 1.0
1593 C:\Program Files\MySQL\MySQL Query Browser 1.0
1594
1595 This approach makes it easier to manage and maintain all MySQL
1596 applications installed on a particular system.
1597
1598 2.4.8.3.7. Upgrading MySQL with the Installation Wizard
1599
1600 This section does not apply to MySQL Enterprise Server users.
1601
1602 The MySQL Installation Wizard can perform server upgrades
1603 automatically using the upgrade capabilities of MSI. That means
1604 you do not need to remove a previous installation manually before
1605 installing a new release. The installer automatically shuts down
1606 and removes the previous MySQL service before installing the new
1607 version.
1608
1609 Automatic upgrades are available only when upgrading between
1610 installations that have the same major and minor version numbers.
1611 For example, you can upgrade automatically from MySQL 4.1.5 to
1612 MySQL 4.1.6, but not from MySQL 4.1 to MySQL 5.0.
1613
1614 See Section 2.4.8.14, "Upgrading MySQL on Windows."
1615
1616 2.4.8.4. MySQL Server Configuration Wizard
1617
1618 The MySQL Server Configuration Wizard helps automate the process
1619 of configuring your server. It creates a custom MySQL
1620 configuration file (my.ini or my.cnf) by asking you a series of
1621 questions and then applying your responses to a template to
1622 generate the configuration file that is tuned to your
1623 installation.
1624
1625 The MySQL Server Configuration Wizard is included with the MySQL
1626 5.0 server. For Community Server users, the MySQL Server
1627 Configuration Wizard is available only for Windows. For Enterprise
1628 Server users, the MySQL Server Configuration Wizard is included as
1629 part of the standard Enterprise Installer.
1630
1631 The MySQL Server Configuration Wizard is to a large extent the
1632 result of feedback that MySQL AB has received from many users over
1633 a period of several years. However, if you find that it lacks some
1634 feature important to you, please report it in our bugs database
1635 using the instructions given in Section 1.7, "How to Report Bugs
1636 or Problems."
1637
1638 2.4.8.4.1. Starting the MySQL Server Configuration Wizard
1639
1640 The MySQL Server Configuration Wizard is normally started as part
1641 of the installation process. You should only need to run the MySQL
1642 Server Configuration Wizard again when you need to change the
1643 configuration parameters of your server.
1644
1645 If you chose not to open a port prior to installing MySQL on
1646 Windows Vista, you can choose to use the MySQL Server
1647 Configuration Wizard after installation. However, you must open a
1648 port in the Windows Firewall. To do this see the instructions
1649 given in Section 2.4.8.3.2, "Downloading and Starting the MySQL
1650 Installation Wizard." Rather than opening a port, you also have
1651 the option of adding MySQL as a program that bypasses the Windows
1652 Firewall. One or the other option is sufficient --- you need not
1653 do both. Additionally, when running the MySQL Server Configuration
1654 Wizard on Windows Vista ensure that you are logged in as a user
1655 with administrative rights.
1656 MySQL Server Configuration Wizard
1657
1658 2.4.8.4.1.1. The MySQL Server Configuration Wizard on Windows
1659
1660 You can launch the MySQL Configuration Wizard by clicking the
1661 MySQL Server Instance Config Wizard entry in the MySQL section of
1662 the Windows Start menu.
1663
1664 Alternatively, you can navigate to the bin directory of your MySQL
1665 installation and launch the MySQLInstanceConfig.exe file directly.
1666
1667 The MySQL Server Configuration Wizard places the my.ini file in
1668 the installation directory for the MySQL server. This helps
1669 associate configuration files with particular server instances.
1670
1671 To ensure that the MySQL server knows where to look for the my.ini
1672 file, an argument similar to this is passed to the MySQL server as
1673 part of the service installation:
1674 --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"
1675
1676 Here, C:\Program Files\MySQL\MySQL Server 5.0 is replaced with the
1677 installation path to the MySQL Server. The --defaults-file option
1678 instructs the MySQL server to read the specified file for
1679 configuration options when it starts.
1680
1681 Apart from making changes to the my.ini file by running the MySQL
1682 Server Configuration Wizard again, you can modify it by opening it
1683 with a text editor and making any necessary changes. You can also
1684 modify the server configuration with the MySQL Administrator
1685 (http://www.mysql.com/products/administrator/) utility. For more
1686 information about server configuration, see Section 5.1.2,
1687 "Command Options."
1688
1689 MySQL clients and utilities such as the mysql and mysqldump
1690 command-line clients are not able to locate the my.ini file
1691 located in the server installation directory. To configure the
1692 client and utility applications, create a new my.ini file in the
1693 Windows installation directory (for example, C:\WINDOWS).
1694
1695 Under Windows Server 2003, Windows Server 2000 and Windows XP,
1696 MySQL Server Configuration Wizard will configure MySQL to work as
1697 a Windows service. To start and stop MySQL you use the Services
1698 application that is supplied as part of the Windows Administrator
1699 Tools.
1700
1701 2.4.8.4.1.2. Starting the MySQL Server Configuration Wizard on Linux
1702
1703 This section does not apply to MySQL Community Server users.
1704
1705 To start the MySQL Configuration Wizard on Linux, you must run the
1706 mysqlsetup command. You must be running an X Windows System server
1707 for the MySQL Server Configuration Wizard.
1708
1709 To display the MySQL Server Configuration Wizard interface on a
1710 different machine, set the value of the DISPLAY variable on the
1711 command line:
1712 shell>
1713 DISPLAY=remote:0.0 mysqlsetup
1714
1715 The MySQL Server Configuration Wizard places the my.cnf file in
1716 the /etc directory.
1717
1718 This configuration file is automatically used when mysqld is
1719 started. The standard MySQL server initialization script,
1720 typically located within /etc/init.d/mysql, will also use this
1721 file automatically.
1722
1723 Apart from making changes to the my.ini file by running the MySQL
1724 Server Configuration Wizard again, you can modify it by opening it
1725 with a text editor and making any necessary changes. You can also
1726 modify the server configuration with the MySQL Administrator
1727 (http://www.mysql.com/products/administrator/) utility. For more
1728 information about server configuration, see Section 5.1.2,
1729 "Command Options."
1730
1731 2.4.8.4.2. Choosing a Maintenance Option
1732
1733 If the MySQL Server Configuration Wizard detects an existing
1734 configuration file, you have the option of either reconfiguring
1735 your existing server, or removing the server instance by deleting
1736 the configuration file and stopping and removing the MySQL
1737 service.
1738
1739 To reconfigure an existing server, choose the Re-configure
1740 Instance option and click the Next button. Any existing
1741 configuration file is not overwritten, but renamed (within the
1742 same directory) using a timestamp (Windows) or sequential number
1743 (Linux). To remove the existing server instance, choose the Remove
1744 Instance option and click the Next button.
1745
1746 If you choose the Remove Instance option, you advance to a
1747 confirmation window. Click the Execute button. The MySQL Server
1748 Configuration Wizard stops and removes the MySQL service, and then
1749 deletes the configuration file. The server installation and its
1750 data folder are not removed.
1751
1752 If you choose the Re-configure Instance option, you advance to the
1753 Configuration Type dialog where you can choose the type of
1754 installation that you wish to configure.
1755
1756 2.4.8.4.3. Choosing a Configuration Type
1757
1758 When you start the MySQL Server Configuration Wizard for a new
1759 MySQL installation, or choose the Re-configure Instance option for
1760 an existing installation, you advance to the Configuration Type
1761 dialog.
1762 MySQL Server Configuration Wizard: Configuration Type
1763
1764 There are two configuration types available: Detailed
1765 Configuration and Standard Configuration. The Standard
1766 Configuration option is intended for new users who want to get
1767 started with MySQL quickly without having to make many decisions
1768 about server configuration. The Detailed Configuration option is
1769 intended for advanced users who want more fine-grained control
1770 over server configuration.
1771
1772 If you are new to MySQL and need a server configured as a
1773 single-user developer machine, the Standard Configuration should
1774 suit your needs. Choosing the Standard Configuration option causes
1775 the MySQL Configuration Wizard to set all configuration options
1776 automatically with the exception of Service Options and Security
1777 Options.
1778
1779 The Standard Configuration sets options that may be incompatible
1780 with systems where there are existing MySQL installations. If you
1781 have an existing MySQL installation on your system in addition to
1782 the installation you wish to configure, the Detailed Configuration
1783 option is recommended.
1784
1785 To complete the Standard Configuration, please refer to the
1786 sections on Service Options and Security Options in Section
1787 2.4.8.4.10, "The Service Options Dialog," and Section 2.4.8.4.11,
1788 "The Security Options Dialog," respectively.
1789
1790 2.4.8.4.4. The Server Type Dialog
1791
1792 There are three different server types available to choose from.
1793 The server type that you choose affects the decisions that the
1794 MySQL Server Configuration Wizard makes with regard to memory,
1795 disk, and processor usage.
1796 MySQL Server Configuration Wizard: Server Type
1797 * Developer Machine: Choose this option for a typical desktop
1798 workstation where MySQL is intended only for personal use. It
1799 is assumed that many other desktop applications are running.
1800 The MySQL server is configured to use minimal system
1801 resources.
1802 * Server Machine: Choose this option for a server machine where
1803 the MySQL server is running alongside other server
1804 applications such as FTP, email, and Web servers. The MySQL
1805 server is configured to use a moderate portion of the system
1806 resources.
1807 * Dedicated MySQL Server Machine: Choose this option for a
1808 server machine that is intended to run only the MySQL server.
1809 It is assumed that no other applications are running. The
1810 MySQL server is configured to use all available system
1811 resources.
1812
1813 Note
1814
1815 By selecting one of the preconfigured configurations, the values
1816 and settings of various options in your my.cnf or my.ini will be
1817 altered accordingly. The default values and options as described
1818 in the reference manual may therefore be different to the options
1819 and values that were created during the execution of the
1820 configuration wizard.
1821
1822 2.4.8.4.5. The Database Usage Dialog
1823
1824 The Database Usage dialog allows you to indicate the storage
1825 engines that you expect to use when creating MySQL tables. The
1826 option you choose determines whether the InnoDB storage engine is
1827 available and what percentage of the server resources are
1828 available to InnoDB.
1829 MySQL Server Configuration Wizard: Usage Dialog
1830 * Multifunctional Database: This option enables both the InnoDB
1831 and MyISAM storage engines and divides resources evenly
1832 between the two. This option is recommended for users who use
1833 both storage engines on a regular basis.
1834 * Transactional Database Only: This option enables both the
1835 InnoDB and MyISAM storage engines, but dedicates most server
1836 resources to the InnoDB storage engine. This option is
1837 recommended for users who use InnoDB almost exclusively and
1838 make only minimal use of MyISAM.
1839 * Non-Transactional Database Only: This option disables the
1840 InnoDB storage engine completely and dedicates all server
1841 resources to the MyISAM storage engine. This option is
1842 recommended for users who do not use InnoDB.
1843
1844 2.4.8.4.6. The InnoDB Tablespace Dialog
1845
1846 Some users may want to locate the InnoDB tablespace files in a
1847 different location than the MySQL server data directory. Placing
1848 the tablespace files in a separate location can be desirable if
1849 your system has a higher capacity or higher performance storage
1850 device available, such as a RAID storage system.
1851 MySQL Server Configuration Wizard: InnoDB Data Tablespace
1852
1853 To change the default location for the InnoDB tablespace files,
1854 choose a new drive from the drop-down list of drive letters and
1855 choose a new path from the drop-down list of paths. To create a
1856 custom path, click the ... button.
1857
1858 If you are modifying the configuration of an existing server, you
1859 must click the Modify button before you change the path. In this
1860 situation you must move the existing tablespace files to the new
1861 location manually before starting the server.
1862
1863 2.4.8.4.7. The Concurrent Connections Dialog
1864
1865 To prevent the server from running out of resources, it is
1866 important to limit the number of concurrent connections to the
1867 MySQL server that can be established. The Concurrent Connections
1868 dialog allows you to choose the expected usage of your server, and
1869 sets the limit for concurrent connections accordingly. It is also
1870 possible to set the concurrent connection limit manually.
1871 MySQL Server Configuration Wizard: Connections
1872 * Decision Support (DSS)/OLAP: Choose this option if your server
1873 does not require a large number of concurrent connections. The
1874 maximum number of connections is set at 100, with an average
1875 of 20 concurrent connections assumed.
1876 * Online Transaction Processing (OLTP): Choose this option if
1877 your server requires a large number of concurrent connections.
1878 The maximum number of connections is set at 500.
1879 * Manual Setting: Choose this option to set the maximum number
1880 of concurrent connections to the server manually. Choose the
1881 number of concurrent connections from the drop-down box
1882 provided, or enter the maximum number of connections into the
1883 drop-down box if the number you desire is not listed.
1884
1885 2.4.8.4.8. The Networking and Strict Mode Options Dialog
1886
1887 Use the Networking Options dialog to enable or disable TCP/IP
1888 networking and to configure the port number that is used to
1889 connect to the MySQL server.
1890 MySQL Server Configuration Wizard: Network Configuration
1891
1892 TCP/IP networking is enabled by default. To disable TCP/IP
1893 networking, uncheck the box next to the Enable TCP/IP Networking
1894 option.
1895
1896 Port 3306 is used by default. To change the port used to access
1897 MySQL, choose a new port number from the drop-down box or type a
1898 new port number directly into the drop-down box. If the port
1899 number you choose is in use, you are prompted to confirm your
1900 choice of port number.
1901
1902 Set the Server SQL Mode to either enable or disable strict mode.
1903 Enabling strict mode (default) makes MySQL behave more like other
1904 database management systems. If you run applications that rely on
1905 MySQL's old "forgiving" behavior, make sure to either adapt those
1906 applications or to disable strict mode. For more information about
1907 strict mode, see Section 5.1.6, "SQL Modes."
1908
1909 2.4.8.4.9. The Character Set Dialog
1910
1911 The MySQL server supports multiple character sets and it is
1912 possible to set a default server character set that is applied to
1913 all tables, columns, and databases unless overridden. Use the
1914 Character Set dialog to change the default character set of the
1915 MySQL server.
1916 MySQL Server Configuration Wizard: Character Set
1917 * Standard Character Set: Choose this option if you want to use
1918 latin1 as the default server character set. latin1 is used for
1919 English and many Western European languages.
1920 * Best Support For Multilingualism: Choose this option if you
1921 want to use utf8 as the default server character set. This is
1922 a Unicode character set that can store characters from many
1923 different languages.
1924 * Manual Selected Default Character Set / Collation: Choose this
1925 option if you want to pick the server's default character set
1926 manually. Choose the desired character set from the provided
1927 drop-down list.
1928
1929 2.4.8.4.10. The Service Options Dialog
1930
1931 This section does not apply to MySQL Community Server users.
1932
1933 On Windows platforms, the MySQL server can be installed as a
1934 Windows service. When installed this way, the MySQL server can be
1935 started automatically during system startup, and even restarted
1936 automatically by Windows in the event of a service failure.
1937
1938 The MySQL Server Configuration Wizard installs the MySQL server as
1939 a service by default, using the service name MySQL. If you do not
1940 wish to install the service, uncheck the box next to the Install
1941 As Windows Service option. You can change the service name by
1942 picking a new service name from the drop-down box provided or by
1943 entering a new service name into the drop-down box.
1944
1945 To install the MySQL server as a service but not have it started
1946 automatically at startup, uncheck the box next to the Launch the
1947 MySQL Server Automatically option.
1948
1949 2.4.8.4.11. The Security Options Dialog
1950
1951 It is strongly recommended that you set a root password for your
1952 MySQL server, and the MySQL Server Configuration Wizard requires
1953 by default that you do so. If you do not wish to set a root
1954 password, uncheck the box next to the Modify Security Settings
1955 option.
1956 MySQL Server Configuration Wizard: Security
1957
1958 To set the root password, enter the desired password into both the
1959 New root password and Confirm boxes. If you are reconfiguring an
1960 existing server, you need to enter the existing root password into
1961 the Current root password box.
1962
1963 To prevent root logins from across the network, check the box next
1964 to the Root may only connect from localhost option. This increases
1965 the security of your root account.
1966
1967 To create an anonymous user account, check the box next to the
1968 Create An Anonymous Account option. Creating an anonymous account
1969 can decrease server security and cause login and permission
1970 difficulties. For this reason, it is not recommended.
1971
1972 2.4.8.4.12. The Confirmation Dialog
1973
1974 The final dialog in the MySQL Server Configuration Wizard is the
1975 Confirmation Dialog. To start the configuration process, click the
1976 Execute button. To return to a previous dialog, click the Back
1977 button. To exit the MySQL Server Configuration Wizard without
1978 configuring the server, click the Cancel button.
1979 MySQL Server Configuration Wizard: Confirmation
1980
1981 After you click the Execute button, the MySQL Server Configuration
1982 Wizard performs a series of tasks and displays the progress
1983 onscreen as the tasks are performed.
1984
1985 The MySQL Server Configuration Wizard first determines
1986 configuration file options based on your choices using a template
1987 prepared by MySQL AB developers and engineers. This template is
1988 named my-template.ini and is located in your server installation
1989 directory.
1990
1991 The MySQL Configuration Wizard then writes these options to the
1992 corresponding configuration file.
1993
1994 If you chose to create a service for the MySQL server, the MySQL
1995 Server Configuration Wizard creates and starts the service. If you
1996 are reconfiguring an existing service, the MySQL Server
1997 Configuration Wizard restarts the service to apply your
1998 configuration changes.
1999
2000 If you chose to set a root password, the MySQL Configuration
2001 Wizard connects to the server, sets your new root password, and
2002 applies any other security settings you may have selected.
2003
2004 After the MySQL Server Configuration Wizard has completed its
2005 tasks, it displays a summary. Click the Finish button to exit the
2006 MySQL Server Configuration Wizard.
2007
2008 2.4.8.5. Installing MySQL from a Noinstall Zip Archive
2009
2010 This section does not apply to MySQL Enterprise Server users.
2011
2012 Users who are installing from the Noinstall package can use the
2013 instructions in this section to manually install MySQL. The
2014 process for installing MySQL from a Zip archive is as follows:
2015 1. Extract the archive to the desired install directory
2016 2. Create an option file
2017 3. Choose a MySQL server type
2018 4. Start the MySQL server
2019 5. Secure the default user accounts
2020
2021 This process is described in the sections that follow.
2022
2023 2.4.8.6. Extracting the Install Archive
2024
2025 This section does not apply to MySQL Enterprise Server users.
2026
2027 To install MySQL manually, do the following:
2028 1. If you are upgrading from a previous version please refer to
2029 Section 2.4.8.14, "Upgrading MySQL on Windows," before
2030 beginning the upgrade process.
2031 2. Make sure that you are logged in as a user with administrator
2032 privileges.
2033 3. Choose an installation location. Traditionally, the MySQL
2034 server is installed in C:\mysql. The MySQL Installation Wizard
2035 installs MySQL under C:\Program Files\MySQL. If you do not
2036 install MySQL at C:\mysql, you must specify the path to the
2037 install directory during startup or in an option file. See
2038 Section 2.4.8.7, "Creating an Option File."
2039 4. Extract the install archive to the chosen installation
2040 location using your preferred Zip archive tool. Some tools may
2041 extract the archive to a folder within your chosen
2042 installation location. If this occurs, you can move the
2043 contents of the subfolder into the chosen installation
2044 location.
2045
2046 2.4.8.7. Creating an Option File
2047
2048 If you need to specify startup options when you run the server,
2049 you can indicate them on the command line or place them in an
2050 option file. For options that are used every time the server
2051 starts, you may find it most convenient to use an option file to
2052 specify your MySQL configuration. This is particularly true under
2053 the following circumstances:
2054 * The installation or data directory locations are different
2055 from the default locations (C:\Program Files\MySQL\MySQL
2056 Server 5.0 and C:\Program Files\MySQL\MySQL Server 5.0\data).
2057 * You need to tune the server settings.
2058
2059 When the MySQL server starts on Windows, it looks for options in
2060 two files: the my.ini file in the Windows directory, and the
2061 C:\my.cnf file. The Windows directory typically is named something
2062 like C:\WINDOWS. You can determine its exact location from the
2063 value of the WINDIR environment variable using the following
2064 command:
2065 C:\> echo %WINDIR%
2066
2067 MySQL looks for options first in the my.ini file, and then in the
2068 my.cnf file. However, to avoid confusion, it's best if you use
2069 only one file. If your PC uses a boot loader where C: is not the
2070 boot drive, your only option is to use the my.ini file. Whichever
2071 option file you use, it must be a plain text file.
2072
2073 You can also make use of the example option files included with
2074 your MySQL distribution; see Section 4.2.2.2.2, "Preconfigured
2075 Option Files."
2076
2077 An option file can be created and modified with any text editor,
2078 such as Notepad. For example, if MySQL is installed in E:\mysql
2079 and the data directory is in E:\mydata\data, you can create an
2080 option file containing a [mysqld] section to specify values for
2081 the basedir and datadir parameters:
2082 [mysqld]
2083 # set basedir to your installation path
2084 basedir=E:/mysql
2085 # set datadir to the location of your data directory
2086 datadir=E:/mydata/data
2087
2088 Note that Windows pathnames are specified in option files using
2089 (forward) slashes rather than backslashes. If you do use
2090 backslashes, you must double them:
2091 [mysqld]
2092 # set basedir to your installation path
2093 basedir=E:\\mysql
2094 # set datadir to the location of your data directory
2095 datadir=E:\\mydata\\data
2096
2097 On Windows, the MySQL installer places the data directory directly
2098 under the directory where you install MySQL. If you would like to
2099 use a data directory in a different location, you should copy the
2100 entire contents of the data directory to the new location. For
2101 example, if MySQL is installed in C:\Program Files\MySQL\MySQL
2102 Server 5.0, the data directory is by default in C:\Program
2103 Files\MySQL\MySQL Server 5.0\data. If you want to use E:\mydata as
2104 the data directory instead, you must do two things:
2105 1. Move the entire data directory and all of its contents from
2106 C:\Program Files\MySQL\MySQL Server 5.0\data to E:\mydata.
2107 2. Use a --datadir option to specify the new data directory
2108 location each time you start the server.
2109
2110 2.4.8.8. Selecting a MySQL Server Type
2111
2112 This section does not apply to MySQL Enterprise Server users.
2113
2114 The following table shows the available servers for Windows in
2115 MySQL 5.0.
2116 Binary Description
2117 mysqld-nt Optimized binary with named-pipe support
2118 mysqld Optimized binary without named-pipe support
2119 mysqld-debug Like mysqld-nt, but compiled with full debugging and
2120 automatic memory allocation checking
2121
2122 All of the preceding binaries are optimized for modern Intel
2123 processors, but should work on any Intel i386-class or higher
2124 processor.
2125
2126 Each of the servers in a distribution support the same set of
2127 storage engines. The SHOW ENGINES statement displays which engines
2128 a given server supports.
2129
2130 All Windows MySQL 5.0 servers have support for symbolic linking of
2131 database directories.
2132
2133 MySQL supports TCP/IP on all Windows platforms. MySQL servers on
2134 Windows support named pipes as indicated in the following list.
2135 However, the default is to use TCP/IP regardless of platform.
2136 (Named pipes are slower than TCP/IP in many Windows
2137 configurations.)
2138
2139 Use of named pipes is subject to these conditions:
2140 * Named pipes are enabled only if you start the server with the
2141 --enable-named-pipe option. It is necessary to use this option
2142 explicitly because some users have experienced problems with
2143 shutting down the MySQL server when named pipes were used.
2144 * Named-pipe connections are allowed only by the mysqld-nt and
2145 mysqld-debug servers.
2146
2147 Note
2148
2149 Most of the examples in this manual use mysqld as the server name.
2150 If you choose to use a different server, such as mysqld-nt, make
2151 the appropriate substitutions in the commands that are shown in
2152 the examples.
2153
2154 2.4.8.9. Starting the Server for the First Time
2155
2156 This section gives a general overview of starting the MySQL
2157 server. The following sections provide more specific information
2158 for starting the MySQL server from the command line or as a
2159 Windows service.
2160
2161 The information here applies primarily if you installed MySQL
2162 using the Noinstall version, or if you wish to configure and test
2163 MySQL manually rather than with the GUI tools.
2164
2165 The examples in these sections assume that MySQL is installed
2166 under the default location of C:\Program Files\MySQL\MySQL Server
2167 5.0. Adjust the pathnames shown in the examples if you have MySQL
2168 installed in a different location.
2169
2170 Clients have two options. They can use TCP/IP, or they can use a
2171 named pipe if the server supports named-pipe connections.
2172
2173 MySQL for Windows also supports shared-memory connections if the
2174 server is started with the --shared-memory option. Clients can
2175 connect through shared memory by using the --protocol=memory
2176 option.
2177
2178 For information about which server binary to run, see Section
2179 2.4.8.8, "Selecting a MySQL Server Type."
2180
2181 Testing is best done from a command prompt in a console window (or
2182 "DOS window"). In this way you can have the server display status
2183 messages in the window where they are easy to see. If something is
2184 wrong with your configuration, these messages make it easier for
2185 you to identify and fix any problems.
2186
2187 To start the server, enter this command:
2188 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --console
2189
2190 For a server that includes InnoDB support, you should see the
2191 messages similar to those following as it starts (the pathnames
2192 and sizes may differ):
2193 InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
2194 InnoDB: a new database to be created!
2195 InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
2196 InnoDB: Database physically writes the file full: wait...
2197 InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be creat
2198 ed
2199 InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
2200 InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be creat
2201 ed
2202 InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
2203 InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be creat
2204 ed
2205 InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
2206 InnoDB: Doublewrite buffer not found: creating new
2207 InnoDB: Doublewrite buffer created
2208 InnoDB: creating foreign key constraint system tables
2209 InnoDB: foreign key constraint system tables created
2210 011024 10:58:25 InnoDB: Started
2211
2212 When the server finishes its startup sequence, you should see
2213 something like this, which indicates that the server is ready to
2214 service client connections:
2215 mysqld: ready for connections
2216 Version: '5.0.56' socket: '' port: 3306
2217
2218 The server continues to write to the console any further
2219 diagnostic output it produces. You can open a new console window
2220 in which to run client programs.
2221
2222 If you omit the --console option, the server writes diagnostic
2223 output to the error log in the data directory (C:\Program
2224 Files\MySQL\MySQL Server 5.0\data by default). The error log is
2225 the file with the .err extension.
2226
2227 Note
2228
2229 The accounts that are listed in the MySQL grant tables initially
2230 have no passwords. After starting the server, you should set up
2231 passwords for them using the instructions in Section 2.4.16,
2232 "Post-Installation Setup and Testing."
2233
2234 2.4.8.10. Starting MySQL from the Windows Command Line
2235
2236 The MySQL server can be started manually from the command line.
2237 This can be done on any version of Windows.
2238
2239 To start the mysqld server from the command line, you should start
2240 a console window (or "DOS window") and enter this command:
2241 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld"
2242
2243 The path to mysqld may vary depending on the install location of
2244 MySQL on your system.
2245
2246 You can stop the MySQL server by executing this command:
2247 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root
2248 shutdown
2249
2250 Note
2251
2252 If the MySQL root user account has a password, you need to invoke
2253 mysqladmin with the -p option and supply the password when
2254 prompted.
2255
2256 This command invokes the MySQL administrative utility mysqladmin
2257 to connect to the server and tell it to shut down. The command
2258 connects as the MySQL root user, which is the default
2259 administrative account in the MySQL grant system. Note that users
2260 in the MySQL grant system are wholly independent from any login
2261 users under Windows.
2262
2263 If mysqld doesn't start, check the error log to see whether the
2264 server wrote any messages there to indicate the cause of the
2265 problem. The error log is located in the C:\Program
2266 Files\MySQL\MySQL Server 5.0\data directory. It is the file with a
2267 suffix of .err. You can also try to start the server as mysqld
2268 --console; in this case, you may get some useful information on
2269 the screen that may help solve the problem.
2270
2271 The last option is to start mysqld with the --standalone and
2272 --debug options. In this case, mysqld writes a log file
2273 C:\mysqld.trace that should contain the reason why mysqld doesn't
2274 start. See MySQL Internals: Porting
2275 (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
2276
2277 Use mysqld --verbose --help to display all the options that mysqld
2278 understands.
2279
2280 2.4.8.11. Starting MySQL as a Windows Service
2281
2282 On Windows, the recommended way to run MySQL is to install it as a
2283 Windows service, whereby MySQL starts and stops automatically when
2284 Windows starts and stops. A MySQL server installed as a service
2285 can also be controlled from the command line using NET commands,
2286 or with the graphical Services utility. Generally, to install
2287 MySQL as a Windows service you should be logged in using an
2288 account that has administrator rights.
2289
2290 The Services utility (the Windows Service Control Manager) can be
2291 found in the Windows Control Panel (under Administrative Tools on
2292 Windows 2000, XP, Vista, and Server 2003). To avoid conflicts, it
2293 is advisable to close the Services utility while performing server
2294 installation or removal operations from the command line.
2295
2296 Before installing MySQL as a Windows service, you should first
2297 stop the current server if it is running by using the following
2298 command:
2299 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin"
2300 -u root shutdown
2301
2302 Note
2303
2304 If the MySQL root user account has a password, you need to invoke
2305 mysqladmin with the -p option and supply the password when
2306 prompted.
2307
2308 This command invokes the MySQL administrative utility mysqladmin
2309 to connect to the server and tell it to shut down. The command
2310 connects as the MySQL root user, which is the default
2311 administrative account in the MySQL grant system. Note that users
2312 in the MySQL grant system are wholly independent from any login
2313 users under Windows.
2314
2315 Install the server as a service using this command:
2316 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --install
2317
2318 The service-installation command does not start the server.
2319 Instructions for that are given later in this section.
2320
2321 To make it easier to invoke MySQL programs, you can add the
2322 pathname of the MySQL bin directory to your Windows system PATH
2323 environment variable:
2324 * On the Windows desktop, right-click on the My Computer icon,
2325 and select Properties
2326 * Next select the Advanced tab from the System Properties menu
2327 that appears, and click the Environment Variables button.
2328 * Under System Variables, select Path, and then click the Edit
2329 button. The Edit System Variable dialogue should appear.
2330 * Place your cursor at the end of the text appearing in the
2331 space marked Variable Value. (Use the End key to ensure that
2332 your cursor is positioned at the very end of the text in this
2333 space.) Then enter the complete pathname of your MySQL bin
2334 directory (for example, C:\Program Files\MySQL\MySQL Server
2335 5.0\bin), Note that there should be a semicolon separating
2336 this path from any values present in this field. Dismiss this
2337 dialogue, and each dialogue in turn, by clicking OK until all
2338 of the dialogues that were opened have been dismissed. You
2339 should now be able to invoke any MySQL executable program by
2340 typing its name at the DOS prompt from any directory on the
2341 system, without having to supply the path. This includes the
2342 servers, the mysql client, and all MySQL command-line
2343 utilities such as mysqladmin and mysqldump.
2344 You should not add the MySQL bin directory to your Windows
2345 PATH if you are running multiple MySQL servers on the same
2346 machine.
2347
2348 Warning
2349
2350 You must exercise great care when editing your system PATH by
2351 hand; accidental deletion or modification of any portion of the
2352 existing PATH value can leave you with a malfunctioning or even
2353 unusable system.
2354
2355 The following additional arguments can be used in MySQL 5.0 when
2356 installing the service:
2357 * You can specify a service name immediately following the
2358 --install option. The default service name is MySQL.
2359 * If a service name is given, it can be followed by a single
2360 option. By convention, this should be
2361 --defaults-file=file_name to specify the name of an option
2362 file from which the server should read options when it starts.
2363 The use of a single option other than --defaults-file is
2364 possible but discouraged. --defaults-file is more flexible
2365 because it enables you to specify multiple startup options for
2366 the server by placing them in the named option file. Also, in
2367 MySQL 5.0, use of an option different from --defaults-file is
2368 not supported until 5.0.3.
2369 * As of MySQL 5.0.1, you can also specify a --local-service
2370 option following the service name. This causes the server to
2371 run using the LocalService Windows account that has limited
2372 system privileges. This account is available only for Windows
2373 XP or newer. If both --defaults-file and --local-service are
2374 given following the service name, they can be in any order.
2375
2376 For a MySQL server that is installed as a Windows service, the
2377 following rules determine the service name and option files that
2378 the server uses:
2379 * If the service-installation command specifies no service name
2380 or the default service name (MySQL) following the --install
2381 option, the server uses the a service name of MySQL and reads
2382 options from the [mysqld] group in the standard option files.
2383 * If the service-installation command specifies a service name
2384 other than MySQL following the --install option, the server
2385 uses that service name. It reads options from the [mysqld]
2386 group and the group that has the same name as the service in
2387 the standard option files. This allows you to use the [mysqld]
2388 group for options that should be used by all MySQL services,
2389 and an option group with the service name for use by the
2390 server installed with that service name.
2391 * If the service-installation command specifies a
2392 --defaults-file option after the service name, the server
2393 reads options only from the [mysqld] group of the named file
2394 and ignores the standard option files.
2395
2396 As a more complex example, consider the following command:
2397 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld"
2398 --install MySQL --defaults-file=C:\my-opts.cnf
2399
2400 Here, the default service name (MySQL) is given after the
2401 --install option. If no --defaults-file option had been given,
2402 this command would have the effect of causing the server to read
2403 the [mysqld] group from the standard option files. However,
2404 because the --defaults-file option is present, the server reads
2405 options from the [mysqld] option group, and only from the named
2406 file.
2407
2408 You can also specify options as Start parameters in the Windows
2409 Services utility before you start the MySQL service.
2410
2411 Once a MySQL server has been installed as a service, Windows
2412 starts the service automatically whenever Windows starts. The
2413 service also can be started immediately from the Services utility,
2414 or by using a NET START MySQL command. The NET command is not case
2415 sensitive.
2416
2417 When run as a service, mysqld has no access to a console window,
2418 so no messages can be seen there. If mysqld does not start, check
2419 the error log to see whether the server wrote any messages there
2420 to indicate the cause of the problem. The error log is located in
2421 the MySQL data directory (for example, C:\Program
2422 Files\MySQL\MySQL Server 5.0\data). It is the file with a suffix
2423 of .err.
2424
2425 When a MySQL server has been installed as a service, and the
2426 service is running, Windows stops the service automatically when
2427 Windows shuts down. The server also can be stopped manually by
2428 using the Services utility, the NET STOP MySQL command, or the
2429 mysqladmin shutdown command.
2430
2431 You also have the choice of installing the server as a manual
2432 service if you do not wish for the service to be started
2433 automatically during the boot process. To do this, use the
2434 --install-manual option rather than the --install option:
2435 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --install-m
2436 anual
2437
2438 To remove a server that is installed as a service, first stop it
2439 if it is running by executing NET STOP MySQL. Then use the
2440 --remove option to remove it:
2441 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" --remove
2442
2443 If mysqld is not running as a service, you can start it from the
2444 command line. For instructions, see Section 2.4.8.10, "Starting
2445 MySQL from the Windows Command Line."
2446
2447 Please see Section 2.4.8.13, "Troubleshooting a MySQL Installation
2448 Under Windows," if you encounter difficulties during installation.
2449
2450 2.4.8.12. Testing The MySQL Installation
2451
2452 You can test whether the MySQL server is working by executing any
2453 of the following commands:
2454 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlshow"
2455 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlshow" -u root
2456 mysql
2457 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" version
2458 status proc
2459 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql" test
2460
2461 If mysqld is slow to respond to TCP/IP connections from client
2462 programs, there is probably a problem with your DNS. In this case,
2463 start mysqld with the --skip-name-resolve option and use only
2464 localhost and IP numbers in the Host column of the MySQL grant
2465 tables.
2466
2467 You can force a MySQL client to use a named-pipe connection rather
2468 than TCP/IP by specifying the --pipe or --protocol=PIPE option, or
2469 by specifying . (period) as the host name. Use the --socket option
2470 to specify the name of the pipe if you do not want to use the
2471 default pipe name.
2472
2473 Note that if you have set a password for the root account, deleted
2474 the anonymous account, or created a new user account, then you
2475 must use the appropriate -u and -p options with the commands shown
2476 above in order to connect with the MySQL Server. See Section
2477 5.4.4, "Connecting to the MySQL Server."
2478
2479 For more information about mysqlshow, see Section 4.5.6,
2480 "mysqlshow --- Display Database, Table, and Column Information."
2481
2482 2.4.8.13. Troubleshooting a MySQL Installation Under Windows
2483
2484 When installing and running MySQL for the first time, you may
2485 encounter certain errors that prevent the MySQL server from
2486 starting. The purpose of this section is to help you diagnose and
2487 correct some of these errors.
2488
2489 Your first resource when troubleshooting server issues is the
2490 error log. The MySQL server uses the error log to record
2491 information relevant to the error that prevents the server from
2492 starting. The error log is located in the data directory specified
2493 in your my.ini file. The default data directory location is
2494 C:\Program Files\MySQL\MySQL Server 5.0\data. See Section 5.2.1,
2495 "The Error Log."
2496
2497 Another source of information regarding possible errors is the
2498 console messages displayed when the MySQL service is starting. Use
2499 the NET START MySQL command from the command line after installing
2500 mysqld as a service to see any error messages regarding the
2501 starting of the MySQL server as a service. See Section 2.4.8.11,
2502 "Starting MySQL as a Windows Service."
2503
2504 The following examples show other common error messages you may
2505 encounter when installing MySQL and starting the server for the
2506 first time:
2507 * If the MySQL server cannot find the mysql privileges database
2508 or other critical files, you may see these messages:
2509 System error 1067 has occurred.
2510 Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't
2511 exist
2512 These messages often occur when the MySQL base or data
2513 directories are installed in different locations than the
2514 default locations (C:\Program Files\MySQL\MySQL Server 5.0 and
2515 C:\Program Files\MySQL\MySQL Server 5.0\data, respectively).
2516 This situation may occur when MySQL is upgraded and installed
2517 to a new location, but the configuration file is not updated
2518 to reflect the new location. In addition, there may be old and
2519 new configuration files that conflict. Be sure to delete or
2520 rename any old configuration files when upgrading MySQL.
2521 If you have installed MySQL to a directory other than
2522 C:\Program Files\MySQL\MySQL Server 5.0, you need to ensure
2523 that the MySQL server is aware of this through the use of a
2524 configuration (my.ini) file. The my.ini file needs to be
2525 located in your Windows directory, typically C:\WINDOWS. You
2526 can determine its exact location from the value of the WINDIR
2527 environment variable by issuing the following command from the
2528 command prompt:
2529 C:\> echo %WINDIR%
2530 An option file can be created and modified with any text
2531 editor, such as Notepad. For example, if MySQL is installed in
2532 E:\mysql and the data directory is D:\MySQLdata, you can
2533 create the option file and set up a [mysqld] section to
2534 specify values for the basedir and datadir parameters:
2535 [mysqld]
2536 # set basedir to your installation path
2537 basedir=E:/mysql
2538 # set datadir to the location of your data directory
2539 datadir=D:/MySQLdata
2540 Note that Windows pathnames are specified in option files
2541 using (forward) slashes rather than backslashes. If you do use
2542 backslashes, you must double them:
2543 [mysqld]
2544 # set basedir to your installation path
2545 basedir=C:\\Program Files\\MySQL\\MySQL Server 5.0
2546 # set datadir to the location of your data directory
2547 datadir=D:\\MySQLdata
2548 MySQL Enterprise For expert advice on the start-up options
2549 appropriate to your circumstances, subscribe to the MySQL
2550 Enterprise Monitor. For more information see,
2551 http://www.mysql.com/products/enterprise/advisors.html.
2552 If you change the datadir value in your MySQL configuration
2553 file, you must move the contents of the existing MySQL data
2554 directory before restarting the MySQL server.
2555 See Section 2.4.8.7, "Creating an Option File."
2556 * If you reinstall or upgrade MySQL without first stopping and
2557 removing the existing MySQL service and install MySQL using
2558 the MySQL Configuration Wizard, you may see this error:
2559 Error: Cannot create Windows service for MySql. Error: 0
2560 This occurs when the Configuration Wizard tries to install the
2561 service and finds an existing service with the same name.
2562 One solution to this problem is to choose a service name other
2563 than mysql when using the configuration wizard. This allows
2564 the new service to be installed correctly, but leaves the
2565 outdated service in place. Although this is harmless, it is
2566 best to remove old services that are no longer in use.
2567 To permanently remove the old mysql service, execute the
2568 following command as a user with administrative privileges, on
2569 the command-line:
2570 C:\> sc delete mysql
2571 [SC] DeleteService SUCCESS
2572 If the sc utility is not available for your version of
2573 Windows, download the delsrv utility from
2574 http://www.microsoft.com/windows2000/techinfo/reskit/tools/exi
2575 sting/delsrv-o.asp and use the delsrv mysql syntax.
2576
2577 2.4.8.14. Upgrading MySQL on Windows
2578
2579 This section does not apply to MySQL Enterprise Server users.
2580
2581 This section lists some of the steps you should take when
2582 upgrading MySQL on Windows.
2583 1. Review Section 2.4.17, "Upgrading MySQL," for additional
2584 information on upgrading MySQL that is not specific to
2585 Windows.
2586 2. You should always back up your current MySQL installation
2587 before performing an upgrade. See Section 5.6.1, "Database
2588 Backups."
2589 3. Download the latest Windows distribution of MySQL from
2590 http://dev.mysql.com/downloads/.
2591 4. Before upgrading MySQL, you must stop the server. If the
2592 server is installed as a service, stop the service with the
2593 following command from the command prompt:
2594 C:\> NET STOP MySQL
2595 If you are not running the MySQL server as a service, use the
2596 following command to stop it:
2597 C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root
2598 shutdown
2599
2600 Note
2601 If the MySQL root user account has a password, you need to
2602 invoke mysqladmin with the -p option and supply the password
2603 when prompted.
2604 5. When upgrading to MySQL 5.0 from a version previous to 4.1.5,
2605 or when upgrading from a version of MySQL installed from a Zip
2606 archive to a version of MySQL installed with the MySQL
2607 Installation Wizard, you must manually remove the previous
2608 installation and MySQL service (if the server is installed as
2609 a service).
2610 To remove the MySQL service, use the following command:
2611 C:\> C:\mysql\bin\mysqld --remove
2612 If you do not remove the existing service, the MySQL
2613 Installation Wizard may fail to properly install the new MySQL
2614 service.
2615 6. If you are using the MySQL Installation Wizard, start the
2616 wizard as described in Section 2.4.8.3, "Using the MySQL
2617 Installation Wizard."
2618 7. If you are installing MySQL from a Zip archive, extract the
2619 archive. You may either overwrite your existing MySQL
2620 installation (usually located at C:\mysql), or install it into
2621 a different directory, such as C:\mysql5. Overwriting the
2622 existing installation is recommended.
2623 8. If you were running MySQL as a Windows service and you had to
2624 remove the service earlier in this procedure, reinstall the
2625 service. (See Section 2.4.8.11, "Starting MySQL as a Windows
2626 Service.")
2627 9. Restart the server. For example, use NET START MySQL if you
2628 run MySQL as a service, or invoke mysqld directly otherwise.
2629 10. If you encounter errors, see Section 2.4.8.13,
2630 "Troubleshooting a MySQL Installation Under Windows."
2631
2632 2.4.8.15. MySQL on Windows Compared to MySQL on Unix
2633
2634 MySQL for Windows has proven itself to be very stable. The Windows
2635 version of MySQL has the same features as the corresponding Unix
2636 version, with the following exceptions:
2637 * Limited number of ports
2638 Windows systems have about 4,000 ports available for client
2639 connections, and after a connection on a port closes, it takes
2640 two to four minutes before the port can be reused. In
2641 situations where clients connect to and disconnect from the
2642 server at a high rate, it is possible for all available ports
2643 to be used up before closed ports become available again. If
2644 this happens, the MySQL server appears to be unresponsive even
2645 though it is running. Note that ports may be used by other
2646 applications running on the machine as well, in which case the
2647 number of ports available to MySQL is lower.
2648 For more information about this problem, see
2649 http://support.microsoft.com/default.aspx?scid=kb;en-us;196271
2650 .
2651 * Concurrent reads
2652 MySQL depends on the pread() and pwrite() system calls to be
2653 able to mix INSERT and SELECT. Currently, we use mutexes to
2654 emulate pread() and pwrite(). We intend to replace the file
2655 level interface with a virtual interface in the future so that
2656 we can use the readfile()/writefile() interface to get more
2657 speed. The current implementation limits the number of open
2658 files that MySQL 5.0 can use to 2,048, which means that you
2659 cannot run as many concurrent threads on Windows as on Unix.
2660 * Blocking read
2661 MySQL uses a blocking read for each connection. That has the
2662 following implications if named-pipe connections are enabled:
2663 + A connection is not disconnected automatically after
2664 eight hours, as happens with the Unix version of MySQL.
2665 + If a connection hangs, it is not possible to break it
2666 without killing MySQL.
2667 + mysqladmin kill does not work on a sleeping connection.
2668 + mysqladmin shutdown cannot abort as long as there are
2669 sleeping connections.
2670 We plan to fix this problem in the future.
2671 * ALTER TABLE
2672 While you are executing an ALTER TABLE statement, the table is
2673 locked from being used by other threads. This has to do with
2674 the fact that on Windows, you can't delete a file that is in
2675 use by another thread. In the future, we may find some way to
2676 work around this problem.
2677 * DROP TABLE
2678 DROP TABLE on a table that is in use by a MERGE table does not
2679 work on Windows because the MERGE handler does the table
2680 mapping hidden from the upper layer of MySQL. Because Windows
2681 does not allow dropping files that are open, you first must
2682 flush all MERGE tables (with FLUSH TABLES) or drop the MERGE
2683 table before dropping the table.
2684 * DATA DIRECTORY and INDEX DIRECTORY
2685 The DATA DIRECTORY and INDEX DIRECTORY options for CREATE
2686 TABLE are ignored on Windows, because Windows doesn't support
2687 symbolic links. These options also are ignored on systems that
2688 have a non-functional realpath() call.
2689 * DROP DATABASE
2690 You cannot drop a database that is in use by some thread.
2691 * Case-insensitive names
2692 Filenames are not case sensitive on Windows, so MySQL database
2693 and table names are also not case sensitive on Windows. The
2694 only restriction is that database and table names must be
2695 specified using the same case throughout a given statement.
2696 See Section 7.2.2, "Identifier Case Sensitivity."
2697 * The "\" pathname separator character
2698 Pathname components in Windows are separated by the "\"
2699 character, which is also the escape character in MySQL. If you
2700 are using LOAD DATA INFILE or SELECT ... INTO OUTFILE, use
2701 Unix-style filenames with "/" characters:
2702 mysql> LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr;
2703 mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
2704 Alternatively, you must double the "\" character:
2705 mysql> LOAD DATA INFILE 'C:\\tmp\\skr.txt' INTO TABLE skr;
2706 mysql> SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
2707 * Problems with pipes
2708 Pipes do not work reliably from the Windows command-line
2709 prompt. If the pipe includes the character ^Z / CHAR(24),
2710 Windows thinks that it has encountered end-of-file and aborts
2711 the program.
2712 This is mainly a problem when you try to apply a binary log as
2713 follows:
2714 C:\> mysqlbinlog binary_log_file | mysql --user=root
2715 If you have a problem applying the log and suspect that it is
2716 because of a ^Z / CHAR(24) character, you can use the
2717 following workaround:
2718 C:\> mysqlbinlog binary_log_file --result-file=/tmp/bin.sql
2719 C:\> mysql --user=root --execute "source /tmp/bin.sql"
2720 The latter command also can be used to reliably read in any
2721 SQL file that may contain binary data.
2722 * Access denied for user error
2723 If MySQL cannot resolve your hostname properly, you may get
2724 the following error when you attempt to run a MySQL client
2725 program to connect to a server running on the same machine:
2726 Access denied for user 'some_user'@'unknown'
2727 to database 'mysql'
2728 To fix this problem, you should create a file named
2729 \windows\hosts containing the following information:
2730 127.0.0.1 localhost
2731
2732 Here are some open issues for anyone who might want to help us
2733 improve MySQL on Windows:
2734 * Add macros to use the faster thread-safe increment/decrement
2735 methods provided by Windows.
2736
2737 2.4.9. Installing MySQL from RPM Packages on Linux
2738
2739 The recommended way to install MySQL on RPM-based Linux
2740 distributions is by using the RPM packages. The RPMs provided by
2741 MySQL AB to the community should work on all versions of Linux
2742 that support RPM packages and use glibc 2.3. MySQL AB also
2743 provides RPMs with binaries that are statically linked to a
2744 patched version of glibc 2.2, but only for the x86 (32-bit)
2745 architecture. To obtain RPM packages, see Section 2.4.4, "How to
2746 Get MySQL."
2747
2748 For non-RPM Linux distributions, you can install MySQL using a
2749 .tar.gz package. See Section 2.4.14, "Installing MySQL from tar.gz
2750 Packages on Other Unix-Like Systems."
2751
2752 MySQL AB does provide some platform-specific RPMs; the difference
2753 between a platform-specific RPM and a generic RPM is that a
2754 platform-specific RPM is built on the targeted platform and is
2755 linked dynamically whereas a generic RPM is linked statically with
2756 LinuxThreads.
2757
2758 Note
2759
2760 RPM distributions of MySQL often are provided by other vendors. Be
2761 aware that they may differ in features and capabilities from those
2762 built by MySQL AB, and that the instructions in this manual do not
2763 necessarily apply to installing them. The vendor's instructions
2764 should be consulted instead.
2765
2766 If you have problems with an RPM file (for example, if you receive
2767 the error Sorry, the host 'xxxx' could not be looked up), see
2768 Section 2.4.19.1.2, "Linux Binary Distribution Notes."
2769
2770 In most cases, you need to install only the MySQL-server and
2771 MySQL-client packages to get a functional MySQL installation. The
2772 other packages are not required for a standard installation.
2773
2774 For upgrades, if your installation was originally produced by
2775 installing multiple RPM packages, it is best to upgrade all the
2776 packages, not just some. For example, if you previously installed
2777 the server and client RPMs, do not upgrade just the server RPM.
2778
2779 If you get a dependency failure when trying to install MySQL
2780 packages (for example, error: removing these packages would break
2781 dependencies: libmysqlclient.so.10 is needed by ...), you should
2782 also install the MySQL-shared-compat package, which includes both
2783 the shared libraries for backward compatibility
2784 (libmysqlclient.so.12 for MySQL 4.0 and libmysqlclient.so.10 for
2785 MySQL 3.23).
2786
2787 Some Linux distributions still ship with MySQL 3.23 and they
2788 usually link applications dynamically to save disk space. If these
2789 shared libraries are in a separate package (for example,
2790 MySQL-shared), it is sufficient to simply leave this package
2791 installed and just upgrade the MySQL server and client packages
2792 (which are statically linked and do not depend on the shared
2793 libraries). For distributions that include the shared libraries in
2794 the same package as the MySQL server (for example, Red Hat Linux),
2795 you could either install our 3.23 MySQL-shared RPM, or use the
2796 MySQL-shared-compat package instead. (Do not install both.)
2797
2798 The RPM packages shown in the following list are available. The
2799 names shown here use a suffix of .glibc23.i386.rpm, but particular
2800 packages can have different suffixes, as described later. Packages
2801 that have community in the names are Community Server builds,
2802 available from MySQL 5.0.27 on.
2803 * MySQL-server-VERSION.glibc23.i386.rpm,
2804 MySQL-server-community-VERSION.glibc23.i386.rpm
2805 The MySQL server. You need this unless you only want to
2806 connect to a MySQL server running on another machine.
2807 * MySQL-client-VERSION.glibc23.i386.rpm,
2808 MySQL-client-community-VERSION.glibc23.i386.rpm
2809 The standard MySQL client programs. You probably always want
2810 to install this package.
2811 * MySQL-bench-VERSION.glibc23.i386.rpm
2812 Tests and benchmarks. Requires Perl and the DBI and DBD::mysql
2813 modules.
2814 * MySQL-devel-VERSION.glibc23.i386.rpm,
2815 MySQL-devel-community-VERSION.glibc23.i386.rpm
2816 The libraries and include files that are needed if you want to
2817 compile other MySQL clients, such as the Perl modules.
2818 * MySQL-debuginfo-VERSION.glibc23.i386.rpm,
2819 MySQL-community-debuginfo-VERSION.glibc23.i386.rpm
2820 This package contains debugging information. debuginfo RPMs
2821 are never needed to use MySQL software; this is true both for
2822 the server and for client programs. However, they contain
2823 additional information that might be needed by a debugger to
2824 analyze a crash.
2825 * MySQL-shared-VERSION.glibc23.i386.rpm,
2826 MySQL-shared-community-VERSION.glibc23.i386.rpm
2827 This package contains the shared libraries
2828 (libmysqlclient.so*) that certain languages and applications
2829 need to dynamically load and use MySQL. It contains
2830 single-threaded and thread-safe libraries. If you install this
2831 package, do not install the MySQL-shared-compat package.
2832 * MySQL-shared-compat-VERSION.glibc23.i386.rpm
2833 This package includes the shared libraries for MySQL 3.23,
2834 4.0, 4.1, and 5.0. It contains single-threaded and thread-safe
2835 libraries. Install this package instead of MySQL-shared if you
2836 have applications installed that are dynamically linked
2837 against older versions of MySQL but you want to upgrade to the
2838 current version without breaking the library dependencies.
2839 * MySQL-clustermanagement-communityVERSION.glibc23.i386.rpm,
2840 MySQL-clusterstorage-communityVERSION.glibc23.i386.rpm,
2841 MySQL-clustertools-communityVERSION.glibc23.i386.rpm,
2842 MySQL-clusterextra-communityVERSION.glibc23.i386.rpm
2843 Packages that contain additional files for MySQL Cluster
2844 installations. These are platform-specific RPMs, in contrast
2845 to the platform-independent ndb-xxx RPMs.
2846
2847 Note
2848 The MySQL-clustertools RPM requires a working installation of
2849 perl and the DBI and HTML::Template packages. See Section
2850 2.4.21, "Perl Installation Notes," and Section 15.8.14,
2851 "ndb_size.pl --- NDBCluster Size Requirement Estimator," for
2852 more information.
2853 * MySQL-ndb-management-VERSION.glibc23.i386.rpm,
2854 MySQL-ndb-storage-VERSION.glibc23.i386.rpm,
2855 MySQL-ndb-tools-VERSION.glibc23.i386.rpm,
2856 MySQL-ndb-extra-VERSION.glibc23.i386.rpm
2857 Packages that contain additional files for MySQL Cluster
2858 installations. These are platform-independent RPMs, in
2859 contrast to the platform-specific clusterxxx-community RPMs.
2860 * MySQL-test-community-VERSION.glibc23.i386.rpm
2861 This package includes the MySQL test suite.
2862 * MySQL-VERSION.src.rpm
2863 This contains the source code for all of the previous
2864 packages. It can also be used to rebuild the RPMs on other
2865 architectures (for example, Alpha or SPARC).
2866
2867 The suffix of RPM package names (following the VERSION value) has
2868 the following syntax:
2869 [.PLATFORM].CPU.rpm
2870
2871 The PLATFORM and CPU values indicate the type of system for which
2872 the package is built. PLATFORM, if present, indicates the
2873 platform, and CPU indicates the processor type or family.
2874
2875 If the PLATFORM value is missing (for example,
2876 MySQL-server-VERSION.i386.rpm), the package is statically linked
2877 against a version of glibc 2.2 that has been patched to handle
2878 larger numbers of threads with larger stack sizes than the stock
2879 library.
2880
2881 If PLATFORM is present, the package is dynamically linked against
2882 glibc 2.3 and the PLATFORM value indicates whether the package is
2883 platform independent or intended for a specific platform:
2884 glibc23 Platform independent, should run on any Linux distribution
2885 that supports glibc 2.3
2886 rhel3, rhel4 Red Hat Enterprise Linux 3 or 4
2887 sles9, sles10 SuSE Linux Enterprise Server 9 or 10
2888
2889 The CPU value indicates the processor type or family for which the
2890 package is built:
2891 i386 x86 processor, 386 and up
2892 i586 x86 processor, Pentium and up
2893 x86_64 64-bit x86 processor
2894 ia64 Itanium (IA-64) processor
2895
2896 To see all files in an RPM package (for example, a MySQL-server
2897 RPM), run a command like this:
2898 shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm
2899
2900 To perform a standard minimal installation, install the server and
2901 client RPMs:
2902 shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm
2903 shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
2904
2905 To install only the client programs, install just the client RPM:
2906 shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
2907
2908 RPM provides a feature to verify the integrity and authenticity of
2909 packages before installing them. If you would like to learn more
2910 about this feature, see Section 2.4.5, "Verifying Package
2911 Integrity Using MD5 Checksums or GnuPG."
2912
2913 The server RPM places data under the /var/lib/mysql directory. The
2914 RPM also creates a login account for a user named mysql (if one
2915 does not exist) to use for running the MySQL server, and creates
2916 the appropriate entries in /etc/init.d/ to start the server
2917 automatically at boot time. (This means that if you have performed
2918 a previous installation and have made changes to its startup
2919 script, you may want to make a copy of the script so that you
2920 don't lose it when you install a newer RPM.) See Section
2921 2.4.16.2.2, "Starting and Stopping MySQL Automatically," for more
2922 information on how MySQL can be started automatically on system
2923 startup.
2924
2925 If you want to install the MySQL RPM on older Linux distributions
2926 that do not support initialization scripts in /etc/init.d
2927 (directly or via a symlink), you should create a symbolic link
2928 that points to the location where your initialization scripts
2929 actually are installed. For example, if that location is
2930 /etc/rc.d/init.d, use these commands before installing the RPM to
2931 create /etc/init.d as a symbolic link that points there:
2932 shell> cd /etc
2933 shell> ln -s rc.d/init.d .
2934
2935 However, all current major Linux distributions should support the
2936 new directory layout that uses /etc/init.d, because it is required
2937 for LSB (Linux Standard Base) compliance.
2938
2939 If the RPM files that you install include MySQL-server, the mysqld
2940 server should be up and running after installation. You should be
2941 able to start using MySQL.
2942
2943 If something goes wrong, you can find more information in the
2944 binary installation section. See Section 2.4.14, "Installing MySQL
2945 from tar.gz Packages on Other Unix-Like Systems."
2946
2947 Note
2948
2949 The accounts that are listed in the MySQL grant tables initially
2950 have no passwords. After starting the server, you should set up
2951 passwords for them using the instructions in Section 2.4.16,
2952 "Post-Installation Setup and Testing."
2953
2954 2.4.10. Installing MySQL on Mac OS X
2955
2956 You can install MySQL on Mac OS X 10.3.x ("Panther") or newer
2957 using a Mac OS X binary package in PKG format instead of the
2958 binary tarball distribution. Please note that older versions of
2959 Mac OS X (for example, 10.1.x or 10.2.x) are not supported by this
2960 package.
2961
2962 The package is located inside a disk image (.dmg) file that you
2963 first need to mount by double-clicking its icon in the Finder. It
2964 should then mount the image and display its contents.
2965
2966 To obtain MySQL, see Section 2.4.4, "How to Get MySQL."
2967
2968 Note
2969
2970 Before proceeding with the installation, be sure to shut down all
2971 running MySQL server instances by either using the MySQL Manager
2972 Application (on Mac OS X Server) or via mysqladmin shutdown on the
2973 command line.
2974
2975 To actually install the MySQL PKG file, double-click on the
2976 package icon. This launches the Mac OS X Package Installer, which
2977 guides you through the installation of MySQL.
2978
2979 Due to a bug in the Mac OS X package installer, you may see this
2980 error message in the destination disk selection dialog:
2981 You cannot install this software on this disk. (null)
2982
2983 If this error occurs, simply click the Go Back button once to
2984 return to the previous screen. Then click Continue to advance to
2985 the destination disk selection again, and you should be able to
2986 choose the destination disk correctly. We have reported this bug
2987 to Apple and it is investigating this problem.
2988
2989 The Mac OS X PKG of MySQL installs itself into
2990 /usr/local/mysql-VERSION and also installs a symbolic link,
2991 /usr/local/mysql, that points to the new location. If a directory
2992 named /usr/local/mysql exists, it is renamed to
2993 /usr/local/mysql.bak first. Additionally, the installer creates
2994 the grant tables in the mysql database by executing
2995 mysql_install_db.
2996
2997 The installation layout is similar to that of a tar file binary
2998 distribution; all MySQL binaries are located in the directory
2999 /usr/local/mysql/bin. The MySQL socket file is created as
3000 /tmp/mysql.sock by default. See Section 2.4.6, "Installation
3001 Layouts."
3002
3003 MySQL installation requires a Mac OS X user account named mysql. A
3004 user account with this name should exist by default on Mac OS X
3005 10.2 and up.
3006
3007 If you are running Mac OS X Server, a version of MySQL should
3008 already be installed. The following table shows the versions of
3009 MySQL that ship with Mac OS X Server versions.
3010 Mac OS X Server Version MySQL Version
3011 10.2-10.2.2 3.23.51
3012 10.2.3-10.2.6 3.23.53
3013 10.3 4.0.14
3014 10.3.2 4.0.16
3015 10.4.0 4.1.10a
3016
3017 This manual section covers the installation of the official MySQL
3018 Mac OS X PKG only. Make sure to read Apple's help information
3019 about installing MySQL: Run the "Help View" application, select
3020 "Mac OS X Server" help, do a search for "MySQL," and read the item
3021 entitled "Installing MySQL."
3022
3023 For preinstalled versions of MySQL on Mac OS X Server, note
3024 especially that you should start mysqld with safe_mysqld instead
3025 of mysqld_safe if MySQL is older than version 4.0.
3026
3027 If you previously used Marc Liyanage's MySQL packages for Mac OS X
3028 from http://www.entropy.ch, you can simply follow the update
3029 instructions for packages using the binary installation layout as
3030 given on his pages.
3031
3032 If you are upgrading from Marc's 3.23.x versions or from the Mac
3033 OS X Server version of MySQL to the official MySQL PKG, you also
3034 need to convert the existing MySQL privilege tables to the current
3035 format, because some new security privileges have been added. See
3036 Section 4.4.8, "mysql_upgrade --- Check Tables for MySQL Upgrade."
3037
3038 If you want MySQL to start automatically during system startup,
3039 you also need to install the MySQL Startup Item. It is part of the
3040 Mac OS X installation disk images as a separate installation
3041 package. Simply double-click the MySQLStartupItem.pkg icon and
3042 follow the instructions to install it. The Startup Item need be
3043 installed only once. There is no need to install it each time you
3044 upgrade the MySQL package later.
3045
3046 The Startup Item for MySQL is installed into
3047 /Library/StartupItems/MySQLCOM. (Before MySQL 4.1.2, the location
3048 was /Library/StartupItems/MySQL, but that collided with the MySQL
3049 Startup Item installed by Mac OS X Server.) Startup Item
3050 installation adds a variable MYSQLCOM=-YES- to the system
3051 configuration file /etc/hostconfig. If you want to disable the
3052 automatic startup of MySQL, simply change this variable to
3053 MYSQLCOM=-NO-.
3054
3055 On Mac OS X Server, the default MySQL installation uses the
3056 variable MYSQL in the /etc/hostconfig file. The MySQL AB Startup
3057 Item installer disables this variable by setting it to MYSQL=-NO-.
3058 This avoids boot time conflicts with the MYSQLCOM variable used by
3059 the MySQL AB Startup Item. However, it does not shut down a
3060 running MySQL server. You should do that yourself.
3061
3062 After the installation, you can start up MySQL by running the
3063 following commands in a terminal window. You must have
3064 administrator privileges to perform this task.
3065
3066 If you have installed the Startup Item, use this command:
3067 shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
3068 (Enter your password, if necessary)
3069 (Press Control-D or enter "exit" to exit the shell)
3070
3071 If you don't use the Startup Item, enter the following command
3072 sequence:
3073 shell> cd /usr/local/mysql
3074 shell> sudo ./bin/mysqld_safe
3075 (Enter your password, if necessary)
3076 (Press Control-Z)
3077 shell> bg
3078 (Press Control-D or enter "exit" to exit the shell)
3079
3080 You should be able to connect to the MySQL server, for example, by
3081 running /usr/local/mysql/bin/mysql.
3082
3083 Note
3084
3085 The accounts that are listed in the MySQL grant tables initially
3086 have no passwords. After starting the server, you should set up
3087 passwords for them using the instructions in Section 2.4.16,
3088 "Post-Installation Setup and Testing."
3089
3090 You might want to add aliases to your shell's resource file to
3091 make it easier to access commonly used programs such as mysql and
3092 mysqladmin from the command line. The syntax for bash is:
3093 alias mysql=/usr/local/mysql/bin/mysql
3094 alias mysqladmin=/usr/local/mysql/bin/mysqladmin
3095
3096 For tcsh, use:
3097 alias mysql /usr/local/mysql/bin/mysql
3098 alias mysqladmin /usr/local/mysql/bin/mysqladmin
3099
3100 Even better, add /usr/local/mysql/bin to your PATH environment
3101 variable. You can do this by modifying the appropriate startup
3102 file for your shell. For more information, see Section 4.2.1,
3103 "Invoking MySQL Programs."
3104
3105 If you are upgrading an existing installation, note that
3106 installing a new MySQL PKG does not remove the directory of an
3107 older installation. Unfortunately, the Mac OS X Installer does not
3108 yet offer the functionality required to properly upgrade
3109 previously installed packages.
3110
3111 To use your existing databases with the new installation, you'll
3112 need to copy the contents of the old data directory to the new
3113 data directory. Make sure that neither the old server nor the new
3114 one is running when you do this. After you have copied over the
3115 MySQL database files from the previous installation and have
3116 successfully started the new server, you should consider removing
3117 the old installation files to save disk space. Additionally, you
3118 should also remove older versions of the Package Receipt
3119 directories located in /Library/Receipts/mysql-VERSION.pkg.
3120
3121 2.4.11. Installing MySQL on Solaris
3122
3123 If you install MySQL using a binary tarball distribution on
3124 Solaris, you may run into trouble even before you get the MySQL
3125 distribution unpacked, as the Solaris tar cannot handle long
3126 filenames. This means that you may see errors when you try to
3127 unpack MySQL.
3128
3129 If this occurs, you must use GNU tar (gtar) to unpack the
3130 distribution. You can find a precompiled copy for Solaris at
3131 http://dev.mysql.com/downloads/os-solaris.html.
3132
3133 You can install MySQL on Solaris using a binary package in PKG
3134 format instead of the binary tarball distribution. Before
3135 installing using the binary PKG format, you should create the
3136 mysql user and group, for example:
3137 groupadd mysql
3138 useradd -g mysql mysql
3139
3140 Some basic PKG-handling commands follow:
3141 * To add a package:
3142 pkgadd -d package_name.pkg
3143 * To remove a package:
3144 pkgrm package_name
3145 * To get a full list of installed packages:
3146 pkginfo
3147 * To get detailed information for a package:
3148 pkginfo -l package_name
3149 * To list the files belonging to a package:
3150 pkgchk -v package_name
3151 * To get packaging information for an arbitrary file:
3152 pkgchk -l -p file_name
3153
3154 For additional information about installing MySQL on Solaris, see
3155 Section 2.4.19.3, "Solaris Notes."
3156
3157 2.4.12. Installing MySQL on i5/OS
3158
3159 The i5/OS POWER MySQL package was created in cooperation with IBM.
3160 MySQL works within the Portable Application Solution Environment
3161 (PASE) on the System i series of hardware and will also provide
3162 database services for the Zend Core for i5/OS.
3163
3164 MySQL for i5/OS is provided as a save file (.savf) package that
3165 can be downloaded and installed directly without any additional
3166 installation steps required.
3167
3168 MySQL is only supported on i5/OS V5R4 or later releases. The i5/OS
3169 PASE must be installed for MySQL to operate. You must be able to
3170 login as a user in *SECOFR class.
3171
3172 You should the installation notes and tips for i5/OS before
3173 starting installation. See i5/OS Installation Notes.
3174
3175 Note
3176
3177 The installation package will use an existing configuration if you
3178 have previously installed MySQL (which is identified by looking
3179 for the file /etc/my.cnf). The values for the data directory
3180 (DATADIR) and owner of the MySQL files (USRPRF) specified during
3181 the installation will be ignored, and the values determined from
3182 the /etc/my.cnf will be used instead.
3183
3184 If you want to change these parameters during a new install, you
3185 should temporarily rename /etc/my.cnf, install MySQL using the new
3186 parameters you want to use, and then merge your previous
3187 /etc/my.cnf configuration settings with the new /etc/my.cnf file
3188 that is created during installation.
3189
3190 To install MySQL on i5/OS, follow these steps:
3191 1. Create a user profile MYSQL. The MYSQL user profile will own
3192 all the MySQL files and databases and be the active user used
3193 when the MySQL server is running. The profile should be
3194 disabled so that you cannot log in as the MySQL user. To
3195 create a user profile, use CRTUSRPRF:
3196 CRTUSRPRF USRPRF(MYSQL) STATUS(*DISABLED) TEXT('MySQL user id')
3197 2. On the System i machine, create a save file that will be used
3198 to receive the downloaded installation save file. The file
3199 should be located within the General Purpose Library (QGPL):
3200 CRTSAVF FILE(QGPL/MYSQLINST)
3201 3. Download the MySQL installation save file in 32-bit
3202 (mysql-5.0.42-i5os-power-32bit.savf) or 64-bit
3203 (mysql-5.0.42-i5os-power-64bit.savf) from MySQL Downloads
3204 (http://dev.mysql.com/downloads).
3205 4. You need to FTP the downloaded .savf file directly into the
3206 QGPL/MYSQLINST file on the System i server. You can do this
3207 through FTP using the following steps after logging in to the
3208 System i machine:
3209 ftp> bin
3210 ftp> cd qgpl
3211 ftp> put mysql-5.0.42-i5os-power.savf mysqlinst
3212 5. Log into the System i server using a user in the *SECOFR
3213 class, such as the QSECOFR user ID.
3214 6. You need to restore the installation library stored in the
3215 .savf save file:
3216 RSTLIB MYSQLINST DEV(*SAVF) SAVF(QGPL/MYSQLINST)
3217 7. You need to execute the installation command,
3218 MYSQLINST/INSMYSQL. You can specify three parameter settings
3219 during installation:
3220 + DIR('/opt/mysql') sets the installation location for the
3221 MySQL files. The directory will be created if it does not
3222 already exist.
3223 + DATADIR('/QOpenSys/mysal/data') sets the location of the
3224 directory that will be used to store the database files
3225 and binary logs. The default setting is
3226 /QOpenSys/mysql/data. Note that if the installer detects
3227 an existing installation (due to the existence of
3228 /etc/my.cnf), then this parameter will be ignored.
3229 + USRPRF(MYSQL) sets the user profile that will own the
3230 files that are installed. The profile will be created if
3231 it does not already exist.
3232 MySQL can be installed anywhere, for this example we will
3233 assume MySQL has been installed into /opt/mysql. The MYSQL
3234 user profile that was created earlier in this sequence should
3235 be used for the profile:
3236 MYSQLINST/INSMYSQL DIR('/opt/mysql') DATADIR('/opt/mysqldata') USRPRF
3237 (MYSQL)
3238 If you are updating an installation over an existing MySQL
3239 installation, you should use the same parameter values that
3240 were used when MySQL was originally installed.
3241 The installation copies all the necessary files into a
3242 directory matching the package version (for example
3243 mysql-5.0.42-i5os-power-32bit), sets the ownership on those
3244 files, sets up the MySQL environment and creates the MySQL
3245 configuration file (in /etc/my.cnf) completing all the steps
3246 in a typical binary installation process automatically. If
3247 this is a new installation of MySQL, or if the installer
3248 detects that this is a new version (because the /etc/my.cnf
3249 file does not exist), then the initial core MySQL databases
3250 will also be created during installation.
3251 8. Once the installation has completed, you can delete the
3252 installation file:
3253 DLTLIB LIB(MYSQLINST)
3254
3255 To start MySQL:
3256 1. Log into the System i server using a user within the *SECOFR
3257 class, such as the QSECOFR user ID.
3258
3259 Note
3260 You should start mysqld_safe using a user that in the PASE
3261 environment has the id=0 (the equivalent of the standard Unix
3262 root user). If you do not use a user with this ID then the
3263 system will be unable to change the user when executing mysqld
3264 as set using --user option. If this happens, mysqld may be
3265 unable to read the files located within the MySQL data
3266 directory and the execution will fail.
3267 2. Enter the PASE environment using call qp2term.
3268 3. Start the MySQL server by changing to the installation
3269 directory and running mysqld_safe, specifying the user name
3270 used to install the server. The installer conveniently
3271 installs a symbolic link to the installation directory
3272 (mysql-5.0.42-i5os-power-32bit) as /opt/mysql/mysql:
3273 > cd /opt/mysql/mysql
3274 > bin/mysqld_safe --user=mysql &
3275 You should see a message similar to the following:
3276 Starting mysqld daemon with databases ��
3277 from /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data
3278
3279 If you are having problems starting MySQL server, see Section
3280 2.4.16.2.3, "Starting and Troubleshooting the MySQL Server."
3281
3282 To stop MySQL:
3283 1. Log into the System i server using the *SECOFR class, such as
3284 the QSECOFR user ID.
3285 2. Enter the PASE environment using call qp2term.
3286 3. Stop the MySQL server by changing into the installation
3287 directory and running mysqladmin, specifying the user name
3288 used to install the server:
3289 > cd /opt/mysql/mysql
3290 > bin/mysqladmin -u root shutdown
3291 If the session that you started and stopped MySQL are the
3292 same, you may get the log output from mysqld:
3293 STOPPING server from pid file ��
3294 /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data/I5DBX.R
3295 CHLAND.IBM.COM.pid
3296 070718 10:34:20 mysqld ended
3297 If the sessions used to start and stop MySQL are different,
3298 you will not receive any confirmation of the shutdown.
3299
3300 Note and tips
3301 * A problem has been identified with the installation process on
3302 DBCS systems. If you are having problems install MySQL on a
3303 DBCS system, you need to change your job's coded character set
3304 identifier (CSSID) to 37 (EBCDIC) before executing the install
3305 command, INSMYSQL. To do this, determine your existing CSSID
3306 (using DSPJOB and selecting option 2), execute CHGJOB
3307 CSSID(37), run INSMYSQL to install MySQL and then execute
3308 CHGJOB again with your original CSSID.
3309 * If you want to use the Perl scripts that are included with
3310 MySQL, you need to download the iSeries Tools for Developers
3311 (5799-PTL). See
3312 http://www-03.ibm.com/servers/enable/site/porting/tools/.
3313
3314 2.4.13. Installing MySQL on NetWare
3315
3316 This section does not apply to MySQL Enterprise Server users.
3317
3318 Porting MySQL to NetWare was an effort spearheaded by Novell.
3319 Novell customers should be pleased to note that NetWare 6.5 ships
3320 with bundled MySQL binaries, complete with an automatic commercial
3321 use license for all servers running that version of NetWare.
3322
3323 MySQL for NetWare is compiled using a combination of Metrowerks
3324 CodeWarrior for NetWare and special cross-compilation versions of
3325 the GNU autotools.
3326
3327 The latest binary packages for NetWare can be obtained at
3328 http://dev.mysql.com/downloads/. See Section 2.4.4, "How to Get
3329 MySQL."
3330
3331 To host MySQL, the NetWare server must meet these requirements:
3332 * The latest Support Pack of NetWare 6.5
3333 (http://support.novell.com/filefinder/18197/index.html)must
3334 be installed.
3335 * The system must meet Novell's minimum requirements to run the
3336 respective version of NetWare.
3337 * MySQL data and the program binaries must be installed on an
3338 NSS volume; traditional volumes are not supported.
3339
3340 To install MySQL for NetWare, use the following procedure:
3341 1. If you are upgrading from a prior installation, stop the MySQL
3342 server. This is done from the server console, using the
3343 following command:
3344 SERVER: mysqladmin -u root shutdown
3345
3346 Note
3347 If the MySQL root user account has a password, you need to
3348 invoke mysqladmin with the -p option and supply the password
3349 when prompted.
3350 2. Log on to the target server from a client machine with access
3351 to the location where you are installing MySQL.
3352 3. Extract the binary package Zip file onto the server. Be sure
3353 to allow the paths in the Zip file to be used. It is safe to
3354 simply extract the file to SYS:\.
3355 If you are upgrading from a prior installation, you may need
3356 to copy the data directory (for example, SYS:MYSQL\DATA), as
3357 well as my.cnf, if you have customized it. You can then delete
3358 the old copy of MySQL.
3359 4. You might want to rename the directory to something more
3360 consistent and easy to use. The examples in this manual use
3361 SYS:MYSQL to refer to the installation directory.
3362 Note that MySQL installation on NetWare does not detect if a
3363 version of MySQL is already installed outside the NetWare
3364 release. Therefore, if you have installed the latest MySQL
3365 version from the Web (for example, MySQL 4.1 or later) in
3366 SYS:\MYSQL, you must rename the folder before upgrading the
3367 NetWare server; otherwise, files in SYS:\MySQL are overwritten
3368 by the MySQL version present in NetWare Support Pack.
3369 5. At the server console, add a search path for the directory
3370 containing the MySQL NLMs. For example:
3371 SERVER: SEARCH ADD SYS:MYSQL\BIN
3372 6. Initialize the data directory and the grant tables, if
3373 necessary, by executing mysql_install_db at the server
3374 console.
3375 7. Start the MySQL server using mysqld_safe at the server
3376 console.
3377 8. To finish the installation, you should also add the following
3378 commands to autoexec.ncf. For example, if your MySQL
3379 installation is in SYS:MYSQL and you want MySQL to start
3380 automatically, you could add these lines:
3381 #Starts the MySQL 5.0.x database server
3382 SEARCH ADD SYS:MYSQL\BIN
3383 MYSQLD_SAFE
3384 If you are running MySQL on NetWare 6.0, we strongly suggest
3385 that you use the --skip-external-locking option on the command
3386 line:
3387 #Starts the MySQL 5.0.x database server
3388 SEARCH ADD SYS:MYSQL\BIN
3389 MYSQLD_SAFE --skip-external-locking
3390 It is also necessary to use CHECK TABLE and REPAIR TABLE
3391 instead of myisamchk, because myisamchk makes use of external
3392 locking. External locking is known to have problems on NetWare
3393 6.0; the problem has been eliminated in NetWare 6.5. Note that
3394 the use of MySQL on Netware 6.0 is not officially supported.
3395 mysqld_safe on NetWare provides a screen presence. When you
3396 unload (shut down) the mysqld_safe NLM, the screen does not go
3397 away by default. Instead, it prompts for user input:
3398 *<NLM has terminated; Press any key to close the screen>*
3399 If you want NetWare to close the screen automatically instead,
3400 use the --autoclose option to mysqld_safe. For example:
3401 #Starts the MySQL 5.0.x database server
3402 SEARCH ADD SYS:MYSQL\BIN
3403 MYSQLD_SAFE --autoclose
3404 The behavior of mysqld_safe on NetWare is described further in
3405 Section 4.3.2, "mysqld_safe --- MySQL Server Startup Script."
3406 9. When installing MySQL, either for the first time or upgrading
3407 from a previous version, download and install the latest and
3408 appropriate Perl module and PHP extensions for NetWare:
3409 + Perl:
3410 http://forge.novell.com/modules/xfcontent/downloads.php/p
3411 erl/Modules/
3412 + PHP:
3413 http://forge.novell.com/modules/xfcontent/downloads.php/p
3414 hp/Modules/
3415
3416 If there was an existing installation of MySQL on the NetWare
3417 server, be sure to check for existing MySQL startup commands in
3418 autoexec.ncf, and edit or delete them as necessary.
3419
3420 Note
3421
3422 The accounts that are listed in the MySQL grant tables initially
3423 have no passwords. After starting the server, you should set up
3424 passwords for them using the instructions in Section 2.4.16,
3425 "Post-Installation Setup and Testing."
3426
3427 2.4.14. Installing MySQL from tar.gz Packages on Other Unix-Like
3428 Systems
3429
3430 This section does not apply to MySQL Enterprise Server users.
3431
3432 This section covers the installation of MySQL binary distributions
3433 that are provided for various platforms in the form of compressed
3434 tar files (files with a .tar.gz extension). See Section 2.4.3.4,
3435 "MySQL Binaries Compiled by MySQL AB," for a detailed list.
3436
3437 To obtain MySQL, see Section 2.4.4, "How to Get MySQL."
3438
3439 MySQL tar file binary distributions have names of the form
3440 mysql-VERSION-OS.tar.gz, where VERSION is a number (for example,
3441 5.0.56), and OS indicates the type of operating system for which
3442 the distribution is intended (for example, pc-linux-i686).
3443
3444 In addition to these generic packages, we also offer binaries in
3445 platform-specific package formats for selected platforms. See
3446 Section 2.4.7, "Standard MySQL Installation Using a Binary
3447 Distribution," for more information on how to install these.
3448
3449 You need the following tools to install a MySQL tar file binary
3450 distribution:
3451 * GNU gunzip to uncompress the distribution.
3452 * A reasonable tar to unpack the distribution. GNU tar is known
3453 to work. Some operating systems come with a preinstalled
3454 version of tar that is known to have problems. For example,
3455 Mac OS X tar and Sun tar are known to have problems with long
3456 filenames. On Mac OS X, you can use the preinstalled gnutar
3457 program. On other systems with a deficient tar, you should
3458 install GNU tar first.
3459
3460 If you run into problems and need to file a bug report, please use
3461 the instructions in Section 1.7, "How to Report Bugs or Problems."
3462
3463 The basic commands that you must execute to install and use a
3464 MySQL binary distribution are:
3465 shell> groupadd mysql
3466 shell> useradd -g mysql mysql
3467 shell> cd /usr/local
3468 shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
3469 shell> ln -s full-path-to-mysql-VERSION-OS mysql
3470 shell> cd mysql
3471 shell> chown -R mysql .
3472 shell> chgrp -R mysql .
3473 shell> scripts/mysql_install_db --user=mysql
3474 shell> chown -R root .
3475 shell> chown -R mysql data
3476 shell> bin/mysqld_safe --user=mysql &
3477
3478 Note
3479
3480 This procedure does not set up any passwords for MySQL accounts.
3481 After following the procedure, proceed to Section 2.4.16,
3482 "Post-Installation Setup and Testing."
3483
3484 A more detailed version of the preceding description for
3485 installing a binary distribution follows:
3486 1. Add a login user and group for mysqld to run as:
3487 shell> groupadd mysql
3488 shell> useradd -g mysql mysql
3489 These commands add the mysql group and the mysql user. The
3490 syntax for useradd and groupadd may differ slightly on
3491 different versions of Unix, or they may have different names
3492 such as adduser and addgroup.
3493 You might want to call the user and group something else
3494 instead of mysql. If so, substitute the appropriate name in
3495 the following steps.
3496 2. Pick the directory under which you want to unpack the
3497 distribution and change location into it. In the following
3498 example, we unpack the distribution under /usr/local. (The
3499 instructions, therefore, assume that you have permission to
3500 create files and directories in /usr/local. If that directory
3501 is protected, you must perform the installation as root.)
3502 shell> cd /usr/local
3503 3. Obtain a distribution file using the instructions in Section
3504 2.4.4, "How to Get MySQL." For a given release, binary
3505 distributions for all platforms are built from the same MySQL
3506 source distribution.
3507 4. Unpack the distribution, which creates the installation
3508 directory. Then create a symbolic link to that directory:
3509 shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
3510 shell> ln -s full-path-to-mysql-VERSION-OS mysql
3511 The tar command creates a directory named mysql-VERSION-OS.
3512 The ln command makes a symbolic link to that directory. This
3513 lets you refer more easily to the installation directory as
3514 /usr/local/mysql.
3515 With GNU tar, no separate invocation of gunzip is necessary.
3516 You can replace the first line with the following alternative
3517 command to uncompress and extract the distribution:
3518 shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
3519 5. Change location into the installation directory:
3520 shell> cd mysql
3521 You will find several files and subdirectories in the mysql
3522 directory. The most important for installation purposes are
3523 the bin and scripts subdirectories:
3524 + The bin directory contains client programs and the
3525 server. You should add the full pathname of this
3526 directory to your PATH environment variable so that your
3527 shell finds the MySQL programs properly. See Section
3528 2.4.20, "Environment Variables."
3529 + The scripts directory contains the mysql_install_db
3530 script used to initialize the mysql database containing
3531 the grant tables that store the server access
3532 permissions.
3533 6. Ensure that the distribution contents are accessible to mysql.
3534 If you unpacked the distribution as mysql, no further action
3535 is required. If you unpacked the distribution as root, its
3536 contents will be owned by root. Change its ownership to mysql
3537 by executing the following commands as root in the
3538 installation directory:
3539 shell> chown -R mysql .
3540 shell> chgrp -R mysql .
3541 The first command changes the owner attribute of the files to
3542 the mysql user. The second changes the group attribute to the
3543 mysql group.
3544 7. If you have not installed MySQL before, you must create the
3545 MySQL data directory and initialize the grant tables:
3546 shell> scripts/mysql_install_db --user=mysql
3547 If you run the command as root, include the --user option as
3548 shown. If you run the command while logged in as that user,
3549 you can omit the --user option.
3550 The command should create the data directory and its contents
3551 with mysql as the owner.
3552 After creating or updating the grant tables, you need to
3553 restart the server manually.
3554 8. Most of the MySQL installation can be owned by root if you
3555 like. The exception is that the data directory must be owned
3556 by mysql. To accomplish this, run the following commands as
3557 root in the installation directory:
3558 shell> chown -R root .
3559 shell> chown -R mysql data
3560 9. If you want MySQL to start automatically when you boot your
3561 machine, you can copy support-files/mysql.server to the
3562 location where your system has its startup files. More
3563 information can be found in the support-files/mysql.server
3564 script itself and in Section 2.4.16.2.2, "Starting and
3565 Stopping MySQL Automatically."
3566 10. You can set up new accounts using the bin/mysql_setpermission
3567 script if you install the DBI and DBD::mysql Perl modules. See
3568 Section 4.6.16, "mysql_setpermission --- Interactively Set
3569 Permissions in Grant Tables." For Perl module installation
3570 instructions, see Section 2.4.21, "Perl Installation Notes."
3571 11. If you would like to use mysqlaccess and have the MySQL
3572 distribution in some non-standard location, you must change
3573 the location where mysqlaccess expects to find the mysql
3574 client. Edit the bin/mysqlaccess script at approximately line
3575 18. Search for a line that looks like this:
3576 $MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
3577 Change the path to reflect the location where mysql actually
3578 is stored on your system. If you do not do this, a Broken pipe
3579 error will occur when you run mysqlaccess.
3580
3581 After everything has been unpacked and installed, you should test
3582 your distribution. To start the MySQL server, use the following
3583 command:
3584 shell> bin/mysqld_safe --user=mysql &
3585
3586 If you run the command as root, you must use the --user option as
3587 shown. The value of the option is the name of the login account
3588 that you created in the first step to use for running the server.
3589 If you run the command while logged in as mysql, you can omit the
3590 --user option.
3591
3592 If the command fails immediately and prints mysqld ended, you can
3593 find some information in the host_name.err file in the data
3594 directory.
3595
3596 More information about mysqld_safe is given in Section 4.3.2,
3597 "mysqld_safe --- MySQL Server Startup Script."
3598
3599 Note
3600
3601 The accounts that are listed in the MySQL grant tables initially
3602 have no passwords. After starting the server, you should set up
3603 passwords for them using the instructions in Section 2.4.16,
3604 "Post-Installation Setup and Testing."
3605
3606 2.4.15. MySQL Installation Using a Source Distribution
3607
3608 This section does not apply to MySQL Enterprise Server users.
3609
3610 Before you proceed with an installation from source, first check
3611 whether our binary is available for your platform and whether it
3612 works for you. We put a great deal of effort into ensuring that
3613 our binaries are built with the best possible options.
3614
3615 To obtain a source distribution for MySQL, Section 2.4.4, "How to
3616 Get MySQL." If you want to build MySQL from source on Windows, see
3617 Section 2.4.15.6, "Installing MySQL from Source on Windows."
3618
3619 MySQL source distributions are provided as compressed tar archives
3620 and have names of the form mysql-VERSION.tar.gz, where VERSION is
3621 a number like 5.0.56.
3622
3623 You need the following tools to build and install MySQL from
3624 source:
3625 * GNU gunzip to uncompress the distribution.
3626 * A reasonable tar to unpack the distribution. GNU tar is known
3627 to work. Some operating systems come with a preinstalled
3628 version of tar that is known to have problems. For example,
3629 the tar provided with early versions of Mac OS X tar, SunOS
3630 4.x and Solaris 8 and earlier are known to have problems with
3631 long filenames. On Mac OS X, you can use the preinstalled
3632 gnutar program. On other systems with a deficient tar, you
3633 should install GNU tar first.
3634 * A working ANSI C++ compiler. gcc 2.95.2 or later, SGI C++, and
3635 SunPro C++ are some of the compilers that are known to work.
3636 libg++ is not needed when using gcc. gcc 2.7.x has a bug that
3637 makes it impossible to compile some perfectly legal C++ files,
3638 such as sql/sql_base.cc. If you have only gcc 2.7.x, you must
3639 upgrade your gcc to be able to compile MySQL. gcc 2.8.1 is
3640 also known to have problems on some platforms, so it should be
3641 avoided if a newer compiler exists for the platform. gcc
3642 2.95.2 or later is recommended.
3643 * A good make program. GNU make is always recommended and is
3644 sometimes required. (BSD make fails, and vendor-provided make
3645 implementations may fail as well.) If you have problems, we
3646 recommend GNU make 3.75 or newer.
3647 * libtool 1.5.24 or later is also recommended.
3648
3649 If you are using a version of gcc recent enough to understand the
3650 -fno-exceptions option, it is very important that you use this
3651 option. Otherwise, you may compile a binary that crashes randomly.
3652 We also recommend that you use -felide-constructors and -fno-rtti
3653 along with -fno-exceptions. When in doubt, do the following:
3654 CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
3655 -fno-exceptions -fno-rtti" ./configure \
3656 --prefix=/usr/local/mysql --enable-assembler \
3657 --with-mysqld-ldflags=-all-static
3658
3659 On most systems, this gives you a fast and stable binary.
3660
3661 If you run into problems and need to file a bug report, please use
3662 the instructions in Section 1.7, "How to Report Bugs or Problems."
3663
3664 2.4.15.1. Source Installation Overview
3665
3666 This section does not apply to MySQL Enterprise Server users.
3667
3668 The basic commands that you must execute to install a MySQL source
3669 distribution are:
3670 shell> groupadd mysql
3671 shell> useradd -g mysql mysql
3672 shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
3673 shell> cd mysql-VERSION
3674 shell> ./configure --prefix=/usr/local/mysql
3675 shell> make
3676 shell> make install
3677 shell> cp support-files/my-medium.cnf /etc/my.cnf
3678 shell> cd /usr/local/mysql
3679 shell> chown -R mysql .
3680 shell> chgrp -R mysql .
3681 shell> bin/mysql_install_db --user=mysql
3682 shell> chown -R root .
3683 shell> chown -R mysql var
3684 shell> bin/mysqld_safe --user=mysql &
3685
3686 If you start from a source RPM, do the following:
3687 shell> rpmbuild --rebuild --clean MySQL-VERSION.src.rpm
3688
3689 This makes a binary RPM that you can install. For older versions
3690 of RPM, you may have to replace the command rpmbuild with rpm
3691 instead.
3692
3693 Note
3694
3695 This procedure does not set up any passwords for MySQL accounts.
3696 After following the procedure, proceed to Section 2.4.16,
3697 "Post-Installation Setup and Testing," for post-installation setup
3698 and testing.
3699
3700 A more detailed version of the preceding description for
3701 installing MySQL from a source distribution follows:
3702 1. Add a login user and group for mysqld to run as:
3703 shell> groupadd mysql
3704 shell> useradd -g mysql mysql
3705 These commands add the mysql group and the mysql user. The
3706 syntax for useradd and groupadd may differ slightly on
3707 different versions of Unix, or they may have different names
3708 such as adduser and addgroup.
3709 You might want to call the user and group something else
3710 instead of mysql. If so, substitute the appropriate name in
3711 the following steps.
3712 2. Perform the following steps as the mysql user, except as
3713 noted.
3714 3. Pick the directory under which you want to unpack the
3715 distribution and change location into it.
3716 4. Obtain a distribution file using the instructions in Section
3717 2.4.4, "How to Get MySQL."
3718 5. Unpack the distribution into the current directory:
3719 shell> gunzip < /path/to/mysql-VERSION.tar.gz | tar xvf -
3720 This command creates a directory named mysql-VERSION.
3721 With GNU tar, no separate invocation of gunzip is necessary.
3722 You can use the following alternative command to uncompress
3723 and extract the distribution:
3724 shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
3725 6. Change location into the top-level directory of the unpacked
3726 distribution:
3727 shell> cd mysql-VERSION
3728 Note that currently you must configure and build MySQL from
3729 this top-level directory. You cannot build it in a different
3730 directory.
3731 7. Configure the release and compile everything:
3732 shell> ./configure --prefix=/usr/local/mysql
3733 shell> make
3734 When you run configure, you might want to specify other
3735 options. Run ./configure --help for a list of options. Section
3736 2.4.15.2, "Typical configure Options," discusses some of the
3737 more useful options.
3738 If configure fails and you are going to send mail to a MySQL
3739 mailing list to ask for assistance, please include any lines
3740 from config.log that you think can help solve the problem.
3741 Also include the last couple of lines of output from
3742 configure. To file a bug report, please use the instructions
3743 in Section 1.7, "How to Report Bugs or Problems."
3744 If the compile fails, see Section 2.4.15.4, "Dealing with
3745 Problems Compiling MySQL," for help.
3746 8. Install the distribution:
3747 shell> make install
3748 You might need to run this command as root.
3749 If you want to set up an option file, use one of those present
3750 in the support-files directory as a template. For example:
3751 shell> cp support-files/my-medium.cnf /etc/my.cnf
3752 You might need to run this command as root.
3753 If you want to configure support for InnoDB tables, you should
3754 edit the /etc/my.cnf file, remove the # character before the
3755 option lines that start with innodb_..., and modify the option
3756 values to be what you want. See Section 4.2.2.2, "Using Option
3757 Files," and Section 12.2.3, "InnoDB Configuration."
3758 9. Change location into the installation directory:
3759 shell> cd /usr/local/mysql
3760 10. If you ran the make install command as root, the installed
3761 files will be owned by root. Ensure that the installation is
3762 accessible to mysql by executing the following commands as
3763 root in the installation directory:
3764 shell> chown -R mysql .
3765 shell> chgrp -R mysql .
3766 The first command changes the owner attribute of the files to
3767 the mysql user. The second changes the group attribute to the
3768 mysql group.
3769 11. If you have not installed MySQL before, you must create the
3770 MySQL data directory and initialize the grant tables:
3771 shell> bin/mysql_install_db --user=mysql
3772 If you run the command as root, include the --user option as
3773 shown. If you run the command while logged in as mysql, you
3774 can omit the --user option.
3775 The command should create the data directory and its contents
3776 with mysql as the owner.
3777 After using mysql_install_db to create the grant tables for
3778 MySQL, you must restart the server manually. The mysqld_safe
3779 command to do this is shown in a later step.
3780 12. Most of the MySQL installation can be owned by root if you
3781 like. The exception is that the data directory must be owned
3782 by mysql. To accomplish this, run the following commands as
3783 root in the installation directory:
3784 shell> chown -R root .
3785 shell> chown -R mysql var
3786 13. If you want MySQL to start automatically when you boot your
3787 machine, you can copy support-files/mysql.server to the
3788 location where your system has its startup files. More
3789 information can be found in the support-files/mysql.server
3790 script itself; see also Section 2.4.16.2.2, "Starting and
3791 Stopping MySQL Automatically."
3792 14. You can set up new accounts using the bin/mysql_setpermission
3793 script if you install the DBI and DBD::mysql Perl modules. See
3794 Section 4.6.16, "mysql_setpermission --- Interactively Set
3795 Permissions in Grant Tables." For Perl module installation
3796 instructions, see Section 2.4.21, "Perl Installation Notes."
3797
3798 After everything has been installed, you should test your
3799 distribution. To start the MySQL server, use the following
3800 command:
3801 shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
3802
3803 If you run the command as root, you should use the --user option
3804 as shown. The value of the option is the name of the login account
3805 that you created in the first step to use for running the server.
3806 If you run the command while logged in as that user, you can omit
3807 the --user option.
3808
3809 If the command fails immediately and prints mysqld ended, you can
3810 find some information in the host_name.err file in the data
3811 directory.
3812
3813 More information about mysqld_safe is given in Section 4.3.2,
3814 "mysqld_safe --- MySQL Server Startup Script."
3815
3816 Note
3817
3818 The accounts that are listed in the MySQL grant tables initially
3819 have no passwords. After starting the server, you should set up
3820 passwords for them using the instructions in Section 2.4.16,
3821 "Post-Installation Setup and Testing."
3822
3823 2.4.15.2. Typical configure Options
3824
3825 This section does not apply to MySQL Enterprise Server users.
3826
3827 The configure script gives you a great deal of control over how
3828 you configure a MySQL source distribution. Typically you do this
3829 using options on the configure command line. You can also affect
3830 configure using certain environment variables. See Section 2.4.20,
3831 "Environment Variables." For a full list of options supported by
3832 configure, run this command:
3833 shell> ./configure --help
3834
3835 A list of the available configure options is provided in the table
3836 below.
3837
3838 Table 2.1. Build (configure) Reference
3839 Formats Description Default Introduced Removed
3840 --bindir=DIR User executables EPREFIX/bin
3841 --build=BUILD Configure for building on BUILD guessed
3842 --cache-file=FILE Cache test results in FILE disabled
3843 -C Alias for `--cache-file=config.cache'
3844 --config-cache
3845 --datadir=DIR Read-only architecture-independent data PREFIX/share
3846
3847 --disable-FEATURE Do not include FEATURE
3848 --disable-dependency-tracking Disable dependency tracking
3849 --disable-grant-options Disable GRANT options 5.0.34
3850 --disable-largefile Omit support for large files
3851 --disable-libtool-lock Disable libtool lock
3852 --disable-profiling Build a version without query profiling code
3853 5.0.37 5.0.45
3854 --enable-FEATURE Enable FEATURE
3855 --enable-assembler Use assembler versions of some string functions
3856 if available
3857 --enable-dependency-tracking Do not reject slow dependency
3858 extractors
3859 --enable-fast-install Optimize for fast installation yes
3860 --enable-local-infile Enable LOAD DATA LOCAL INFILE disabled
3861 --enable-shared Build shared libraries yes
3862 --enable-static Build static libraries yes
3863 --enable-thread-safe-client Compile the client with threads
3864 --exec-prefix=EPREFIX Install architecture-dependent files in
3865 EPREFIX
3866 -h Display this help and exit
3867 --help
3868 --help=short Display options specific to this package
3869 --help=recursive Display the short help of all the included
3870 packages
3871 --host=HOST Cross-compile to build programs to run on HOST
3872 --includedir=DIR C header files PREFIX/include
3873 --infodir=DIR Info documentation PREFIX/info
3874 --libdir=DIR Object code libraries EPREFIX/lib
3875 --libexecdir=DIR Program executables EPREFIX/libexec
3876 --localstatedir=DIR Modifiable single-machine data PREFIX/var
3877 --mandir=DIR man documentation PREFIX/man
3878 -n Do not create output files
3879 --no-create
3880 --oldincludedir=DIR C header files for non-gcc /usr/include
3881 --prefix=PREFIX Install architecture-independent files in PREFIX
3882
3883 --program-prefix=PREFIX Prepend PREFIX to installed program names
3884
3885 --program-suffix=SUFFIX Append SUFFIX to installed program names
3886
3887 --program-transform-name=PROGRAM run sed PROGRAM on installed
3888 program names
3889 -q Do not print `checking...' messages
3890 --quiet
3891 --sbindir=DIR System admin executables EPREFIX/sbin
3892 --sharedstatedir=DIR Modifiable architecture-independent data
3893 PREFIX/com
3894 --srcdir=DIR Find the sources in DIR configure directory or ..
3895 --sysconfdir=DIR Read-only single-machine data PREFIX/etc
3896 --target=TARGET Configure for building compilers for TARGET
3897 -V Display version information and exit
3898 --version
3899 --with-PACKAGE Use PACKAGE
3900 --with-archive-storage-engine Enable the Archive Storage Engine no
3901
3902 --with-berkeley-db Use BerkeleyDB located in DIR no
3903 --with-berkeley-db-includes Find Berkeley DB headers in DIR
3904 --with-berkeley-db-libs Find Berkeley DB libraries in DIR
3905 --with-big-tables Support tables with more than 4 G rows even on
3906 32 bit platforms 5.0.4
3907 --with-blackhole-storage-engine Enable the Blackhole Storage
3908 Engine no 5.0.4
3909 --with-charset Default character set
3910 --with-client-ldflags Extra linking arguments for clients
3911 --with-collation Default collation
3912 --with-comment Comment about compilation environment
3913 --with-csv-storage-engine Enable the CSV Storage Engine yes
3914 --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS
3915 X/Darwin 5.0.6
3916 --with-embedded-privilege-control Build parts to check user's
3917 privileges (only affects embedded library)
3918 --with-embedded-server Build the embedded server
3919 --with-example-storage-engine Enable the Example Storage Engine no
3920
3921 --with-extra-charsets Use charsets in addition to default
3922 --with-gnu-ld Assume the C compiler uses GNU ld no
3923 --with-isam Enable the ISAM table type
3924 --with-lib-ccflags Extra CC options for libraries
3925 --with-libwrap=DIR Compile in libwrap (tcp_wrappers) support
3926 --with-low-memory Try to use less memory to compile to avoid
3927 memory limitations
3928 --with-machine-type Set the machine type, like "powerpc" 5.0.44
3929
3930 --with-max-indexes=N Sets the maximum number of indexes per table
3931 64
3932 --with-mit-threads Always use included thread lib
3933 --with-mysqld-ldflags Extra linking arguments for mysqld
3934 --with-mysqld-libs Extra libraries to link with for mysqld
3935 5.0.44
3936 --with-mysqld-user What user the mysqld daemon shall be run as
3937
3938 --with-mysqlfs Include the corba-based MySQL file system
3939 --with-mysqlmanager Build the mysqlmanager binary Build if server
3940 is built
3941 --with-named-curses-libs Use specified curses libraries
3942 --with-named-thread-libs Use specified thread libraries
3943 --with-ndb-ccflags Extra CC options for ndb compile 5.0.3
3944 --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi
3945 documentation
3946 --with-ndb-port Port for NDB Cluster management server
3947 --with-ndb-port-base Port for NDB Cluster management server
3948 5.0.3
3949 --with-ndb-sci=DIR Provide MySQL with a custom location of sci
3950 library
3951 --with-ndb-shm Include the NDB Cluster shared memory transporter
3952
3953 --with-ndb-test Include the NDB Cluster ndbapi test programs
3954 --with-ndbcluster Include the NDB Cluster table handler no
3955 --with-openssl=DIR Include the OpenSSL support
3956 --with-openssl-includes Find OpenSSL headers in DIR
3957 --with-openssl-libs Find OpenSSL libraries in DIR
3958 --with-other-libc=DIR Link against libc and other standard
3959 libraries installed in the specified non-standard location
3960 --with-pic Try to use only PIC/non-PIC objects Use both
3961 --with-pstack Use the pstack backtrace library
3962 --with-pthread Force use of pthread library
3963 --with-raid Enable RAID Support
3964 --with-server-suffix Append value to the version string
3965 --with-system-type Set the system type, like "sun-solaris10"
3966 5.0.44
3967 --with-tags Include additional configurations automatic
3968 --with-tcp-port Which port to use for MySQL services 3306
3969 --with-unix-socket-path Where to put the unix-domain socket
3970 --with-vio Include the Virtual IO support
3971 --with-yassl Include the yaSSL support 5.0.6
3972 --with-zlib-dir Provide MySQL with a custom location of
3973 compression library
3974 --with-zlib-dir=DIR
3975 --without-PACKAGE Do not use PACKAGE
3976 --without-bench Skip building of the benchmark suite
3977 --without-debug Build a production version without debugging code
3978
3979 --without-docs Skip building of the documentation
3980 --without-extra-tools Skip building utilites in the tools
3981 directory
3982 --without-geometry Do not build geometry-related parts
3983 --without-innodb Do not include the InnoDB table handler
3984 --without-libedit Use system libedit instead of bundled copy
3985 --without-man Skip building of the man pages
3986 --without-ndb-debug Disable special ndb debug features 5.0.3
3987 --without-query-cache Do not build query cache
3988 --without-readline Use system readline instead of bundled copy
3989
3990 --without-server Only build the client
3991 --without-uca Skip building of the national Unicode collations
3992 5.0.3
3993
3994 Some of the configure options available are described here:
3995 * To compile just the MySQL client libraries and client programs
3996 and not the server, use the --without-server option:
3997 shell> ./configure --without-server
3998 If you have no C++ compiler, some client programs such as
3999 mysql cannot be compiled because they require C++.. In this
4000 case, you can remove the code in configure that tests for the
4001 C++ compiler and then run ./configure with the
4002 --without-server option. The compile step should still try to
4003 build all clients, but you can ignore any warnings about files
4004 such as mysql.cc. (If make stops, try make -k to tell it to
4005 continue with the rest of the build even if errors occur.)
4006 * If you want to build the embedded MySQL library (libmysqld.a),
4007 use the --with-embedded-server option.
4008 * If you don't want your log files and database directories
4009 located under /usr/local/var, use a configure command
4010 something like one of these:
4011 shell> ./configure --prefix=/usr/local/mysql
4012 shell> ./configure --prefix=/usr/local \
4013 --localstatedir=/usr/local/mysql/data
4014 The first command changes the installation prefix so that
4015 everything is installed under /usr/local/mysql rather than the
4016 default of /usr/local. The second command preserves the
4017 default installation prefix, but overrides the default
4018 location for database directories (normally /usr/local/var)
4019 and changes it to /usr/local/mysql/data.
4020 You can also specify the installation directory and data
4021 directory locations at server startup time by using the
4022 --basedir and --datadir options. These can be given on the
4023 command line or in an MySQL option file, although it is more
4024 common to use an option file. See Section 4.2.2.2, "Using
4025 Option Files."
4026 * If you are using Unix and you want the MySQL socket file
4027 location to be somewhere other than the default location
4028 (normally in the directory /tmp or /var/run), use a configure
4029 command like this:
4030 shell> ./configure \
4031 --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
4032 The socket filename must be an absolute pathname. You can also
4033 change the location of mysql.sock at server startup by using a
4034 MySQL option file. See Section B.1.4.5, "How to Protect or
4035 Change the MySQL Unix Socket File."
4036 * If you want to compile statically linked programs (for
4037 example, to make a binary distribution, to get better
4038 performance, or to work around problems with some Red Hat
4039 Linux distributions), run configure like this:
4040 shell> ./configure --with-client-ldflags=-all-static \
4041 --with-mysqld-ldflags=-all-static
4042 * If you are using gcc and don't have libg++ or libstdc++
4043 installed, you can tell configure to use gcc as your C++
4044 compiler:
4045 shell> CC=gcc CXX=gcc ./configure
4046 When you use gcc as your C++ compiler, it does not attempt to
4047 link in libg++ or libstdc++. This may be a good thing to do
4048 even if you have those libraries installed. Some versions of
4049 them have caused strange problems for MySQL users in the past.
4050 The following list indicates some compilers and environment
4051 variable settings that are commonly used with each one.
4052 + gcc 2.7.2:
4053 CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
4054 + gcc 2.95.2:
4055 CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
4056 -felide-constructors -fno-exceptions -fno-rtti"
4057 + pgcc 2.90.29 or newer:
4058 CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc \
4059 CXXFLAGS="-O3 -mpentiumpro -mstack-align-double \
4060 -felide-constructors -fno-exceptions -fno-rtti"
4061 In most cases, you can get a reasonably optimized MySQL binary
4062 by using the options from the preceding list and adding the
4063 following options to the configure line:
4064 --prefix=/usr/local/mysql --enable-assembler \
4065 --with-mysqld-ldflags=-all-static
4066 The full configure line would, in other words, be something
4067 like the following for all recent gcc versions:
4068 CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
4069 -felide-constructors -fno-exceptions -fno-rtti" ./configure \
4070 --prefix=/usr/local/mysql --enable-assembler \
4071 --with-mysqld-ldflags=-all-static
4072 The binaries we provide on the MySQL Web site at
4073 http://dev.mysql.com/downloads/ are all compiled with full
4074 optimization and should be perfect for most users. See Section
4075 2.4.3.4, "MySQL Binaries Compiled by MySQL AB." There are some
4076 configuration settings you can tweak to build an even faster
4077 binary, but these are only for advanced users. See Section
4078 6.5.6, "How Compiling and Linking Affects the Speed of MySQL."
4079 If the build fails and produces errors about your compiler or
4080 linker not being able to create the shared library
4081 libmysqlclient.so.N (where N is a version number), you can
4082 work around this problem by giving the --disable-shared option
4083 to configure. In this case, configure does not build a shared
4084 libmysqlclient.so.N library.
4085 * By default, MySQL uses the latin1 (cp1252 West European)
4086 character set. To change the default set, use the
4087 --with-charset option:
4088 shell> ./configure --with-charset=CHARSET
4089 CHARSET may be one of binary, armscii8, ascii, big5, cp1250,
4090 cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8,
4091 eucjpms, euckr, gb2312, gbk, geostd8, greek, hebrew, hp8,
4092 keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce,
4093 macroman, sjis, swe7, tis620, ucs2, ujis, utf8. See Section
4094 8.2, "The Character Set Used for Data and Sorting."
4095 (Additional character sets might be available. Check the
4096 output from ./configure --help for the current list.)
4097 The default collation may also be specified. MySQL uses the
4098 latin1_swedish_ci collation by default. To change this, use
4099 the --with-collation option:
4100 shell> ./configure --with-collation=COLLATION
4101 To change both the character set and the collation, use both
4102 the --with-charset and --with-collation options. The collation
4103 must be a legal collation for the character set. (Use the SHOW
4104 COLLATION statement to determine which collations are
4105 available for each character set.)
4106
4107 Warning
4108 If you change character sets after having created any tables,
4109 you must run myisamchk -r -q --set-collation=collation_name on
4110 every MyISAM table. Your indexes may be sorted incorrectly
4111 otherwise. This can happen if you install MySQL, create some
4112 tables, and then reconfigure MySQL to use a different
4113 character set and reinstall it.
4114 With the configure option --with-extra-charsets=LIST, you can
4115 define which additional character sets should be compiled into
4116 the server. LIST is one of the following:
4117 + A list of character set names separated by spaces
4118 + complex to include all character sets that can't be
4119 dynamically loaded
4120 + all to include all character sets into the binaries
4121 Clients that want to convert characters between the server and
4122 the client should use the SET NAMES statement. See Section
4123 11.5.3, "SET Syntax," and Section 8.1.4, "Connection Character
4124 Sets and Collations."
4125 * To configure MySQL with debugging code, use the --with-debug
4126 option:
4127 shell> ./configure --with-debug
4128 This causes a safe memory allocator to be included that can
4129 find some errors and that provides output about what is
4130 happening. See MySQL Internals: Porting
4131 (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
4132 As of MySQL 5.0.25, using --with-debug to configure MySQL with
4133 debugging support enables you to use the
4134 --debug="d,parser_debug" option when you start the server.
4135 This causes the Bison parser that is used to process SQL
4136 statements to dump a parser trace to the server's standard
4137 error output. Typically, this output is written to the error
4138 log.
4139 * If your client programs are using threads, you must compile a
4140 thread-safe version of the MySQL client library with the
4141 --enable-thread-safe-client configure option. This creates a
4142 libmysqlclient_r library with which you should link your
4143 threaded applications. See Section 22.2.16, "How to Make a
4144 Threaded Client."
4145 * It is possible to build MySQL 5.0 with large table support
4146 using the --with-big-tables option, beginning with MySQL
4147 5.0.4.
4148 This option causes the variables that store table row counts
4149 to be declared as unsigned long long rather than unsigned
4150 long. This enables tables to hold up to approximately
4151 1.844E+19 ((2^32)^2) rows rather than 2^32 (~4.295E+09) rows.
4152 Previously it was necessary to pass -DBIG_TABLES to the
4153 compiler manually in order to enable this feature.
4154 * Run configure with the --disable-grant-options option to cause
4155 the the --bootstrap, --skip-grant-tables, and --init-file
4156 options for mysqld to be disabled. For Windows, the
4157 configure.js script recognizes the DISABLE_GRANT_OPTIONS flag,
4158 which has the same effect. The capability is available as of
4159 MySQL 5.0.34.
4160 * See Section 2.4.19, "Operating System-Specific Notes," for
4161 options that pertain to particular operating systems.
4162 * See Section 5.5.7.2, "Using SSL Connections," for options that
4163 pertain to configuring MySQL to support secure (encrypted)
4164 connections.
4165
4166 2.4.15.3. Installing from the Development Source Tree
4167
4168 This section does not apply to MySQL Enterprise Server users.
4169
4170 Caution
4171
4172 You should read this section only if you are interested in helping
4173 us test our new code. If you just want to get MySQL up and running
4174 on your system, you should use a standard release distribution
4175 (either a binary or source distribution).
4176
4177 To obtain our most recent development source tree, first download
4178 and install the BitKeeper free client if you do not have it. The
4179 client can be obtained from
4180 http://www.bitmover.com/bk-client2.0.shar. Note that you will need
4181 gcc and make to build the BitKeeper free client, and patch and tar
4182 to use the BitKeeper free client. Note that old 1.1 versions of
4183 the BitKeeper free client will not work!
4184
4185 To install the BitKeeper client on Unix, use these commands:
4186 shell> /bin/sh bk-client2.0.shar
4187 shell> cd bk-client2.0
4188 shell> make
4189
4190 If you get a cc: command not found error, invoke this command
4191 before running make:
4192 shell> make CC=gcc
4193
4194 The step above will create the utility bkf, which is the free
4195 BitKeeper client.
4196
4197 To install the BitKeeper client on Windows, use these
4198 instructions:
4199 1. Download and install Cygwin from http://cygwin.com
4200 (http://cygwin.com/).
4201 2. Make sure patch, tar, gcc and make have been installed under
4202 Cygwin. You can test this by issuing which gcc for each
4203 command. If a required tool is not installed, run Cygwin's
4204 package manager, select the required tools and install them.
4205 3. For the installation of the BitKeeper free client, use the
4206 same installations as given for Unix-like systems above.
4207
4208 For more information on bkf, use:
4209 shell> bkf --help
4210
4211 After you have installed the BitKeeper client, you can access the
4212 MySQL development source tree:
4213 1. Change location to the directory you want to work from, and
4214 then use the following command to make a local copy of the
4215 MySQL 5.0 branch:
4216 shell> bkf clone bk://mysql.bkbits.net/mysql-5.0 mysql-5.0
4217 In the preceding example, the source tree is set up in the
4218 mysql-5.0/ subdirectory of your current directory.
4219 The initial download of the source tree may take a while,
4220 depending on the speed of your connection. Please be patient.
4221 2. You need GNU make, autoconf 2.58 (or newer), automake 1.8.1,
4222 libtool 1.5, and m4 to run the next set of commands. Even
4223 though many operating systems come with their own
4224 implementation of make, chances are high that the compilation
4225 fails with strange error messages. Therefore, it is highly
4226 recommended that you use GNU make (sometimes named gmake)
4227 instead.
4228 Fortunately, a large number of operating systems ship with the
4229 GNU toolchain preinstalled or supply installable packages of
4230 these. In any case, they can also be downloaded from the
4231 following locations:
4232 + http://www.gnu.org/software/autoconf/
4233 + http://www.gnu.org/software/automake/
4234 + http://www.gnu.org/software/libtool/
4235 + http://www.gnu.org/software/m4/
4236 + http://www.gnu.org/software/make/
4237 To configure MySQL 5.0, you also need GNU bison. You should
4238 use the latest version of bison where possible. Version 1.75
4239 and version 2.1 are known to work. There have been reported
4240 problems with bison 1.875. If you experience problems, upgrade
4241 to a later, rather than earlier, version. Versions of bison
4242 older than 1.75 may report this error:
4243 sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded
4244 Note: The maximum table size is not actually exceeded; the
4245 error is caused by bugs in older versions of bison.
4246 The following example shows the typical commands required to
4247 configure a source tree. The first cd command changes location
4248 into the top-level directory of the tree; replace mysql-5.0
4249 with the appropriate directory name.
4250 shell> cd mysql-5.0
4251 shell> (cd bdb/dist; sh s_all)
4252 shell> (cd innobase; autoreconf --force --install)
4253 shell> autoreconf --force --install
4254 shell> ./configure # Add your favorite options here
4255 shell> make
4256 Or you can use BUILD/autorun.sh as a shortcut for the
4257 following sequence of commands:
4258 shell> aclocal; autoheader
4259 shell> libtoolize --automake --force
4260 shell> automake --force --add-missing; autoconf
4261 shell> (cd innobase; aclocal; autoheader; autoconf; automake)
4262 shell> (cd bdb/dist; sh s_all)
4263 The command lines that change directory into the innobase and
4264 bdb/dist directories are used to configure the InnoDB and
4265 Berkeley DB (BDB) storage engines. You can omit these command
4266 lines if you to not require InnoDB or BDB support.
4267 If you get some strange errors during this stage, verify that
4268 you really have libtool installed.
4269 A collection of our standard configuration scripts is located
4270 in the BUILD/ subdirectory. You may find it more convenient to
4271 use the BUILD/compile-pentium-debug script than the preceding
4272 set of shell commands. To compile on a different architecture,
4273 modify the script by removing flags that are Pentium-specific.
4274 3. When the build is done, run make install. Be careful with this
4275 on a production machine; the command may overwrite your live
4276 release installation. If you have another installation of
4277 MySQL, we recommend that you run ./configure with different
4278 values for the --prefix, --with-tcp-port, and
4279 --unix-socket-path options than those used for your production
4280 server.
4281 4. Play hard with your new installation and try to make the new
4282 features crash. Start by running make test. See Section
4283 25.1.2, "MySQL Test Suite."
4284 5. If you have gotten to the make stage, but the distribution
4285 does not compile, please enter the problem into our bugs
4286 database using the instructions given in Section 1.7, "How to
4287 Report Bugs or Problems." If you have installed the latest
4288 versions of the required GNU tools, and they crash trying to
4289 process our configuration files, please report that also.
4290 However, if you execute aclocal and get a command not found
4291 error or a similar problem, do not report it. Instead, make
4292 sure that all the necessary tools are installed and that your
4293 PATH variable is set correctly so that your shell can find
4294 them.
4295 6. After initially copying the repository with bkf to obtain the
4296 source tree, you should use pull option to periodically update
4297 your local copy. To do this any time after you have set up the
4298 repository, use this command:
4299 shell> bkf pull
4300 7. You can examine the changeset comments for the tree by using
4301 the changes option to bkf:
4302 shell> bkf changes
4303 To get a list of the changes that would be applied with the
4304 next bkf pull:
4305 shell> bkf changes -R
4306 To obtain a patch file for a specific changeset (CSETID), use:
4307 shell> bkf changes -vvrCSETID
4308 If you see diffs or code that you have a question about, do
4309 not hesitate to send email to the MySQL Internals mailing
4310 list. (See Section 1.6.1, "MySQL Mailing Lists.") Also, if you
4311 think you have a better idea on how to do something, send an
4312 email message to the list with your proposed patch.
4313
4314 You can also browse changesets, comments, and source code online.
4315 To browse this information for MySQL 5.0, go to
4316 http://mysql.bkbits.net:8080/mysql-5.0.
4317
4318 2.4.15.4. Dealing with Problems Compiling MySQL
4319
4320 This section does not apply to MySQL Enterprise Server users.
4321
4322 All MySQL programs compile cleanly for us with no warnings on
4323 Solaris or Linux using gcc. On other systems, warnings may occur
4324 due to differences in system include files. See Section 2.4.15.5,
4325 "MIT-pthreads Notes," for warnings that may occur when using
4326 MIT-pthreads. For other problems, check the following list.
4327
4328 The solution to many problems involves reconfiguring. If you do
4329 need to reconfigure, take note of the following:
4330 * If configure is run after it has previously been run, it may
4331 use information that was gathered during its previous
4332 invocation. This information is stored in config.cache. When
4333 configure starts up, it looks for that file and reads its
4334 contents if it exists, on the assumption that the information
4335 is still correct. That assumption is invalid when you
4336 reconfigure.
4337 * Each time you run configure, you must run make again to
4338 recompile. However, you may want to remove old object files
4339 from previous builds first because they were compiled using
4340 different configuration options.
4341
4342 To prevent old configuration information or object files from
4343 being used, run these commands before re-running configure:
4344 shell> rm config.cache
4345 shell> make clean
4346
4347 Alternatively, you can run make distclean.
4348
4349 The following list describes some of the problems when compiling
4350 MySQL that have been found to occur most often:
4351 * If you get errors such as the ones shown here when compiling
4352 sql_yacc.cc, you probably have run out of memory or swap
4353 space:
4354 Internal compiler error: program cc1plus got fatal signal 11
4355 Out of virtual memory
4356 Virtual memory exhausted
4357 The problem is that gcc requires a huge amount of memory to
4358 compile sql_yacc.cc with inline functions. Try running
4359 configure with the --with-low-memory option:
4360 shell> ./configure --with-low-memory
4361 This option causes -fno-inline to be added to the compile line
4362 if you are using gcc and -O0 if you are using something else.
4363 You should try the --with-low-memory option even if you have
4364 so much memory and swap space that you think you can't
4365 possibly have run out. This problem has been observed to occur
4366 even on systems with generous hardware configurations, and the
4367 --with-low-memory option usually fixes it.
4368 * By default, configure picks c++ as the compiler name and GNU
4369 c++ links with -lg++. If you are using gcc, that behavior can
4370 cause problems during configuration such as this:
4371 configure: error: installation or configuration problem:
4372 C++ compiler cannot create executables.
4373 You might also observe problems during compilation related to
4374 g++, libg++, or libstdc++.
4375 One cause of these problems is that you may not have g++, or
4376 you may have g++ but not libg++, or libstdc++. Take a look at
4377 the config.log file. It should contain the exact reason why
4378 your C++ compiler didn't work. To work around these problems,
4379 you can use gcc as your C++ compiler. Try setting the
4380 environment variable CXX to "gcc -O3". For example:
4381 shell> CXX="gcc -O3" ./configure
4382 This works because gcc compiles C++ source files as well as
4383 g++ does, but does not link in libg++ or libstdc++ by default.
4384 Another way to fix these problems is to install g++, libg++,
4385 and libstdc++. However, we recommend that you not use libg++
4386 or libstdc++ with MySQL because this only increases the binary
4387 size of mysqld without providing any benefits. Some versions
4388 of these libraries have also caused strange problems for MySQL
4389 users in the past.
4390 * If your compile fails with errors such as any of the
4391 following, you must upgrade your version of make to GNU make:
4392 making all in mit-pthreads
4393 make: Fatal error in reader: Makefile, line 18:
4394 Badly formed macro assignment
4395 Or:
4396 make: file `Makefile' line 18: Must be a separator (:
4397 Or:
4398 pthread.h: No such file or directory
4399 Solaris and FreeBSD are known to have troublesome make
4400 programs.
4401 GNU make 3.75 is known to work.
4402 * If you want to define flags to be used by your C or C++
4403 compilers, do so by adding the flags to the CFLAGS and
4404 CXXFLAGS environment variables. You can also specify the
4405 compiler names this way using CC and CXX. For example:
4406 shell> CC=gcc
4407 shell> CFLAGS=-O3
4408 shell> CXX=gcc
4409 shell> CXXFLAGS=-O3
4410 shell> export CC CFLAGS CXX CXXFLAGS
4411 See Section 2.4.3.4, "MySQL Binaries Compiled by MySQL AB,"
4412 for a list of flag definitions that have been found to be
4413 useful on various systems.
4414 * If you get errors such as those shown here when compiling
4415 mysqld, configure did not correctly detect the type of the
4416 last argument to accept(), getsockname(), or getpeername():
4417 cxx: Error: mysqld.cc, line 645: In this statement, the referenced
4418 type of the pointer value ''length'' is ''unsigned long'',
4419 which is not compatible with ''int''.
4420 new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
4421 To fix this, edit the config.h file (which is generated by
4422 configure). Look for these lines:
4423 /* Define as the base type of the last arg to accept */
4424 #define SOCKET_SIZE_TYPE XXX
4425 Change XXX to size_t or int, depending on your operating
4426 system. (You must do this each time you run configure because
4427 configure regenerates config.h.)
4428 * The sql_yacc.cc file is generated from sql_yacc.yy. Normally,
4429 the build process does not need to create sql_yacc.cc because
4430 MySQL comes with a pre-generated copy. However, if you do need
4431 to re-create it, you might encounter this error:
4432 "sql_yacc.yy", line xxx fatal: default action causes potential...
4433 This is a sign that your version of yacc is deficient. You
4434 probably need to install bison (the GNU version of yacc) and
4435 use that instead.
4436 * On Debian Linux 3.0, you need to install gawk instead of the
4437 default mawk if you want to compile MySQL with Berkeley DB
4438 support.
4439 * If you need to debug mysqld or a MySQL client, run configure
4440 with the --with-debug option, and then recompile and link your
4441 clients with the new client library. See MySQL Internals:
4442 Porting(http://forge.mysql.com/wiki/MySQL_Internals_Porting).
4443 * If you get a compilation error on Linux (for example, SuSE
4444 Linux 8.1 or Red Hat Linux 7.3) similar to the following one,
4445 you probably do not have g++ installed:
4446 libmysql.c:1329: warning: passing arg 5 of `gethostbyname_r' from
4447 incompatible pointer type
4448 libmysql.c:1329: too few arguments to function `gethostbyname_r'
4449 libmysql.c:1329: warning: assignment makes pointer from integer
4450 without a cast
4451 make[2]: *** [libmysql.lo] Error 1
4452 By default, the configure script attempts to determine the
4453 correct number of arguments by using g++ (the GNU C++
4454 compiler). This test yields incorrect results if g++ is not
4455 installed. There are two ways to work around this problem:
4456 + Make sure that the GNU C++ g++ is installed. On some
4457 Linux distributions, the required package is called gpp;
4458 on others, it is named gcc-c++.
4459 + Use gcc as your C++ compiler by setting the CXX
4460 environment variable to gcc:
4461 export CXX="gcc"
4462 You must run configure again after making either of those
4463 changes.
4464
4465 2.4.15.5. MIT-pthreads Notes
4466
4467 This section does not apply to MySQL Enterprise Server users.
4468
4469 This section describes some of the issues involved in using
4470 MIT-pthreads.
4471
4472 On Linux, you should not use MIT-pthreads. Use the installed
4473 LinuxThreads implementation instead. See Section 2.4.19.1, "Linux
4474 Notes."
4475
4476 If your system does not provide native thread support, you should
4477 build MySQL using the MIT-pthreads package. This includes older
4478 FreeBSD systems, SunOS 4.x, Solaris 2.4 and earlier, and some
4479 others. See Section 2.4.2, "Operating Systems Supported by MySQL
4480 Community Server."
4481
4482 MIT-pthreads is not part of the MySQL 5.0 source distribution. If
4483 you require this package, you need to download it separately from
4484 http://dev.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-mysql.t
4485 ar.gz
4486
4487 After downloading, extract this source archive into the top level
4488 of the MySQL source directory. It creates a new subdirectory named
4489 mit-pthreads.
4490 * On most systems, you can force MIT-pthreads to be used by
4491 running configure with the --with-mit-threads option:
4492 shell> ./configure --with-mit-threads
4493 Building in a non-source directory is not supported when using
4494 MIT-pthreads because we want to minimize our changes to this
4495 code.
4496 * The checks that determine whether to use MIT-pthreads occur
4497 only during the part of the configuration process that deals
4498 with the server code. If you have configured the distribution
4499 using --without-server to build only the client code, clients
4500 do not know whether MIT-pthreads is being used and use Unix
4501 socket file connections by default. Because Unix socket files
4502 do not work under MIT-pthreads on some platforms, this means
4503 you need to use -h or --host with a value other than localhost
4504 when you run client programs.
4505 * When MySQL is compiled using MIT-pthreads, system locking is
4506 disabled by default for performance reasons. You can tell the
4507 server to use system locking with the --external-locking
4508 option. This is needed only if you want to be able to run two
4509 MySQL servers against the same data files, but that is not
4510 recommended, anyway.
4511 * Sometimes the pthread bind() command fails to bind to a socket
4512 without any error message (at least on Solaris). The result is
4513 that all connections to the server fail. For example:
4514 shell> mysqladmin version
4515 mysqladmin: connect to server at '' failed;
4516 error: 'Can't connect to mysql server on localhost (146)'
4517 The solution to this problem is to kill the mysqld server and
4518 restart it. This has happened to us only when we have forcibly
4519 stopped the server and restarted it immediately.
4520 * With MIT-pthreads, the sleep() system call isn't interruptible
4521 with SIGINT (break). This is noticeable only when you run
4522 mysqladmin --sleep. You must wait for the sleep() call to
4523 terminate before the interrupt is served and the process
4524 stops.
4525 * When linking, you might receive warning messages like these
4526 (at least on Solaris); they can be ignored:
4527 ld: warning: symbol `_iob' has differing sizes:
4528 (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
4529 file /usr/lib/libc.so value=0x140);
4530 /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
4531 ld: warning: symbol `__iob' has differing sizes:
4532 (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
4533 file /usr/lib/libc.so value=0x140);
4534 /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
4535 * Some other warnings also can be ignored:
4536 implicit declaration of function `int strtoll(...)'
4537 implicit declaration of function `int strtoul(...)'
4538 * We have not been able to make readline work with MIT-pthreads.
4539 (This is not necessary, but may be of interest to some.)
4540
4541 2.4.15.6. Installing MySQL from Source on Windows
4542
4543 This section does not apply to MySQL Enterprise Server users.
4544
4545 These instructions describe how to build binaries from source for
4546 MySQL 5.0 on Windows. Instructions are provided for building
4547 binaries from a standard source distribution or from the BitKeeper
4548 tree that contains the latest development source.
4549
4550 Note
4551
4552 The instructions here are strictly for users who want to test
4553 MySQL on Microsoft Windows from the latest source distribution or
4554 from the BitKeeper tree. For production use, MySQL AB does not
4555 advise using a MySQL server built by yourself from source.
4556 Normally, it is best to use precompiled binary distributions of
4557 MySQL that are built specifically for optimal performance on
4558 Windows by MySQL AB. Instructions for installing binary
4559 distributions are available in Section 2.4.8, "Installing MySQL on
4560 Windows."
4561
4562 To build MySQL on Windows from source, you must satisfy the
4563 following system, compiler, and resource requirements:
4564 * Windows 2000, Windows XP, or newer version. Windows Vista is
4565 not supported until Microsoft certifies Visual Studio 2005 on
4566 Vista.
4567 * To build from the standard source distribution, you will need
4568 CMake, which can be downloaded from http://www.cmake.org.
4569 After installing, modify your path to include the cmake
4570 binary.
4571 * Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net
4572 2003 (7.1), or Visual Studio 2005 (8.0) compiler system.
4573 * If you are using Visual C++ 2005 Express Edition, you must
4574 also install an appropriate Platform SDK. More information and
4575 links to downloads for various Windows platforms is available
4576 from
4577 http://www.microsoft.com/downloads/details.aspx?familyid=0baf2
4578 b35-c656-4969-ace8-e4c0c0716adb/.
4579 * If you are compiling from a BitKeeper tree or making changes
4580 to the parser, you need bison for Windows, which can be
4581 downloaded from
4582 http://gnuwin32.sourceforge.net/packages/bison.htm.Download
4583 the package labeled "Complete package, excluding sources".
4584 After installing the package, modify your path to include the
4585 bison binary and ensure that this binary is accessible from
4586 Visual Studio.
4587 * Cygwin might be necessary if you want to run the test script
4588 or package the compiled binaries and support files into a Zip
4589 archive. (Cygwin is needed only to test or package the
4590 distribution, not to build it.) Cygwin is available from
4591 http://cygwin.com.
4592 * 3GB to 5GB of disk space.
4593
4594 The exact system requirements can be found here:
4595 http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as
4596 px and
4597 http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx
4598
4599 There are three solutions available for building from the source
4600 code on Windows:
4601 * Build from the standard MySQL source distribution. For this
4602 you will need CMake and Visual C++ Express Edition or Visual
4603 Studio. Using this method you can select the storage engines
4604 that are included in your build. To use this method, see
4605 Section 2.4.15.6.1, "Building MySQL from the Standard Source
4606 Distribution."
4607 * Build from the MySQL Windows source distribution. The Windows
4608 source distribution includes ready-made Visual Studio solution
4609 files that enable support for all storage engines (except
4610 NDB). To build using using method you only need Visual C++
4611 Express Edition or Visual Studio. To use this method, see
4612 Section 2.4.15.6.2, "Building MySQL from a Windows Source
4613 Distribution."
4614 * Build directly from the BitKeeper source repository. For this
4615 you will need CMake, Visual C++ Express Edition or Visual
4616 Studio, and bison. For this method you need to create the
4617 distribution on a Unix system and then copy the generated
4618 files to your Windows build environment. To use this method,
4619 see Section 2.4.15.6.5, "Creating a Windows Source Package
4620 from the BitKeeper Repository."
4621
4622 If you find something not working as expected, or you have
4623 suggestions about ways to improve the current build process on
4624 Windows, please send a message to the win32 mailing list. See
4625 Section 1.6.1, "MySQL Mailing Lists."
4626
4627 2.4.15.6.1. Building MySQL from the Standard Source Distribution
4628
4629 This section does not apply to MySQL Enterprise Server users.
4630
4631 You can build MySQL on Windows by using a combination of cmake and
4632 Microsoft Visual Studio .NET 2003 (7.1), Micrsofot Visual Studio
4633 2005 (8.0) or Microsoft Visual C++ 2005 Express Edition. You must
4634 have the appropriate Microsoft Platform SDK installed.
4635
4636 Note
4637
4638 To compile from the source code usin CMake you must use the
4639 standard source distribution (for example, mysql-5.0.45.tar.gz).
4640 You build from the same distribution as used to build MySQL on
4641 Unix, Linux and other platforms. Do not use the Windows Source
4642 distributions as they do not contain the necessary configuration
4643 script and other files.
4644
4645 Follow this procedure to build MySQL:
4646 1. If you are installing from a packaged source distribution,
4647 create a work directory (for example, C:\workdir), and unpack
4648 the source distribution there using WinZip or another Windows
4649 tool that can read .zip files. This directory is the work
4650 directory in the following instructions.
4651 2. If you are installing from a BitKeeper tree, the root
4652 directory of that tree is the work directory in the following
4653 instructions.
4654 3. Using a command shell, navigate to the work directory and run
4655 the following command:
4656 C:\workdir>win\configure options
4657 These options are available:
4658 + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage
4659 engine.
4660 + WITH_PARTITION_STORAGE_ENGINE: Enable user-defined
4661 partitioning.
4662 + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage
4663 engine.
4664 + WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE
4665 storage engine.
4666 + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage
4667 engine.
4668 + WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED
4669 storage engine.
4670 + __NT__: Enable support for named pipes.
4671 + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none.
4672 + COMPILATION_COMMENT=comment: Server comment, default
4673 "Source distribution".
4674 + MYSQL_TCP_PORT=port: Server port, default 3306.
4675 + DISABLE_GRANT_OPTIONS: Disables the the --bootstrap,
4676 --skip-grant-tables, and --init-file options for mysqld.
4677 This option is available as of MySQL 5.0.36.
4678 For example (type the command on one line):
4679 C:\workdir>win\configure WITH_INNOBASE_STORAGE_ENGINE ��
4680 WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
4681 4. From the work directory, execute the win\build-vs8.bat or
4682 win\build-vs71.bat file, depending on the version of Visual
4683 Studio you have installed. The script invokes CMake, which
4684 generates the mysql.sln solution file you will need to build
4685 MySQL using Visual Studio..
4686 You can also use win\build-vs8_x64.bat to build the 64-bit
4687 version of MySQL. However, you cannot build the 64-bit version
4688 with Visual Studio Express Edition. You must use Visual Studio
4689 2005 (8.0) or higher.
4690 5. From the work directory, open the generated mysql.sln file
4691 with Visual Studio and select the proper configuration using
4692 the Configuration menu. The menu provides Debug, Release,
4693 RelwithDebInfo, MinRelInfo options. Then select Solution >
4694 Build to build the solution.
4695 The build process will take some time. Please be patient.
4696 Remember the configuration that you use in this step. It is
4697 important later when you run the test script because that
4698 script needs to know which configuration you used.
4699 6. You should test you build before installation. See Section
4700 2.4.15.6.4, "Testing a Windows Source Build."
4701 7. To install, use the instructions in Section 2.4.15.6.3,
4702 "Installing MySQL from a Source Build on Windows."
4703
4704 2.4.15.6.2. Building MySQL from a Windows Source Distribution
4705
4706 This section does not apply to MySQL Enterprise Server users.
4707
4708 The Windows source distribution includes the necessary solution
4709 file and the vcproj files required to build each component. Using
4710 this method you are not able to select the storage engines that
4711 are included in your build.
4712
4713 Note
4714
4715 VC++ workspace files for MySQL 4.1 and above are compatible with
4716 Microsoft Visual Studio 7.1 and tested by MySQL AB staff before
4717 each release.
4718
4719 Follow this procedure to build MySQL:
4720 1. Create a work directory (for example, C:\workdir).
4721 2. Unpack the source distribution in the aforementioned directory
4722 using WinZip or another Windows tool that can read .zip files.
4723 3. Start Visual Studio .Net 2003 (7.1).
4724 4. From the File menu, select Open Solution....
4725 5. Open the mysql.sln solution you find in the work directory.
4726 6. From the Build menu, select Configuration Manager....
4727 7. In the Active Solution Configuration pop-up menu, select the
4728 configuration to use. You likely want to use one of nt (normal
4729 server), Max nt (more engines and features), or Debug
4730 configuration.
4731 8. From the Build menu, select Build Solution.
4732 9. Debug versions of the programs and libraries are placed in the
4733 client_debug and lib_debug directories. Release versions of
4734 the programs and libraries are placed in the client_release
4735 and lib_release directories.
4736 10. You should test you build before installation. See Section
4737 2.4.15.6.4, "Testing a Windows Source Build."
4738 11. To install, use the instructions in Section 2.4.15.6.3,
4739 "Installing MySQL from a Source Build on Windows."
4740
4741 2.4.15.6.3. Installing MySQL from a Source Build on Windows
4742
4743 When you are satisfied that the program you have built is working
4744 correctly, stop the server. Now you can install the distribution.
4745 There are two ways to do this, either by using the supplied
4746 installation script or by copying the files individually by hand.
4747
4748 To use the script method you must have Cygwin installed as the
4749 script is a Shell script. To execute the installation process, run
4750 the make_win_bin_dist script in the scripts directory of the MySQL
4751 source distribution (see Section 4.4.2, "make_win_bin_dist ---
4752 Package MySQL Distribution as ZIP Archive"). This is a shell
4753 script, so you must have Cygwin installed if you want to use it.
4754 It creates a Zip archive of the built executables and support
4755 files that you can unpack to your desired installation location.
4756
4757 It is also possible to install MySQL by copying directories and
4758 files manually:
4759 1. Create the directories where you want to install MySQL. For
4760 example, to install into C:\mysql, use these commands:
4761 C:\> mkdir C:\mysql
4762 C:\> mkdir C:\mysql\bin
4763 C:\> mkdir C:\mysql\data
4764 C:\> mkdir C:\mysql\share
4765 C:\> mkdir C:\mysql\scripts
4766 If you want to compile other clients and link them to MySQL,
4767 you should also create several additional directories:
4768 C:\> mkdir C:\mysql\include
4769 C:\> mkdir C:\mysql\lib
4770 C:\> mkdir C:\mysql\lib\debug
4771 C:\> mkdir C:\mysql\lib\opt
4772 If you want to benchmark MySQL, create this directory:
4773 C:\> mkdir C:\mysql\sql-bench
4774 Benchmarking requires Perl support. See Section 2.4.21, "Perl
4775 Installation Notes."
4776 2. From the work directory, copy into the C:\mysql directory the
4777 following directories:
4778 C:\> cd \workdir
4779 C:\workdir> copy client_release\*.exe C:\mysql\bin
4780 C:\workdir> copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.ex
4781 e
4782 C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E
4783 C:\workdir> xcopy share\*.* C:\mysql\share /E
4784 If you want to compile other clients and link them to MySQL,
4785 you should also copy several libraries and header files:
4786 C:\workdir> copy lib_debug\mysqlclient.lib C:\mysql\lib\debug
4787 C:\workdir> copy lib_debug\libmysql.* C:\mysql\lib\debug
4788 C:\workdir> copy lib_debug\zlib.* C:\mysql\lib\debug
4789 C:\workdir> copy lib_release\mysqlclient.lib C:\mysql\lib\opt
4790 C:\workdir> copy lib_release\libmysql.* C:\mysql\lib\opt
4791 C:\workdir> copy lib_release\zlib.* C:\mysql\lib\opt
4792 C:\workdir> copy include\*.h C:\mysql\include
4793 C:\workdir> copy libmysql\libmysql.def C:\mysql\include
4794 If you want to benchmark MySQL, you should also do this:
4795 C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E
4796
4797 After installation, set up and start the server in the same way as
4798 for binary Windows distributions. See Section 2.4.8, "Installing
4799 MySQL on Windows."
4800
4801 2.4.15.6.4. Testing a Windows Source Build
4802
4803 You should test the server that you have built from source before
4804 using the distribution.
4805
4806 To test the server you need to run the built mysqld. By default,
4807 using the source build examples, the MySQL base directory and data
4808 directory are C:\mysql and C:\mysql\data. If you want to test your
4809 server using the source tree root directory and its data directory
4810 as the base directory and data directory, you need to tell the
4811 server their pathnames. You can either do this on the command line
4812 with the --basedir and --datadir options, or by placing
4813 appropriate options in an option file. (See Section 4.2.2.2,
4814 "Using Option Files.") If you have an existing data directory
4815 elsewhere that you want to use, you can specify its pathname
4816 instead.
4817
4818 When the server is running in standalone fashion or as a service
4819 based on your configuration, try to connect to it from the mysql
4820 interactive command-line utility.
4821
4822 You can also run the standard test script, mysql-test-run.pl. This
4823 script is written in Perl, so you'll need either Cygwin or
4824 ActiveState Perl to run it. You may also need to install the
4825 modules required by the script. To run the test script, change
4826 location into the mysql-test directory under the work directory,
4827 set the MTR_VS_CONFIG environment variable to the configuration
4828 you selected earlier (or use the --vs-config option), and invoke
4829 mysql-test-run.pl. For example (using Cygwin and the bash shell):
4830 shell> cd mysql-test
4831 shell> export MTS_VS_CONFIG=debug
4832 shell> ./mysqltest-run.pl --force --timer
4833 shell> ./mysqltest-run.pl --force --timer --ps-protocol
4834
4835 2.4.15.6.5. Creating a Windows Source Package from the BitKeeper
4836 Repository
4837
4838 This section does not apply to MySQL Enterprise Server users.
4839
4840 To create a Windows source package from the current BitKeeper
4841 source tree, use the instructions here. This procedure must be
4842 performed on a system running a Unix or Unix-like operating system
4843 because some of the configuration and build steps require tools
4844 that work only on Unix. For example, the following procedure is
4845 known to work well on Linux.
4846 1. Copy the BitKeeper source tree for MySQL 5.0. For instructions
4847 on how to do this, see Section 2.4.15.3, "Installing from the
4848 Development Source Tree."
4849 2. Configure and build the distribution so that you have a server
4850 binary to work with. One way to do this is to run the
4851 following command in the top-level directory of your source
4852 tree:
4853 shell> ./BUILD/compile-pentium-max
4854 3. After making sure that the build process completed
4855 successfully, run the following utility script from top-level
4856 directory of your source tree:
4857 shell> ./scripts/make_win_src_distribution
4858 This script creates a Windows source package to be used on
4859 your Windows system. You can supply different options to the
4860 script based on your needs. See Section 4.4.3,
4861 "make_win_src_distribution --- Create Source Distribution for
4862 Windows," for a list of allowable options.
4863 By default, make_win_src_distribution creates a Zip-format
4864 archive with the name mysql-VERSION-win-src.zip, where VERSION
4865 represents the version of your MySQL source tree.
4866 4. Copy or upload the Windows source package that you have just
4867 created to your Windows machine. To compile it, use the
4868 instructions in Section 2.4.15.6.2, "Building MySQL from a
4869 Windows Source Distribution."
4870
4871 2.4.15.7. Compiling MySQL Clients on Windows
4872
4873 This section does not apply to MySQL Enterprise Server users.
4874
4875 In your source files, you should include my_global.h before
4876 mysql.h:
4877 #include <my_global.h>
4878 #include <mysql.h>
4879
4880 my_global.h includes any other files needed for Windows
4881 compatibility (such as windows.h) if you compile your program on
4882 Windows.
4883
4884 You can either link your code with the dynamic libmysql.lib
4885 library, which is just a wrapper to load in libmysql.dll on
4886 demand, or link with the static mysqlclient.lib library.
4887
4888 The MySQL client libraries are compiled as threaded libraries, so
4889 you should also compile your code to be multi-threaded.
4890
4891 2.4.16. Post-Installation Setup and Testing
4892
4893 After installing MySQL, there are some issues that you should
4894 address. For example, on Unix, you should initialize the data
4895 directory and create the MySQL grant tables. On all platforms, an
4896 important security concern is that the initial accounts in the
4897 grant tables have no passwords. You should assign passwords to
4898 prevent unauthorized access to the MySQL server. Optionally, you
4899 can create time zone tables to enable recognition of named time
4900 zones.
4901
4902 The following sections include post-installation procedures that
4903 are specific to Windows systems and to Unix systems. Another
4904 section, Section 2.4.16.2.3, "Starting and Troubleshooting the
4905 MySQL Server," applies to all platforms; it describes what to do
4906 if you have trouble getting the server to start. Section 2.4.16.3,
4907 "Securing the Initial MySQL Accounts," also applies to all
4908 platforms. You should follow its instructions to make sure that
4909 you have properly protected your MySQL accounts by assigning
4910 passwords to them.
4911
4912 When you are ready to create additional user accounts, you can
4913 find information on the MySQL access control system and account
4914 management in Section 5.4, "The MySQL Access Privilege System,"
4915 and Section 5.5, "MySQL User Account Management."
4916
4917 2.4.16.1. Windows Post-Installation Procedures
4918
4919 On Windows, the data directory and the grant tables do not have to
4920 be created. MySQL Windows distributions include the grant tables
4921 with a set of preinitialized accounts in the mysql database under
4922 the data directory. It is unnecessary to run the mysql_install_db
4923 script that is used on Unix. Regarding passwords, if you installed
4924 MySQL using the Windows Installation Wizard, you may have already
4925 assigned passwords to the accounts. (See Section 2.4.8.3, "Using
4926 the MySQL Installation Wizard.") Otherwise, use the
4927 password-assignment procedure given in Section 2.4.16.3, "Securing
4928 the Initial MySQL Accounts."
4929
4930 Before setting up passwords, you might want to try running some
4931 client programs to make sure that you can connect to the server
4932 and that it is operating properly. Make sure that the server is
4933 running (see Section 2.4.8.9, "Starting the Server for the First
4934 Time"), and then issue the following commands to verify that you
4935 can retrieve information from the server. The output should be
4936 similar to what is shown here:
4937 C:\> C:\mysql\bin\mysqlshow
4938 +-----------+
4939 | Databases |
4940 +-----------+
4941 | mysql |
4942 | test |
4943 +-----------+
4944
4945 C:\> C:\mysql\bin\mysqlshow mysql
4946 Database: mysql
4947 +---------------------------+
4948 | Tables |
4949 +---------------------------+
4950 | columns_priv |
4951 | db |
4952 | func |
4953 | help_category |
4954 | help_keyword |
4955 | help_relation |
4956 | help_topic |
4957 | host |
4958 | proc |
4959 | procs_priv |
4960 | tables_priv |
4961 | time_zone |
4962 | time_zone_leap_second |
4963 | time_zone_name |
4964 | time_zone_transition |
4965 | time_zone_transition_type |
4966 | user |
4967 +---------------------------+
4968
4969 C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM db" mysql
4970 +------+-------+------+
4971 | host | db | user |
4972 +------+-------+------+
4973 | % | test% | |
4974 +------+-------+------+
4975
4976 If you are running a version of Windows that supports services and
4977 you want the MySQL server to run automatically when Windows
4978 starts, see Section 2.4.8.11, "Starting MySQL as a Windows
4979 Service."
4980
4981 2.4.16.2. Unix Post-Installation Procedures
4982
4983 After installing MySQL on Unix, you need to initialize the grant
4984 tables, start the server, and make sure that the server works
4985 satisfactorily. You may also wish to arrange for the server to be
4986 started and stopped automatically when your system starts and
4987 stops. You should also assign passwords to the accounts in the
4988 grant tables.
4989
4990 On Unix, the grant tables are set up by the mysql_install_db
4991 program. For some installation methods, this program is run for
4992 you automatically:
4993 * If you install MySQL on Linux using RPM distributions, the
4994 server RPM runs mysql_install_db.
4995 * If you install MySQL on Mac OS X using a PKG distribution, the
4996 installer runs mysql_install_db.
4997
4998 Otherwise, you will need to run mysql_install_db yourself.
4999
5000 The following procedure describes how to initialize the grant
5001 tables (if that has not previously been done) and then start the
5002 server. It also suggests some commands that you can use to test
5003 whether the server is accessible and working properly. For
5004 information about starting and stopping the server automatically,
5005 see Section 2.4.16.2.2, "Starting and Stopping MySQL
5006 Automatically."
5007
5008 After you complete the procedure and have the server running, you
5009 should assign passwords to the accounts created by
5010 mysql_install_db. Instructions for doing so are given in Section
5011 2.4.16.3, "Securing the Initial MySQL Accounts."
5012
5013 In the examples shown here, the server runs under the user ID of
5014 the mysql login account. This assumes that such an account exists.
5015 Either create the account if it does not exist, or substitute the
5016 name of a different existing login account that you plan to use
5017 for running the server.
5018 1. Change location into the top-level directory of your MySQL
5019 installation, represented here by BASEDIR:
5020 shell> cd BASEDIR
5021 BASEDIR is likely to be something like /usr/local/mysql or
5022 /usr/local. The following steps assume that you are located in
5023 this directory.
5024 2. If necessary, run the mysql_install_db program to set up the
5025 initial MySQL grant tables containing the privileges that
5026 determine how users are allowed to connect to the server.
5027 You'll need to do this if you used a distribution type for
5028 which the installation procedure doesn't run the program for
5029 you.
5030 Typically, mysql_install_db needs to be run only the first
5031 time you install MySQL, so you can skip this step if you are
5032 upgrading an existing installation, However, mysql_install_db
5033 does not overwrite any existing privilege tables, so it should
5034 be safe to run in any circumstances.
5035 To initialize the grant tables, use one of the following
5036 commands, depending on whether mysql_install_db is located in
5037 the bin or scripts directory:
5038 shell> bin/mysql_install_db --user=mysql
5039 shell> scripts/mysql_install_db --user=mysql
5040 The mysql_install_db script creates the server's data
5041 directory. Under the data directory, it creates directories
5042 for the mysql database that holds all database privileges and
5043 the test database that you can use to test MySQL. The script
5044 also creates privilege table entries for root and
5045 anonymous-user accounts. The accounts have no passwords
5046 initially. A description of their initial privileges is given
5047 in Section 2.4.16.3, "Securing the Initial MySQL Accounts."
5048 Briefly, these privileges allow the MySQL root user to do
5049 anything, and allow anybody to create or use databases with a
5050 name of test or starting with test_.
5051 It is important to make sure that the database directories and
5052 files are owned by the mysql login account so that the server
5053 has read and write access to them when you run it later. To
5054 ensure this, the --user option should be used as shown if you
5055 run mysql_install_db as root. Otherwise, you should execute
5056 the script while logged in as mysql, in which case you can
5057 omit the --user option from the command.
5058 mysql_install_db creates several tables in the mysql database,
5059 including user, db, host, tables_priv, columns_priv, func, and
5060 others. See Section 5.4, "The MySQL Access Privilege System,"
5061 for a complete listing and description of these tables.
5062 If you don't want to have the test database, you can remove it
5063 with mysqladmin -u root drop test after starting the server.
5064 If you have trouble with mysql_install_db at this point, see
5065 Section 2.4.16.2.1, "Problems Running mysql_install_db."
5066 3. Start the MySQL server:
5067 shell> bin/mysqld_safe --user=mysql &
5068 It is important that the MySQL server be run using an
5069 unprivileged (non-root) login account. To ensure this, the
5070 --user option should be used as shown if you run mysqld_safe
5071 as system root. Otherwise, you should execute the script while
5072 logged in to the system as mysql, in which case you can omit
5073 the --user option from the command.
5074 Further instructions for running MySQL as an unprivileged user
5075 are given in Section 5.3.5, "How to Run MySQL as a Normal
5076 User."
5077 If you neglected to create the grant tables before proceeding
5078 to this step, the following message appears in the error log
5079 file when you start the server:
5080 mysqld: Can't find file: 'host.frm'
5081 If you have other problems starting the server, see Section
5082 2.4.16.2.3, "Starting and Troubleshooting the MySQL Server."
5083 4. Use mysqladmin to verify that the server is running. The
5084 following commands provide simple tests to check whether the
5085 server is up and responding to connections:
5086 shell> bin/mysqladmin version
5087 shell> bin/mysqladmin variables
5088 The output from mysqladmin version varies slightly depending
5089 on your platform and version of MySQL, but should be similar
5090 to that shown here:
5091 shell> bin/mysqladmin version
5092 mysqladmin Ver 14.12 Distrib 5.0.56, for pc-linux-gnu on i686
5093 Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
5094 This software comes with ABSOLUTELY NO WARRANTY. This is free softwar
5095 e,
5096 and you are welcome to modify and redistribute it under the GPL licen
5097 se
5098
5099 Server version 5.0.56
5100 Protocol version 10
5101 Connection Localhost via UNIX socket
5102 UNIX socket /var/lib/mysql/mysql.sock
5103 Uptime: 14 days 5 hours 5 min 21 sec
5104
5105 Threads: 1 Questions: 366 Slow queries: 0
5106 Opens: 0 Flush tables: 1 Open tables: 19
5107 Queries per second avg: 0.000
5108 To see what else you can do with mysqladmin, invoke it with
5109 the --help option.
5110 5. Verify that you can shut down the server:
5111 shell> bin/mysqladmin -u root shutdown
5112 6. Verify that you can start the server again. Do this by using
5113 mysqld_safe or by invoking mysqld directly. For example:
5114 shell> bin/mysqld_safe --user=mysql --log &
5115 If mysqld_safe fails, see Section 2.4.16.2.3, "Starting and
5116 Troubleshooting the MySQL Server."
5117 7. Run some simple tests to verify that you can retrieve
5118 information from the server. The output should be similar to
5119 what is shown here:
5120 shell> bin/mysqlshow
5121 +-----------+
5122 | Databases |
5123 +-----------+
5124 | mysql |
5125 | test |
5126 +-----------+
5127
5128 shell> bin/mysqlshow mysql
5129 Database: mysql
5130 +---------------------------+
5131 | Tables |
5132 +---------------------------+
5133 | columns_priv |
5134 | db |
5135 | func |
5136 | help_category |
5137 | help_keyword |
5138 | help_relation |
5139 | help_topic |
5140 | host |
5141 | proc |
5142 | procs_priv |
5143 | tables_priv |
5144 | time_zone |
5145 | time_zone_leap_second |
5146 | time_zone_name |
5147 | time_zone_transition |
5148 | time_zone_transition_type |
5149 | user |
5150 +---------------------------+
5151
5152 shell> bin/mysql -e "SELECT Host,Db,User FROM db" mysql
5153 +------+--------+------+
5154 | host | db | user |
5155 +------+--------+------+
5156 | % | test | |
5157 | % | test_% | |
5158 +------+--------+------+
5159 8. There is a benchmark suite in the sql-bench directory (under
5160 the MySQL installation directory) that you can use to compare
5161 how MySQL performs on different platforms. The benchmark suite
5162 is written in Perl. It requires the Perl DBI module that
5163 provides a database-independent interface to the various
5164 databases, and some other additional Perl modules:
5165 DBI
5166 DBD::mysql
5167 Data::Dumper
5168 Data::ShowTable
5169 These modules can be obtained from CPAN
5170 (http://www.cpan.org/). See also Section 2.4.21.1, "Installing
5171 Perl on Unix."
5172 The sql-bench/Results directory contains the results from many
5173 runs against different databases and platforms. To run all
5174 tests, execute these commands:
5175 shell> cd sql-bench
5176 shell> perl run-all-tests
5177 If you don't have the sql-bench directory, you probably
5178 installed MySQL using RPM files other than the source RPM.
5179 (The source RPM includes the sql-bench benchmark directory.)
5180 In this case, you must first install the benchmark suite
5181 before you can use it. There are separate benchmark RPM files
5182 named mysql-bench-VERSION.i386.rpm that contain benchmark code
5183 and data.
5184 If you have a source distribution, there are also tests in its
5185 tests subdirectory that you can run. For example, to run
5186 auto_increment.tst, execute this command from the top-level
5187 directory of your source distribution:
5188 shell> mysql -vvf test < ./tests/auto_increment.tst
5189 The expected result of the test can be found in the
5190 ./tests/auto_increment.res file.
5191 9. At this point, you should have the server running. However,
5192 none of the initial MySQL accounts have a password, so you
5193 should assign passwords using the instructions found in
5194 Section 2.4.16.3, "Securing the Initial MySQL Accounts."
5195
5196 The MySQL 5.0 installation procedure creates time zone tables in
5197 the mysql database. However, you must populate the tables manually
5198 using the instructions in Section 8.9, "MySQL Server Time Zone
5199 Support."
5200
5201 2.4.16.2.1. Problems Running mysql_install_db
5202
5203 This section does not apply to MySQL Enterprise Server users.
5204
5205 The purpose of the mysql_install_db script is to generate new
5206 MySQL privilege tables. It does not overwrite existing MySQL
5207 privilege tables, and it does not affect any other data.
5208
5209 If you want to re-create your privilege tables, first stop the
5210 mysqld server if it's running. Then rename the mysql directory
5211 under the data directory to save it, and then run
5212 mysql_install_db. Suppose that your current directory is the MySQL
5213 installation directory and that mysql_install_db is located in the
5214 bin directory and the data directory is named data. To rename the
5215 mysql database and re-run mysql_install_db, use these commands.
5216 shell> mv data/mysql data/mysql.old
5217 shell> bin/mysql_install_db --user=mysql
5218
5219 When you run mysql_install_db, you might encounter the following
5220 problems:
5221 * mysql_install_db fails to install the grant tables
5222 You may find that mysql_install_db fails to install the grant
5223 tables and terminates after displaying the following messages:
5224 Starting mysqld daemon with databases from XXXXXX
5225 mysqld ended
5226 In this case, you should examine the error log file very
5227 carefully. The log should be located in the directory XXXXXX
5228 named by the error message and should indicate why mysqld
5229 didn't start. If you do not understand what happened, include
5230 the log when you post a bug report. See Section 1.7, "How to
5231 Report Bugs or Problems."
5232 * There is a mysqld process running
5233 This indicates that the server is running, in which case the
5234 grant tables have probably been created already. If so, there
5235 is no need to run mysql_install_db at all because it needs to
5236 be run only once (when you install MySQL the first time).
5237 * Installing a second mysqld server does not work when one
5238 server is running
5239 This can happen when you have an existing MySQL installation,
5240 but want to put a new installation in a different location.
5241 For example, you might have a production installation, but you
5242 want to create a second installation for testing purposes.
5243 Generally the problem that occurs when you try to run a second
5244 server is that it tries to use a network interface that is in
5245 use by the first server. In this case, you should see one of
5246 the following error messages:
5247 Can't start server: Bind on TCP/IP port:
5248 Address already in use
5249 Can't start server: Bind on unix socket...
5250 For instructions on setting up multiple servers, see Section
5251 5.7, "Running Multiple MySQL Servers on the Same Machine."
5252 * You do not have write access to the /tmp directory
5253 If you do not have write access to create temporary files or a
5254 Unix socket file in the default location (the /tmp directory),
5255 an error occurs when you run mysql_install_db or the mysqld
5256 server.
5257 You can specify different locations for the temporary
5258 directory and Unix socket file by executing these commands
5259 prior to starting mysql_install_db or mysqld, where
5260 some_tmp_dir is the full pathname to some directory for which
5261 you have write permission:
5262 shell> TMPDIR=/some_tmp_dir/
5263 shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysql.sock
5264 shell> export TMPDIR MYSQL_UNIX_PORT
5265 Then you should be able to run mysql_install_db and start the
5266 server with these commands:
5267 shell> bin/mysql_install_db --user=mysql
5268 shell> bin/mysqld_safe --user=mysql &
5269 If mysql_install_db is located in the scripts directory,
5270 modify the first command to scripts/mysql_install_db.
5271 See Section B.1.4.5, "How to Protect or Change the MySQL Unix
5272 Socket File," and Section 2.4.20, "Environment Variables."
5273
5274 There are some alternatives to running the mysql_install_db script
5275 provided in the MySQL distribution:
5276 * If you want the initial privileges to be different from the
5277 standard defaults, you can modify mysql_install_db before you
5278 run it. However, it is preferable to use GRANT and REVOKE to
5279 change the privileges after the grant tables have been set up.
5280 In other words, you can run mysql_install_db, and then use
5281 mysql -u root mysql to connect to the server as the MySQL root
5282 user so that you can issue the necessary GRANT and REVOKE
5283 statements.
5284 If you want to install MySQL on several machines with the same
5285 privileges, you can put the GRANT and REVOKE statements in a
5286 file and execute the file as a script using mysql after
5287 running mysql_install_db. For example:
5288 shell> bin/mysql_install_db --user=mysql
5289 shell> bin/mysql -u root < your_script_file
5290 By doing this, you can avoid having to issue the statements
5291 manually on each machine.
5292 * It is possible to re-create the grant tables completely after
5293 they have previously been created. You might want to do this
5294 if you're just learning how to use GRANT and REVOKE and have
5295 made so many modifications after running mysql_install_db that
5296 you want to wipe out the tables and start over.
5297 To re-create the grant tables, remove all the .frm, .MYI, and
5298 .MYD files in the mysql database directory. Then run the
5299 mysql_install_db script again.
5300 * You can start mysqld manually using the --skip-grant-tables
5301 option and add the privilege information yourself using mysql:
5302 shell> bin/mysqld_safe --user=mysql --skip-grant-tables &
5303 shell> bin/mysql mysql
5304 From mysql, manually execute the SQL commands contained in
5305 mysql_install_db. Make sure that you run mysqladmin
5306 flush-privileges or mysqladmin reload afterward to tell the
5307 server to reload the grant tables.
5308 Note that by not using mysql_install_db, you not only have to
5309 populate the grant tables manually, you also have to create
5310 them first.
5311
5312 2.4.16.2.2. Starting and Stopping MySQL Automatically
5313
5314 Generally, you start the mysqld server in one of these ways:
5315 * By invoking mysqld directly. This works on any platform.
5316 * By running the MySQL server as a Windows service. The service
5317 can be set to start the server automatically when Windows
5318 starts, or as a manual service that you start on request. For
5319 instructions, see Section 2.4.8.11, "Starting MySQL as a
5320 Windows Service."
5321 * By invoking mysqld_safe, which tries to determine the proper
5322 options for mysqld and then runs it with those options. This
5323 script is used on Unix and Unix-like systems. See Section
5324 4.3.2, "mysqld_safe --- MySQL Server Startup Script."
5325 * By invoking mysql.server. This script is used primarily at
5326 system startup and shutdown on systems that use System V-style
5327 run directories, where it usually is installed under the name
5328 mysql. The mysql.server script starts the server by invoking
5329 mysqld_safe. See Section 4.3.3, "mysql.server --- MySQL Server
5330 Startup Script."
5331 * On Mac OS X, you can install a separate MySQL Startup Item
5332 package to enable the automatic startup of MySQL on system
5333 startup. The Startup Item starts the server by invoking
5334 mysql.server. See Section 2.4.10, "Installing MySQL on Mac OS
5335 X," for details.
5336
5337 The mysqld_safe and mysql.server scripts and the Mac OS X Startup
5338 Item can be used to start the server manually, or automatically at
5339 system startup time. mysql.server and the Startup Item also can be
5340 used to stop the server.
5341
5342 To start or stop the server manually using the mysql.server
5343 script, invoke it with start or stop arguments:
5344 shell> mysql.server start
5345 shell> mysql.server stop
5346
5347 Before mysql.server starts the server, it changes location to the
5348 MySQL installation directory, and then invokes mysqld_safe. If you
5349 want the server to run as some specific user, add an appropriate
5350 user option to the [mysqld] group of the /etc/my.cnf option file,
5351 as shown later in this section. (It is possible that you will need
5352 to edit mysql.server if you've installed a binary distribution of
5353 MySQL in a non-standard location. Modify it to cd into the proper
5354 directory before it runs mysqld_safe. If you do this, your
5355 modified version of mysql.server may be overwritten if you upgrade
5356 MySQL in the future, so you should make a copy of your edited
5357 version that you can reinstall.)
5358
5359 mysql.server stop stops the server by sending a signal to it. You
5360 can also stop the server manually by executing mysqladmin
5361 shutdown.
5362
5363 To start and stop MySQL automatically on your server, you need to
5364 add start and stop commands to the appropriate places in your
5365 /etc/rc* files.
5366
5367 If you use the Linux server RPM package
5368 (MySQL-server-VERSION.rpm), the mysql.server script is installed
5369 in the /etc/init.d directory with the name mysql. You need not
5370 install it manually. See Section 2.4.9, "Installing MySQL from RPM
5371 Packages on Linux," for more information on the Linux RPM
5372 packages.
5373
5374 Some vendors provide RPM packages that install a startup script
5375 under a different name such as mysqld.
5376
5377 If you install MySQL from a source distribution or using a binary
5378 distribution format that does not install mysql.server
5379 automatically, you can install it manually. The script can be
5380 found in the support-files directory under the MySQL installation
5381 directory or in a MySQL source tree.
5382
5383 To install mysql.server manually, copy it to the /etc/init.d
5384 directory with the name mysql, and then make it executable. Do
5385 this by changing location into the appropriate directory where
5386 mysql.server is located and executing these commands:
5387 shell> cp mysql.server /etc/init.d/mysql
5388 shell> chmod +x /etc/init.d/mysql
5389
5390 Older Red Hat systems use the /etc/rc.d/init.d directory rather
5391 than /etc/init.d. Adjust the preceding commands accordingly.
5392 Alternatively, first create /etc/init.d as a symbolic link that
5393 points to /etc/rc.d/init.d:
5394 shell> cd /etc
5395 shell> ln -s rc.d/init.d .
5396
5397 After installing the script, the commands needed to activate it to
5398 run at system startup depend on your operating system. On Linux,
5399 you can use chkconfig:
5400 shell> chkconfig --add mysql
5401
5402 On some Linux systems, the following command also seems to be
5403 necessary to fully enable the mysql script:
5404 shell> chkconfig --level 345 mysql on
5405
5406 On FreeBSD, startup scripts generally should go in
5407 /usr/local/etc/rc.d/. The rc(8) manual page states that scripts in
5408 this directory are executed only if their basename matches the
5409 *.sh shell filename pattern. Any other files or directories
5410 present within the directory are