~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to INSTALL-SOURCE

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
1
2
Chapter 2. Installing and Upgrading MySQL
2
3
 
3
 
   This chapter describes how to obtain and install MySQL. A
4
 
   summary of the procedure follows and later sections provide
5
 
   the details. If you plan to upgrade an existing version of
6
 
   MySQL to a newer version rather than install MySQL for the
7
 
   first time, see Section 2.12, "Upgrading MySQL," for
8
 
   information about upgrade procedures and about issues that
9
 
   you should consider before upgrading.
 
4
   This chapter describes how to obtain and install MySQL. A summary
 
5
   of the procedure follows and later sections provide the details.
 
6
   If you plan to upgrade an existing version of MySQL to a newer
 
7
   version rather than install MySQL for the first time, see Section
 
8
   2.12.1, "Upgrading MySQL," for information about upgrade
 
9
   procedures and about issues that you should consider before
 
10
   upgrading.
10
11
 
11
 
   If you are interested in migrating to MySQL from another
12
 
   database system, you may wish to read Section A.8, "MySQL 5.1
13
 
   FAQ --- Migration," which contains answers to some common
14
 
   questions concerning migration issues.
 
12
   If you are interested in migrating to MySQL from another database
 
13
   system, you may wish to read Section A.8, "MySQL 5.1 FAQ ---
 
14
   Migration," which contains answers to some common questions
 
15
   concerning migration issues.
15
16
 
16
17
    1. Determine whether MySQL runs and is supported on your
17
18
       platform. Please note that not all platforms are equally
18
19
       suitable for running MySQL, and that not all platforms on
19
 
       which MySQL is known to run are officially supported by
20
 
       Sun Microsystems, Inc.:
21
 
 
22
 
          + For MySQL Enterprise Server, the officially
23
 
            supported platforms are listed at
24
 
            http://www.mysql.com/support/supportedplatforms.html
25
 
            .
26
 
 
27
 
          + MySQL Community Server runs on the platforms listed
28
 
            at Section 2.1.1, "Operating Systems Supported by
29
 
            MySQL Community Server."
 
20
       which MySQL is known to run are officially supported by Sun
 
21
       Microsystems, Inc.:
 
22
 
 
23
          + For MySQL Enterprise Server, the officially supported
 
24
            platforms are listed at
 
25
            http://www.mysql.com/support/supportedplatforms.html.
 
26
 
 
27
          + MySQL Community Server runs on the platforms listed at
 
28
            Section 2.1.1, "Operating Systems Supported by MySQL
 
29
            Community Server."
30
30
 
31
31
    2. Choose which distribution to install. Several versions of
32
32
       MySQL are available, and most are available in several
33
33
       distribution formats. You can choose from pre-packaged
34
34
       distributions containing binary (precompiled) programs or
35
 
       source code. When in doubt, use a binary distribution. We
36
 
       also provide public access to our current source tree for
37
 
       those who want to see our most recent developments and
38
 
       help us test new code. To determine which version and
39
 
       type of distribution you should use, see Section 2.1.2,
40
 
       "Choosing Which MySQL Distribution to Install."
 
35
       source code. When in doubt, use a binary distribution. We also
 
36
       provide public access to our current source tree for those who
 
37
       want to see our most recent developments and help us test new
 
38
       code. To determine which version and type of distribution you
 
39
       should use, see Section 2.1.2, "Choosing Which MySQL
 
40
       Distribution to Install."
41
41
 
42
42
    3. Download the distribution that you want to install. For
43
 
       instructions, see Section 2.1.3, "How to Get MySQL." To
44
 
       verify the integrity of the distribution, use the
45
 
       instructions in Section 2.1.4, "Verifying Package
46
 
       Integrity Using MD5 Checksums or GnuPG."
 
43
       instructions, see Section 2.1.3, "How to Get MySQL." To verify
 
44
       the integrity of the distribution, use the instructions in
 
45
       Section 2.1.4, "Verifying Package Integrity Using MD5
 
46
       Checksums or GnuPG."
47
47
 
48
48
    4. Install the distribution. To install MySQL from a binary
49
 
       distribution, use the instructions in Section 2.2,
50
 
       "Standard MySQL Installation Using a Binary
51
 
       Distribution." To install MySQL from a source
52
 
       distribution or from the current development source tree,
53
 
       use the instructions in Section 2.10, "MySQL Installation
54
 
       Using a Source Distribution."
55
 
       If you encounter installation difficulties, see Section
56
 
       2.14, "Operating System-Specific Notes," for information
57
 
       on solving problems for particular platforms.
 
49
       distribution, use the instructions in Section 2.2, "Standard
 
50
       MySQL Installation Using a Binary Distribution." To install
 
51
       MySQL from a source distribution or from the current
 
52
       development source tree, use the instructions in Section 2.10,
 
53
       "MySQL Installation Using a Source Distribution."
 
54
       If you encounter installation difficulties, see Section 2.13,
 
55
       "Operating System-Specific Notes," for information on solving
 
56
       problems for particular platforms.
58
57
 
59
58
    5. Perform any necessary post-installation setup. After
60
 
       installing MySQL, read Section 2.11, "Post-Installation
61
 
       Setup and Testing." This section contains important
62
 
       information about making sure the MySQL server is working
63
 
       properly. It also describes how to secure the initial
64
 
       MySQL user accounts, which have no passwords until you
65
 
       assign passwords. The section applies whether you install
66
 
       MySQL using a binary or source distribution.
 
59
       installing MySQL, read Section 2.11, "Post-Installation Setup
 
60
       and Testing." This section contains important information
 
61
       about making sure the MySQL server is working properly. It
 
62
       also describes how to secure the initial MySQL user accounts,
 
63
       which have no passwords until you assign passwords. The
 
64
       section applies whether you install MySQL using a binary or
 
65
       source distribution.
67
66
 
68
 
    6. If you want to run the MySQL benchmark scripts, Perl
69
 
       support for MySQL must be available. See Section 2.16,
70
 
       "Perl Installation Notes."
 
67
    6. If you want to run the MySQL benchmark scripts, Perl support
 
68
       for MySQL must be available. See Section 2.15, "Perl
 
69
       Installation Notes."
71
70
 
72
71
2.1. General Installation Issues
73
72
 
74
73
   The MySQL installation procedure depends on whether you will
75
 
   install MySQL Enterprise Server or MySQL Community Server.
76
 
   The set of applicable platforms depends on which distribution
77
 
   you will install:
 
74
   install MySQL Enterprise Server or MySQL Community Server. The set
 
75
   of applicable platforms depends on which distribution you will
 
76
   install:
78
77
 
79
78
     * For MySQL Enterprise Server, the officially supported
80
79
       platforms are listed at
81
80
       http://www.mysql.com/support/supportedplatforms.html.
82
81
 
83
 
     * MySQL Community Server runs on the platforms listed at
84
 
       Section 2.1.1, "Operating Systems Supported by MySQL
85
 
       Community Server."
86
 
 
87
 
   For MySQL Enterprise Server, install the main distribution
88
 
   plus any service packs or hotfixes that you wish to apply
89
 
   using the Enterprise Installer. For platforms that do not yet
90
 
   have an Enterprise Installer, use the Community Server
91
 
   instructions.
92
 
 
93
 
   For MySQL Community Server, install the main distribution
94
 
   plus any hotfixes and updates:
95
 
 
96
 
     * Download a binary release, or download a source release
97
 
       and build MySQL yourself from the source code.
98
 
 
99
 
     * Retrieve MySQL from the Bazaar tree and build it from
100
 
       source. The Bazaar tree contains the latest developer
101
 
       code.
 
82
     * MySQL Community Server runs on the platforms listed at Section
 
83
       2.1.1, "Operating Systems Supported by MySQL Community
 
84
       Server."
 
85
 
 
86
   For MySQL Enterprise Server, install the main distribution plus
 
87
   any service packs or hotfixes that you wish to apply using the
 
88
   Enterprise Installer. For platforms that do not yet have an
 
89
   Enterprise Installer, use the Community Server instructions.
 
90
 
 
91
   For MySQL Community Server, install the main distribution plus any
 
92
   hotfixes and updates:
 
93
 
 
94
     * Download a binary release, or download a source release and
 
95
       build MySQL yourself from the source code.
 
96
 
 
97
     * Retrieve MySQL from the Bazaar tree and build it from source.
 
98
       The Bazaar tree contains the latest developer code.
102
99
 
103
100
   The immediately following sections contain the information
104
 
   necessary to choose, download, and verify your distribution.
105
 
   The instructions in later sections of the chapter describe
106
 
   how to install the distribution that you choose. For binary
 
101
   necessary to choose, download, and verify your distribution. The
 
102
   instructions in later sections of the chapter describe how to
 
103
   install the distribution that you choose. For binary
107
104
   distributions, see the instructions at Section 2.2, "Standard
108
 
   MySQL Installation Using a Binary Distribution." To build
109
 
   MySQL from source, use the instructions at Section 2.10,
110
 
   "MySQL Installation Using a Source Distribution."
 
105
   MySQL Installation Using a Binary Distribution." To build MySQL
 
106
   from source, use the instructions at Section 2.10, "MySQL
 
107
   Installation Using a Source Distribution."
111
108
 
112
109
2.1.1. Operating Systems Supported by MySQL Community Server
113
110
 
114
 
   This section lists the operating systems on which MySQL
115
 
   Community Server is known to run.
 
111
   This section lists the operating systems on which MySQL Community
 
112
   Server is known to run.
116
113
 
117
114
Important
118
115
 
119
116
   Sun Microsystems, Inc. does not necessarily provide official
120
117
   support for all the platforms listed in this section. For
121
 
   information about those platforms that are officially
122
 
   supported, see MySQL Server Supported Platforms
 
118
   information about those platforms that are officially supported,
 
119
   see MySQL Server Supported Platforms
123
120
   (http://www.mysql.com/support/supportedplatforms.html) on the
124
121
   MySQL Web site.
125
122
 
126
 
   We use GNU Autoconf, so it is possible to port MySQL to all
127
 
   modern systems that have a C++ compiler and a working
128
 
   implementation of POSIX threads. (Thread support is needed
129
 
   for the server. To compile only the client code, the only
130
 
   requirement is a C++ compiler.)
131
 
 
132
 
   MySQL has been reported to compile successfully on the
133
 
   following combinations of operating system and thread
134
 
   package.
135
 
 
136
 
     * AIX 4.x, 5.x with native threads. See Section 2.14.5.3,
 
123
   We use GNU Autoconf, so it is possible to port MySQL to all modern
 
124
   systems that have a C++ compiler and a working implementation of
 
125
   POSIX threads. (Thread support is needed for the server. To
 
126
   compile only the client code, the only requirement is a C++
 
127
   compiler.)
 
128
 
 
129
   MySQL has been reported to compile successfully on the following
 
130
   combinations of operating system and thread package.
 
131
 
 
132
     * AIX 4.x, 5.x with native threads. See Section 2.13.5.3,
137
133
       "IBM-AIX notes."
138
134
 
139
135
     * Amiga.
140
136
 
141
137
     * FreeBSD 5.x and up with native threads.
142
138
 
143
 
     * HP-UX 11.x with the native threads. See Section 2.14.5.2,
 
139
     * HP-UX 11.x with the native threads. See Section 2.13.5.2,
144
140
       "HP-UX Version 11.x Notes."
145
141
 
146
 
     * Linux, builds on all fairly recent Linux distributions
147
 
       with glibc 2.3. See Section 2.14.1, "Linux Notes."
 
142
     * Linux, builds on all fairly recent Linux distributions with
 
143
       glibc 2.3. See Section 2.13.1, "Linux Notes."
148
144
 
149
 
     * Mac OS X. See Section 2.14.2, "Mac OS X Notes."
 
145
     * Mac OS X. See Section 2.13.2, "Mac OS X Notes."
150
146
 
151
147
     * NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha. See Section
152
 
       2.14.4.2, "NetBSD Notes."
153
 
 
154
 
     * Novell NetWare 6.0 and 6.5. See Section 2.8, "Installing
155
 
       MySQL on NetWare."
156
 
 
157
 
     * OpenBSD 2.5 and with native threads. OpenBSD earlier than
158
 
       2.5 with the MIT-pthreads package. See Section 2.14.4.3,
159
 
       "OpenBSD 2.5 Notes."
160
 
 
161
 
     * SCO OpenServer 5.0.X with a recent port of the FSU
162
 
       Pthreads package. See Section 2.14.5.8, "SCO UNIX and
163
 
       OpenServer 5.0.x Notes."
164
 
 
165
 
     * SCO Openserver 6.0.x. See Section 2.14.5.9, "SCO
166
 
       OpenServer 6.0.x Notes."
167
 
 
168
 
     * SCO UnixWare 7.1.x. See Section 2.14.5.10, "SCO UnixWare
169
 
       7.1.x and OpenUNIX 8.0.0 Notes."
170
 
 
171
 
     * SGI Irix 6.x with native threads. See Section 2.14.5.7,
172
 
       "SGI Irix Notes."
173
 
 
174
 
     * Solaris 2.5 and above with native threads on SPARC and
175
 
       x86. See Section 2.14.3, "Solaris Notes."
176
 
 
177
 
     * Tru64 Unix. See Section 2.14.5.5, "Alpha-DEC-UNIX Notes
 
148
       2.13.4.2, "NetBSD Notes."
 
149
 
 
150
     * Novell NetWare 6.0 and 6.5. See Section 2.8, "Installing MySQL
 
151
       on NetWare."
 
152
 
 
153
     * OpenBSD 2.5 and with native threads. OpenBSD earlier than 2.5
 
154
       with the MIT-pthreads package. See Section 2.13.4.3, "OpenBSD
 
155
       2.5 Notes."
 
156
 
 
157
     * SCO OpenServer 5.0.X with a recent port of the FSU Pthreads
 
158
       package. See Section 2.13.5.8, "SCO UNIX and OpenServer 5.0.x
 
159
       Notes."
 
160
 
 
161
     * SCO Openserver 6.0.x. See Section 2.13.5.9, "SCO OpenServer
 
162
       6.0.x Notes."
 
163
 
 
164
     * SCO UnixWare 7.1.x. See Section 2.13.5.10, "SCO UnixWare 7.1.x
 
165
       and OpenUNIX 8.0.0 Notes."
 
166
 
 
167
     * SGI Irix 6.x with native threads. See Section 2.13.5.7, "SGI
 
168
       Irix Notes."
 
169
 
 
170
     * Solaris 2.5 and above with native threads on SPARC and x86.
 
171
       See Section 2.13.3, "Solaris Notes."
 
172
 
 
173
     * Tru64 Unix. See Section 2.13.5.5, "Alpha-DEC-UNIX Notes
178
174
       (Tru64)."
179
175
 
180
 
     * Windows 2000, Windows XP, Windows Vista, Windows Server
181
 
       2003, and Windows Server 2008. See Section 2.3,
182
 
       "Installing MySQL on Windows."
183
 
 
184
 
   MySQL has also been known to run on other systems in the
185
 
   past. See Section 2.14, "Operating System-Specific Notes."
186
 
   Some porting effort might be required for current versions of
187
 
   MySQL on these systems.
188
 
 
189
 
   Not all platforms are equally well-suited for running MySQL.
190
 
   How well a certain platform is suited for a high-load
191
 
   mission-critical MySQL server is determined by the following
192
 
   factors:
193
 
 
194
 
     * General stability of the thread library. A platform may
195
 
       have an excellent reputation otherwise, but MySQL is only
196
 
       as stable as the thread library it calls, even if
197
 
       everything else is perfect.
198
 
 
199
 
     * The capability of the kernel and the thread library to
200
 
       take advantage of symmetric multi-processor (SMP)
201
 
       systems. In other words, when a process creates a thread,
202
 
       it should be possible for that thread to run on a CPU
203
 
       different from the original process.
204
 
 
205
 
     * The capability of the kernel and the thread library to
206
 
       run many threads that acquire and release a mutex over a
207
 
       short critical region frequently without excessive
208
 
       context switches. If the implementation of
209
 
       pthread_mutex_lock() is too anxious to yield CPU time,
210
 
       this hurts MySQL tremendously. If this issue is not taken
211
 
       care of, adding extra CPUs actually makes MySQL slower.
212
 
 
213
 
     * General filesystem stability and performance.
 
176
     * Windows 2000, Windows XP, Windows Vista, Windows Server 2003,
 
177
       and Windows Server 2008. See Section 2.3, "Installing MySQL on
 
178
       Windows."
 
179
 
 
180
   MySQL has also been known to run on other systems in the past. See
 
181
   Section 2.13, "Operating System-Specific Notes." Some porting
 
182
   effort might be required for current versions of MySQL on these
 
183
   systems.
 
184
 
 
185
   Not all platforms are equally well-suited for running MySQL. How
 
186
   well a certain platform is suited for a high-load mission-critical
 
187
   MySQL server is determined by the following factors:
 
188
 
 
189
     * General stability of the thread library. A platform may have
 
190
       an excellent reputation otherwise, but MySQL is only as stable
 
191
       as the thread library it calls, even if everything else is
 
192
       perfect.
 
193
 
 
194
     * The capability of the kernel and the thread library to take
 
195
       advantage of symmetric multi-processor (SMP) systems. In other
 
196
       words, when a process creates a thread, it should be possible
 
197
       for that thread to run on a CPU different from the original
 
198
       process.
 
199
 
 
200
     * The capability of the kernel and the thread library to run
 
201
       many threads that acquire and release a mutex over a short
 
202
       critical region frequently without excessive context switches.
 
203
       If the implementation of pthread_mutex_lock() is too anxious
 
204
       to yield CPU time, this hurts MySQL tremendously. If this
 
205
       issue is not taken care of, adding extra CPUs actually makes
 
206
       MySQL slower.
 
207
 
 
208
     * General file system stability and performance.
214
209
 
215
210
     * If your tables are large, performance is affected by the
216
 
       ability of the filesystem to deal with large files at all
217
 
       and to deal with them efficiently.
 
211
       ability of the file system to deal with large files at all and
 
212
       to deal with them efficiently.
218
213
 
219
 
     * Our level of expertise here at Sun Microsystems, Inc.
220
 
       with the platform. If we know a platform well, we enable
221
 
       platform-specific optimizations and fixes at compile
222
 
       time. We can also provide advice on configuring your
223
 
       system optimally for MySQL.
 
214
     * Our level of expertise here at Sun Microsystems, Inc. with the
 
215
       platform. If we know a platform well, we enable
 
216
       platform-specific optimizations and fixes at compile time. We
 
217
       can also provide advice on configuring your system optimally
 
218
       for MySQL.
224
219
 
225
220
     * The amount of testing we have done internally for similar
226
221
       configurations.
227
222
 
228
 
     * The number of users that have run MySQL successfully on
229
 
       the platform in similar configurations. If this number is
230
 
       high, the likelihood of encountering platform-specific
231
 
       surprises is much smaller.
 
223
     * The number of users that have run MySQL successfully on the
 
224
       platform in similar configurations. If this number is high,
 
225
       the likelihood of encountering platform-specific surprises is
 
226
       much smaller.
232
227
 
233
228
2.1.2. Choosing Which MySQL Distribution to Install
234
229
 
235
 
   When preparing to install MySQL, you should decide which
236
 
   version to use. MySQL development occurs in several release
237
 
   series, and you can pick the one that best fits your needs.
238
 
   After deciding which version to install, you can choose a
239
 
   distribution format. Releases are available in binary or
240
 
   source format.
 
230
   When preparing to install MySQL, you should decide which version
 
231
   to use. MySQL development occurs in several release series, and
 
232
   you can pick the one that best fits your needs. After deciding
 
233
   which version to install, you can choose a distribution format.
 
234
   Releases are available in binary or source format.
241
235
 
242
236
2.1.2.1. Choosing Which Version of MySQL to Install
243
237
 
244
 
   The first decision to make is whether you want to use a
245
 
   production (stable) release or a development release. In the
246
 
   MySQL development process, multiple release series co-exist,
247
 
   each at a different stage of maturity:
 
238
   The first decision to make is whether you want to use a production
 
239
   (stable) release or a development release. In the MySQL
 
240
   development process, multiple release series co-exist, each at a
 
241
   different stage of maturity:
248
242
 
249
243
     * MySQL 6.0 is the current development release series.
250
244
 
251
 
     * MySQL 5.1 is the current General Availability
252
 
       (Production) release series. New releases are issued for
253
 
       bugfixes only; no new features are being added that could
254
 
       affect stability.
255
 
 
256
 
     * MySQL 5.0 is the previous stable (production-quality)
257
 
       release series.
258
 
 
259
 
     * MySQL 4.1, 4.0, and 3.23 are old stable
260
 
       (production-quality) release series. MySQL 4.1 is now at
261
 
       the end of the product lifecycle. Active development and
262
 
       support for these versions has ended. Extended support
263
 
       for MySQL 4.1 and 4.0 is available. According to the
264
 
       MySQL Lifecycle Policy (see
265
 
       http://www.mysql.com/company/legal/lifecycle/#policy),
266
 
       only Security and Severity Level 1 issues will still be
267
 
       fixed for MySQL 4.0 and 4.1.
268
 
 
269
 
   We do not believe in a complete code freeze because this
270
 
   prevents us from making bugfixes and other fixes that must be
271
 
   done. By "somewhat frozen" we mean that we may add small
272
 
   things that should not affect anything that currently works
273
 
   in a production release. Naturally, relevant bugfixes from an
274
 
   earlier series propagate to later series.
275
 
 
276
 
   Normally, if you are beginning to use MySQL for the first
277
 
   time or trying to port it to some system for which there is
278
 
   no binary distribution, we recommend going with the General
279
 
   Availability release series. Currently, this is MySQL 5.1.
280
 
   All MySQL releases, even those from development series, are
281
 
   checked with the MySQL benchmarks and an extensive test suite
282
 
   before being issued.
283
 
 
284
 
   If you are running an older system and want to upgrade, but
285
 
   do not want to take the chance of having a non-seamless
286
 
   upgrade, you should upgrade to the latest version in the same
287
 
   release series you are using (where only the last part of the
288
 
   version number is newer than yours). We have tried to fix
289
 
   only fatal bugs and make only small, relatively "safe"
290
 
   changes to that version.
 
245
     * MySQL 5.1 is the current General Availability (Production)
 
246
       release series. New releases are issued for bugfixes only; no
 
247
       new features are being added that could affect stability.
 
248
 
 
249
     * MySQL 5.0 is the previous stable (production-quality) release
 
250
       series.
 
251
 
 
252
     * MySQL 4.1, 4.0, and 3.23 are old stable (production-quality)
 
253
       release series. MySQL 4.1 is now at the end of the product
 
254
       lifecycle. Active development and support for these versions
 
255
       has ended. Extended support for MySQL 4.1 and 4.0 is
 
256
       available. According to the MySQL Lifecycle Policy (see
 
257
       http://www.mysql.com/company/legal/lifecycle/#policy), only
 
258
       Security and Severity Level 1 issues will still be fixed for
 
259
       MySQL 4.0 and 4.1.
 
260
 
 
261
   We do not believe in a complete code freeze because this prevents
 
262
   us from making bugfixes and other fixes that must be done. By
 
263
   "somewhat frozen" we mean that we may add small things that should
 
264
   not affect anything that currently works in a production release.
 
265
   Naturally, relevant bugfixes from an earlier series propagate to
 
266
   later series.
 
267
 
 
268
   Normally, if you are beginning to use MySQL for the first time or
 
269
   trying to port it to some system for which there is no binary
 
270
   distribution, we recommend going with the General Availability
 
271
   release series. Currently, this is MySQL 5.1. All MySQL releases,
 
272
   even those from development series, are checked with the MySQL
 
273
   benchmarks and an extensive test suite before being issued.
 
274
 
 
275
   If you are running an older system and want to upgrade, but do not
 
276
   want to take the chance of having a non-seamless upgrade, you
 
277
   should upgrade to the latest version in the same release series
 
278
   you are using (where only the last part of the version number is
 
279
   newer than yours). We have tried to fix only fatal bugs and make
 
280
   only small, relatively "safe" changes to that version.
291
281
 
292
282
   If you want to use new features not present in the production
293
 
   release series, you can use a version from a development
294
 
   series. Note that development releases are not as stable as
295
 
   production releases.
296
 
 
297
 
   If you want to use the very latest sources containing all
298
 
   current patches and bugfixes, you can use one of our Bazaar
299
 
   repositories. These are not "releases" as such, but are
300
 
   available as previews of the code on which future releases
301
 
   are to be based.
302
 
 
303
 
   The MySQL naming scheme uses release names that consist of
304
 
   three numbers and a suffix; for example, mysql-5.0.12-beta.
305
 
   The numbers within the release name are interpreted as
306
 
   follows:
307
 
 
308
 
     * The first number (5) is the major version and describes
309
 
       the file format. All MySQL 5 releases have the same file
310
 
       format.
311
 
 
312
 
     * The second number (0) is the release level. Taken
313
 
       together, the major version and release level constitute
314
 
       the release series number.
315
 
 
316
 
     * The third number (12) is the version number within the
317
 
       release series. This is incremented for each new release.
318
 
       Usually you want the latest version for the series you
319
 
       have chosen.
320
 
 
321
 
   For each minor update, the last number in the version string
322
 
   is incremented. When there are major new features or minor
323
 
   incompatibilities with previous versions, the second number
324
 
   in the version string is incremented. When the file format
325
 
   changes, the first number is increased.
326
 
 
327
 
   Release names also include a suffix to indicates the
328
 
   stability level of the release. Releases within a series
329
 
   progress through a set of suffixes to indicate how the
330
 
   stability level improves. The possible suffixes are:
331
 
 
332
 
     * alpha indicates that the release is for preview purposes
333
 
       only. Known bugs should be documented in the News section
334
 
       (see Appendix C, "MySQL Change History"). Most alpha
335
 
       releases implement new commands and extensions. Active
336
 
       development that may involve major code changes can occur
337
 
       in an alpha release. However, we do conduct testing
338
 
       before issuing a release.
339
 
 
340
 
     * beta indicates that the release is appropriate for use
341
 
       with new development. Within beta releases, the features
342
 
       and compatibility should remain consistent. However, beta
343
 
       releases may contain numerous and major unaddressed bugs.
344
 
       All APIs, externally visible structures, and columns for
345
 
       SQL statements will not change during future beta,
346
 
       release candidate, or production releases.
 
283
   release series, you can use a version from a development series.
 
284
   Note that development releases are not as stable as production
 
285
   releases.
 
286
 
 
287
   If you want to use the very latest sources containing all current
 
288
   patches and bugfixes, you can use one of our Bazaar repositories.
 
289
   These are not "releases" as such, but are available as previews of
 
290
   the code on which future releases are to be based.
 
291
 
 
292
   The MySQL naming scheme uses release names that consist of three
 
293
   numbers and a suffix; for example, mysql-5.0.12-beta. The numbers
 
294
   within the release name are interpreted as follows:
 
295
 
 
296
     * The first number (5) is the major version and describes the
 
297
       file format. All MySQL 5 releases have the same file format.
 
298
 
 
299
     * The second number (0) is the release level. Taken together,
 
300
       the major version and release level constitute the release
 
301
       series number.
 
302
 
 
303
     * The third number (12) is the version number within the release
 
304
       series. This is incremented for each new release. Usually you
 
305
       want the latest version for the series you have chosen.
 
306
 
 
307
   For each minor update, the last number in the version string is
 
308
   incremented. When there are major new features or minor
 
309
   incompatibilities with previous versions, the second number in the
 
310
   version string is incremented. When the file format changes, the
 
311
   first number is increased.
 
312
 
 
313
   Release names also include a suffix to indicates the stability
 
314
   level of the release. Releases within a series progress through a
 
315
   set of suffixes to indicate how the stability level improves. The
 
316
   possible suffixes are:
 
317
 
 
318
     * alpha indicates that the release is for preview purposes only.
 
319
       Known bugs should be documented in the News section (see
 
320
       Appendix C, "MySQL Change History"). Most alpha releases
 
321
       implement new commands and extensions. Active development that
 
322
       may involve major code changes can occur in an alpha release.
 
323
       However, we do conduct testing before issuing a release.
 
324
 
 
325
     * beta indicates that the release is appropriate for use with
 
326
       new development. Within beta releases, the features and
 
327
       compatibility should remain consistent. However, beta releases
 
328
       may contain numerous and major unaddressed bugs.
 
329
       All APIs, externally visible structures, and columns for SQL
 
330
       statements will not change during future beta, release
 
331
       candidate, or production releases.
347
332
 
348
333
     * rc indicates a Release Candidate. Release candidates are
349
 
       believed to be stable, having passed all of MySQL's
350
 
       internal testing, and with all known fatal runtime bugs
351
 
       fixed. However, the release has not been in widespread
352
 
       use long enough to know for sure that all bugs have been
353
 
       identified. Only minor fixes are added. (A release
354
 
       candidate is what formerly was known as a gamma release.)
 
334
       believed to be stable, having passed all of MySQL's internal
 
335
       testing, and with all known fatal runtime bugs fixed. However,
 
336
       the release has not been in widespread use long enough to know
 
337
       for sure that all bugs have been identified. Only minor fixes
 
338
       are added. (A release candidate is what formerly was known as
 
339
       a gamma release.)
355
340
 
356
341
     * If there is no suffix, it indicates that the release is a
357
 
       General Availability (GA) or Production release. GA
358
 
       releases are stable, having successfully passed through
359
 
       all earlier release stages and are believed to be
360
 
       reliable, free of serious bugs, and suitable for use in
361
 
       production systems. Only critical bugfixes are applied to
362
 
       the release.
 
342
       General Availability (GA) or Production release. GA releases
 
343
       are stable, having successfully passed through all earlier
 
344
       release stages and are believed to be reliable, free of
 
345
       serious bugs, and suitable for use in production systems. Only
 
346
       critical bugfixes are applied to the release.
363
347
 
364
 
   MySQL uses a naming scheme that is slightly different from
365
 
   most other products. In general, it is usually safe to use
366
 
   any version that has been out for a couple of weeks without
367
 
   being replaced by a new version within the same release
368
 
   series.
 
348
   MySQL uses a naming scheme that is slightly different from most
 
349
   other products. In general, it is usually safe to use any version
 
350
   that has been out for a couple of weeks without being replaced by
 
351
   a new version within the same release series.
369
352
 
370
353
   All releases of MySQL are run through our standard tests and
371
 
   benchmarks to ensure that they are relatively safe to use.
372
 
   Because the standard tests are extended over time to check
373
 
   for all previously found bugs, the test suite keeps getting
374
 
   better.
 
354
   benchmarks to ensure that they are relatively safe to use. Because
 
355
   the standard tests are extended over time to check for all
 
356
   previously found bugs, the test suite keeps getting better.
375
357
 
376
358
   All releases have been tested at least with these tools:
377
359
 
378
360
     * An internal test suite
379
 
       The mysql-test directory contains an extensive set of
380
 
       test cases. We run these tests for every server binary.
381
 
       See Section 22.1.2, "MySQL Test Suite," for more
382
 
       information about this test suite.
 
361
       The mysql-test directory contains an extensive set of test
 
362
       cases. We run these tests for every server binary. See Section
 
363
       22.1.2, "MySQL Test Suite," for more information about this
 
364
       test suite.
383
365
 
384
366
     * The MySQL benchmark suite
385
 
       This suite runs a range of common queries. It is also a
386
 
       test to determine whether the latest batch of
387
 
       optimizations actually made the code faster. See Section
388
 
       7.1.4, "The MySQL Benchmark Suite."
 
367
       This suite runs a range of common queries. It is also a test
 
368
       to determine whether the latest batch of optimizations
 
369
       actually made the code faster. See Section 7.1.4, "The MySQL
 
370
       Benchmark Suite."
389
371
 
390
372
     * The crash-me test
391
373
       This test tries to determine what features the database
392
 
       supports and what its capabilities and limitations are.
393
 
       See Section 7.1.4, "The MySQL Benchmark Suite."
 
374
       supports and what its capabilities and limitations are. See
 
375
       Section 7.1.4, "The MySQL Benchmark Suite."
394
376
 
395
 
   We also test the newest MySQL version in our internal
396
 
   production environment, on at least one machine. We have more
397
 
   than 100GB of data to work with.
 
377
   We also test the newest MySQL version in our internal production
 
378
   environment, on at least one machine. We have more than 100GB of
 
379
   data to work with.
398
380
 
399
381
2.1.2.2. Choosing a Distribution Format
400
382
 
402
384
   decide whether to use a binary distribution or a source
403
385
   distribution. In most cases, you should probably use a binary
404
386
   distribution, if one exists for your platform. Binary
405
 
   distributions are available in native format for many
406
 
   platforms, such as RPM files for Linux or PKG package
407
 
   installers for Mac OS X or Solaris. Distributions also are
408
 
   available as Zip archives or compressed tar files.
 
387
   distributions are available in native format for many platforms,
 
388
   such as RPM files for Linux or PKG package installers for Mac OS X
 
389
   or Solaris. Distributions also are available as Zip archives or
 
390
   compressed tar files.
409
391
 
410
 
   Reasons to choose a binary distribution include the
411
 
   following:
 
392
   Reasons to choose a binary distribution include the following:
412
393
 
413
394
     * Binary distributions generally are easier to install than
414
395
       source distributions.
415
396
 
416
 
     * To satisfy different user requirements, we provide
417
 
       several servers in binary distributions. mysqld is an
418
 
       optimized server that is a smaller, faster binary.
419
 
       mysqld-debug is compiled with debugging support.
 
397
     * To satisfy different user requirements, we provide several
 
398
       servers in binary distributions. mysqld is an optimized server
 
399
       that is a smaller, faster binary. mysqld-debug is compiled
 
400
       with debugging support.
420
401
       Each of these servers is compiled from the same source
421
 
       distribution, though with different configuration
422
 
       options. All native MySQL clients can connect to servers
423
 
       from either MySQL version.
 
402
       distribution, though with different configuration options. All
 
403
       native MySQL clients can connect to servers from either MySQL
 
404
       version.
424
405
 
425
 
   Under some circumstances, you may be better off installing
426
 
   MySQL from a source distribution:
 
406
   Under some circumstances, you may be better off installing MySQL
 
407
   from a source distribution:
427
408
 
428
409
     * You want to install MySQL at some explicit location. The
429
410
       standard binary distributions are ready to run at any
431
412
       flexibility to place MySQL components where you want.
432
413
 
433
414
     * You want to configure mysqld to ensure that features are
434
 
       available that might not be included in the standard
435
 
       binary distributions. Here is a list of the most common
436
 
       extra options that you may want to use to ensure feature
437
 
       availability:
 
415
       available that might not be included in the standard binary
 
416
       distributions. Here is a list of the most common extra options
 
417
       that you may want to use to ensure feature availability:
438
418
 
439
419
          + --with-libwrap
440
420
 
443
423
 
444
424
          + --with-debug[=full]
445
425
 
446
 
     * You want to configure mysqld without some features that
447
 
       are included in the standard binary distributions. For
448
 
       example, distributions normally are compiled with support
449
 
       for all character sets. If you want a smaller MySQL
450
 
       server, you can recompile it with support for only the
451
 
       character sets you need.
 
426
     * You want to configure mysqld without some features that are
 
427
       included in the standard binary distributions. For example,
 
428
       distributions normally are compiled with support for all
 
429
       character sets. If you want a smaller MySQL server, you can
 
430
       recompile it with support for only the character sets you
 
431
       need.
452
432
 
453
433
     * You have a special compiler (such as pgcc) or want to use
454
 
       compiler options that are better optimized for your
455
 
       processor. Binary distributions are compiled with options
456
 
       that should work on a variety of processors from the same
457
 
       processor family.
 
434
       compiler options that are better optimized for your processor.
 
435
       Binary distributions are compiled with options that should
 
436
       work on a variety of processors from the same processor
 
437
       family.
458
438
 
459
439
     * You want to use the latest sources from one of the Bazaar
460
440
       repositories to have access to all current bugfixes. For
461
 
       example, if you have found a bug and reported it to the
462
 
       MySQL development team, the bugfix is committed to the
463
 
       source repository and you can access it there. The bugfix
464
 
       does not appear in a release until a release actually is
465
 
       issued.
 
441
       example, if you have found a bug and reported it to the MySQL
 
442
       development team, the bugfix is committed to the source
 
443
       repository and you can access it there. The bugfix does not
 
444
       appear in a release until a release actually is issued.
466
445
 
467
 
     * You want to read (or modify) the C and C++ code that
468
 
       makes up MySQL. For this purpose, you should get a source
469
 
       distribution, because the source code is always the
470
 
       ultimate manual.
 
446
     * You want to read (or modify) the C and C++ code that makes up
 
447
       MySQL. For this purpose, you should get a source distribution,
 
448
       because the source code is always the ultimate manual.
471
449
 
472
450
     * Source distributions contain more tests and examples than
473
451
       binary distributions.
476
454
 
477
455
   MySQL is evolving quite rapidly and we want to share new
478
456
   developments with other MySQL users. We try to produce a new
479
 
   release whenever we have new and useful features that others
480
 
   also seem to have a need for.
481
 
 
482
 
   We also try to help users who request features that are easy
483
 
   to implement. We take note of what our licensed users want,
484
 
   and we especially take note of what our support customers
485
 
   want and try to help them in this regard.
486
 
 
487
 
   No one is required to download a new release. The News
488
 
   section helps you determine whether the new release has
489
 
   something you really want. See Appendix C, "MySQL Change
490
 
   History."
 
457
   release whenever we have new and useful features that others also
 
458
   seem to have a need for.
 
459
 
 
460
   We also try to help users who request features that are easy to
 
461
   implement. We take note of what our licensed users want, and we
 
462
   especially take note of what our support customers want and try to
 
463
   help them in this regard.
 
464
 
 
465
   No one is required to download a new release. The News section
 
466
   helps you determine whether the new release has something you
 
467
   really want. See Appendix C, "MySQL Change History."
491
468
 
492
469
   We use the following policy when updating MySQL:
493
470
 
494
471
     * Enterprise Server releases are meant to appear every 18
495
 
       months, supplemented by quarterly service packs and
496
 
       monthly rapid updates. Community Server releases are
497
 
       meant to appear 2-3 times per year.
 
472
       months, supplemented by quarterly service packs and monthly
 
473
       rapid updates. Community Server releases are meant to appear
 
474
       2-3 times per year.
498
475
 
499
476
     * Releases are issued within each series. Enterprise Server
500
477
       releases are numbered using even numbers (for example,
501
478
       5.1.20). Community Server releases are numbered using odd
502
479
       numbers (for example, 5.1.21).
503
480
 
504
 
     * Binary distributions for some platforms are made by us
505
 
       for major releases. Other people may make binary
506
 
       distributions for other systems, but probably less
507
 
       frequently.
 
481
     * Binary distributions for some platforms are made by us for
 
482
       major releases. Other people may make binary distributions for
 
483
       other systems, but probably less frequently.
508
484
 
509
485
     * We make fixes available as soon as we have identified and
510
 
       corrected small or non-critical but annoying bugs. The
511
 
       fixes are available in source form immediately from our
512
 
       public Bazaar repositories, and are included in the next
513
 
       release.
 
486
       corrected small or non-critical but annoying bugs. The fixes
 
487
       are available in source form immediately from our public
 
488
       Bazaar repositories, and are included in the next release.
514
489
 
515
 
     * If by any chance a security vulnerability or critical bug
516
 
       is found in a release, our policy is to fix it in a new
517
 
       release as soon as possible. (We would like other
518
 
       companies to do this, too!)
 
490
     * If by any chance a security vulnerability or critical bug is
 
491
       found in a release, our policy is to fix it in a new release
 
492
       as soon as possible. (We would like other companies to do
 
493
       this, too!)
519
494
 
520
495
2.1.2.4. MySQL Binaries Compiled by Sun Microsystems, Inc.
521
496
 
522
 
   As a service of Sun Microsystems, Inc., we provide a set of
523
 
   binary distributions of MySQL that are compiled on systems at
524
 
   our site or on systems where supporters of MySQL kindly have
525
 
   given us access to their machines.
 
497
   As a service of Sun Microsystems, Inc., we provide a set of binary
 
498
   distributions of MySQL that are compiled on systems at our site or
 
499
   on systems where supporters of MySQL kindly have given us access
 
500
   to their machines.
526
501
 
527
 
   In addition to the binaries provided in platform-specific
528
 
   package formats, we offer binary distributions for a number
529
 
   of platforms in the form of compressed tar files (.tar.gz
530
 
   files). See Section 2.2, "Standard MySQL Installation Using a
531
 
   Binary Distribution."
 
502
   In addition to the binaries provided in platform-specific package
 
503
   formats, we offer binary distributions for a number of platforms
 
504
   in the form of compressed tar files (.tar.gz files). See Section
 
505
   2.2, "Standard MySQL Installation Using a Binary Distribution."
532
506
 
533
507
   The RPM distributions for MySQL 5.1 releases that we make
534
508
   available through our Web site are generated by MySQL AB.
535
509
 
536
 
   For Windows distributions, see Section 2.3, "Installing MySQL
537
 
   on Windows."
 
510
   For Windows distributions, see Section 2.3, "Installing MySQL on
 
511
   Windows."
538
512
 
539
513
   These distributions are generated using the script
540
 
   Build-tools/Do-compile, which compiles the source code and
541
 
   creates the binary tar.gz archive using
542
 
   scripts/make_binary_distribution.
 
514
   Build-tools/Do-compile, which compiles the source code and creates
 
515
   the binary tar.gz archive using scripts/make_binary_distribution.
543
516
 
544
517
   These binaries are configured and built with the following
545
 
   compilers and options. This information can also be obtained
546
 
   by looking at the variables COMP_ENV_INFO and CONFIGURE_LINE
547
 
   inside the script bin/mysqlbug of every binary tar file
548
 
   distribution.
 
518
   compilers and options. This information can also be obtained by
 
519
   looking at the variables COMP_ENV_INFO and CONFIGURE_LINE inside
 
520
   the script bin/mysqlbug of every binary tar file distribution.
549
521
 
550
522
   Anyone who has more optimal options for any of the following
551
 
   configure commands can mail them to the MySQL internals
552
 
   mailing list. See Section 1.5.1, "MySQL Mailing Lists."
553
 
 
554
 
   If you want to compile a debug version of MySQL, you should
555
 
   add --with-debug or --with-debug=full to the following
556
 
   configure commands and remove any -fomit-frame-pointer
557
 
   options.
558
 
 
559
 
   The following binaries are built on our own development
560
 
   systems:
 
523
   configure commands can mail them to the MySQL internals mailing
 
524
   list. See Section 1.5.1, "MySQL Mailing Lists."
 
525
 
 
526
   If you want to compile a debug version of MySQL, you should add
 
527
   --with-debug or --with-debug=full to the following configure
 
528
   commands and remove any -fomit-frame-pointer options.
 
529
 
 
530
   The following binaries are built on our own development systems:
561
531
 
562
532
     * Linux 2.4.xx x86 with gcc 2.95.3:
563
533
CFLAGS="-O2 -mcpu=pentiumpro" CXX=gcc CXXFLAGS="-O2 -mcpu=pentiumpro
566
536
--enable-local-infile --enable-assembler --disable-shared
567
537
--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
568
538
 
569
 
 
570
539
     * Linux 2.4.x x86 with icc (Intel C++ Compiler 8.1 or later
571
540
       releases):
572
541
CC=icc CXX=icpc CFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict"
575
544
--libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
576
545
--enable-thread-safe-client --enable-local-infile --enable-assembler
577
546
--disable-shared --with-client-ldflags=-all-static
578
 
--with-mysqld-ldflags=-all-static --with-embedded-server --with-innodb
579
 
 
580
 
       Note that versions 8.1 and newer of the Intel compiler
581
 
       have separate drivers for 'pure' C (icc) and C++ (icpc);
582
 
       if you use icc version 8.0 or older for building MySQL,
583
 
       you will need to set CXX=icc.
 
547
--with-mysqld-ldflags=-all-static --with-embedded-server --with-innod
 
548
b
 
549
       Note that versions 8.1 and newer of the Intel compiler have
 
550
       separate drivers for 'pure' C (icc) and C++ (icpc); if you use
 
551
       icc version 8.0 or older for building MySQL, you will need to
 
552
       set CXX=icc.
584
553
 
585
554
     * Linux 2.4.xx Intel Itanium 2 with ecc (Intel C++ Itanium
586
555
       Compiler 7.0):
589
558
--with-extra-charsets=complex --enable-thread-safe-client
590
559
--enable-local-infile
591
560
 
592
 
 
593
561
     * Linux 2.4.xx Intel Itanium with ecc (Intel C++ Itanium
594
562
       Compiler 7.0):
595
563
CC=ecc CFLAGS=-tpp1 CXX=ecc CXXFLAGS=-tpp1 ./configure
596
564
--prefix=/usr/local/mysql --with-extra-charsets=complex
597
565
--enable-thread-safe-client --enable-local-infile
598
566
 
599
 
 
600
 
     * Linux 2.4.xx alpha with ccc (Compaq C V6.2-505 / Compaq
601
 
       C++ V6.3-006):
 
567
     * Linux 2.4.xx alpha with ccc (Compaq C V6.2-505 / Compaq C++
 
568
       V6.3-006):
602
569
CC=ccc CFLAGS="-fast -arch generic" CXX=cxx CXXFLAGS="-fast -arch
603
570
generic -noexceptions -nortti" ./configure --prefix=/usr/local/mysql
604
571
--with-extra-charsets=complex --enable-thread-safe-client
605
572
--enable-local-infile --with-mysqld-ldflags=-non_shared
606
573
--with-client-ldflags=-non_shared --disable-shared
607
574
 
608
 
 
609
575
     * Linux 2.x.xx ppc with gcc 2.95.4:
610
576
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
611
577
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
612
578
-fno-rtti" ./configure --prefix=/usr/local/mysql
613
 
--localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bi
614
 
n
 
579
--localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/b
 
580
in
615
581
--with-extra-charsets=complex --enable-thread-safe-client
616
582
--enable-local-infile --disable-shared --with-embedded-server
617
583
--with-innodb
618
584
 
619
 
 
620
585
     * Linux 2.4.xx s390 with gcc 2.95.3:
621
586
CFLAGS="-O2" CXX=gcc CXXFLAGS="-O2 -felide-constructors" ./configure
622
587
--prefix=/usr/local/mysql --with-extra-charsets=complex
623
588
--enable-thread-safe-client --enable-local-infile --disable-shared
624
589
--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
625
590
 
626
 
 
627
591
     * Linux 2.4.xx x86_64 (AMD64) with gcc 3.2.1:
628
592
CXX=gcc ./configure --prefix=/usr/local/mysql
629
593
--with-extra-charsets=complex --enable-thread-safe-client
630
594
--enable-local-infile --disable-shared
631
595
 
632
 
 
633
596
     * Sun Solaris 8 x86 with gcc 3.2.3:
634
597
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
635
598
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
636
599
-fno-rtti" ./configure --prefix=/usr/local/mysql
637
 
--localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bi
638
 
n
 
600
--localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/b
 
601
in
639
602
--with-extra-charsets=complex --enable-thread-safe-client
640
603
--enable-local-infile --disable-shared --with-innodb
641
604
 
642
 
 
643
605
     * Sun Solaris 8 SPARC with gcc 3.2:
644
606
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
645
607
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
648
610
--enable-local-infile --enable-assembler --with-named-z-libs=no
649
611
--with-named-curses-libs=-lcurses --disable-shared
650
612
 
651
 
 
652
613
     * Sun Solaris 8 SPARC 64-bit with gcc 3.2:
653
 
CC=gcc CFLAGS="-O3 -m64 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
 
614
CC=gcc CFLAGS="-O3 -m64 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O
 
615
3
654
616
-m64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions
655
617
-fno-rtti" ./configure --prefix=/usr/local/mysql
656
618
--with-extra-charsets=complex --enable-thread-safe-client
657
619
--enable-local-infile --with-named-z-libs=no
658
620
--with-named-curses-libs=-lcurses --disable-shared
659
621
 
660
 
 
661
622
     * Sun Solaris 9 SPARC with gcc 2.95.3:
662
623
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
663
624
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
664
625
-fno-rtti" ./configure --prefix=/usr/local/mysql
665
626
--with-extra-charsets=complex --enable-thread-safe-client
666
 
--enable-local-infile --enable-assembler --with-named-curses-libs=-lcu
667
 
rses
 
627
--enable-local-infile --enable-assembler --with-named-curses-libs=-lc
 
628
urses
668
629
--disable-shared
669
630
 
670
 
 
671
631
     * Sun Solaris 9 SPARC with cc-5.0 (Sun Forte 5.0):
672
632
CC=cc-5.0 CXX=CC ASFLAGS="-xarch=v9" CFLAGS="-Xa -xstrconst -mt
673
633
-D_FORTEC_ -xarch=v9" CXXFLAGS="-noex -mt -D_FORTEC_ -xarch=v9"
675
635
--enable-thread-safe-client --enable-local-infile --enable-assembler
676
636
--with-named-z-libs=no --enable-thread-safe-client --disable-shared
677
637
 
678
 
 
679
638
     * IBM AIX 4.3.2 ppc with gcc 3.2.3:
680
639
CFLAGS="-O2 -mcpu=powerpc -Wa,-many " CXX=gcc CXXFLAGS="-O2
681
640
-mcpu=powerpc -Wa,-many -felide-constructors -fno-exceptions
683
642
--with-extra-charsets=complex --enable-thread-safe-client
684
643
--enable-local-infile --with-named-z-libs=no --disable-shared
685
644
 
686
 
 
687
645
     * IBM AIX 4.3.3 ppc with xlC_r (IBM Visual Age C/C++ 6.0):
688
646
CC=xlc_r CFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
689
647
CXX=xlC_r CXXFLAGS ="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
690
 
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql
691
 
/data
 
648
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysq
 
649
l/data
692
650
--libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
693
 
--enable-thread-safe-client --enable-local-infile --with-named-z-libs=
694
 
no
 
651
--enable-thread-safe-client --enable-local-infile --with-named-z-libs
 
652
=no
695
653
--disable-shared --with-innodb
696
654
 
697
 
 
698
655
     * IBM AIX 5.1.0 ppc with gcc 3.3:
699
 
CFLAGS="-O2 -mcpu=powerpc -Wa,-many" CXX=gcc CXXFLAGS="-O2 -mcpu=power
700
 
pc
 
656
CFLAGS="-O2 -mcpu=powerpc -Wa,-many" CXX=gcc CXXFLAGS="-O2 -mcpu=powe
 
657
rpc
701
658
-Wa,-many -felide-constructors -fno-exceptions -fno-rtti" ./configure
702
659
--prefix=/usr/local/mysql --with-extra-charsets=complex
703
 
--enable-thread-safe-client --enable-local-infile --with-named-z-libs=
704
 
no
 
660
--enable-thread-safe-client --enable-local-infile --with-named-z-libs
 
661
=no
705
662
--disable-shared
706
663
 
707
 
 
708
664
     * IBM AIX 5.2.0 ppc with xlC_r (IBM Visual Age C/C++ 6.0):
709
665
CC=xlc_r CFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
710
666
CXX=xlC_r CXXFLAGS="-ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192"
711
 
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql
712
 
/data
 
667
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysq
 
668
l/data
713
669
--libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
714
 
--enable-thread-safe-client --enable-local-infile --with-named-z-libs=
715
 
no
 
670
--enable-thread-safe-client --enable-local-infile --with-named-z-libs
 
671
=no
716
672
--disable-shared --with-embedded-server --with-innodb
717
673
 
718
 
 
719
674
     * HP-UX 10.20 pa-risc1.1 with gcc 3.1:
720
675
CFLAGS="-DHPUX -I/opt/dce/include -O3 -fPIC" CXX=gcc CXXFLAGS="-DHPUX
721
676
-I/opt/dce /include -felide-constructors -fno-exceptions -fno-rtti
724
679
--enable-local-infile --with-pthread --with-named-thread-libs=-ldce
725
680
--with-lib-ccflags=-fPIC --disable-shared
726
681
 
727
 
 
728
 
     * HP-UX 11.00 pa-risc with aCC (HP ANSI C++ B3910B
729
 
       A.03.50):
 
682
     * HP-UX 11.00 pa-risc with aCC (HP ANSI C++ B3910B A.03.50):
730
683
CC=cc CXX=aCC CFLAGS=+DAportable CXXFLAGS=+DAportable ./configure
731
684
--prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data
732
685
--libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
733
686
--enable-thread-safe-client --enable-local-infile --disable-shared
734
687
--with-embedded-server --with-innodb
735
688
 
736
 
 
737
689
     * HP-UX 11.11 pa-risc2.0 64bit with aCC (HP ANSI C++ B3910B
738
690
       A.03.33):
739
691
CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure
740
692
--prefix=/usr/local/mysql --with-extra-charsets=complex
741
693
--enable-thread-safe-client --enable-local-infile --disable-shared
742
694
 
743
 
 
744
695
     * HP-UX 11.11 pa-risc2.0 32bit with aCC (HP ANSI C++ B3910B
745
696
       A.03.33):
746
697
CC=cc CXX=aCC CFLAGS="+DAportable" CXXFLAGS="+DAportable" ./configure
749
700
--enable-thread-safe-client --enable-local-infile --disable-shared
750
701
--with-innodb
751
702
 
752
 
 
753
703
     * HP-UX 11.22 ia64 64bit with aCC (HP aC++/ANSI C B3910B
754
704
       A.05.50):
755
705
CC=cc CXX=aCC CFLAGS="+DD64 +DSitanium2" CXXFLAGS="+DD64 +DSitanium2"
756
 
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql
757
 
/data
 
706
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysq
 
707
l/data
758
708
--libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex
759
709
--enable-thread-safe-client --enable-local-infile --disable-shared
760
710
--with-embedded-server --with-innodb
761
711
 
762
 
 
763
712
     * Apple Mac OS X 10.2 powerpc with gcc 3.1:
764
713
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
765
714
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
767
716
--with-extra-charsets=complex --enable-thread-safe-client
768
717
--enable-local-infile --disable-shared
769
718
 
770
 
 
771
719
     * FreeBSD 4.7 i386 with gcc 2.95.4:
772
720
CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql
773
721
--with-extra-charsets=complex --enable-thread-safe-client
774
722
--enable-local-infile --enable-assembler --with-named-z-libs=not-used
775
723
--disable-shared
776
724
 
777
 
 
778
725
     * FreeBSD 4.7 i386 using LinuxThreads with gcc 2.95.4:
779
726
CFLAGS="-DHAVE_BROKEN_REALPATH -D__USE_UNIX98 -D_REENTRANT
780
727
-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
788
735
-L/usr/local/lib -llthread -llgcc_r" --disable-shared
789
736
--with-embedded-server --with-innodb
790
737
 
791
 
 
792
738
     * QNX Neutrino 6.2.1 i386 with gcc 2.95.3qnx-nto 20010315:
793
739
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
794
740
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
796
742
--with-extra-charsets=complex --enable-thread-safe-client
797
743
--enable-local-infile --disable-shared
798
744
 
799
 
   The following binaries are built on third-party systems
800
 
   kindly provided to Sun Microsystems, Inc. by other users.
801
 
   These are provided only as a courtesy; we do not have full
802
 
   control over these systems, so we can provide only limited
803
 
   support for the binaries built on them.
 
745
   The following binaries are built on third-party systems kindly
 
746
   provided to Sun Microsystems, Inc. by other users. These are
 
747
   provided only as a courtesy; we do not have full control over
 
748
   these systems, so we can provide only limited support for the
 
749
   binaries built on them.
804
750
 
805
751
     * SCO Unix 3.2v5.0.7 i386 with gcc 2.95.3:
806
 
CFLAGS="-O3 -mpentium" LDFLAGS=-static CXX=gcc CXXFLAGS="-O3 -mpentium
 
752
CFLAGS="-O3 -mpentium" LDFLAGS=-static CXX=gcc CXXFLAGS="-O3 -mpentiu
 
753
m
807
754
-felide-constructors" ./configure --prefix=/usr/local/mysql
808
755
--with-extra-charsets=complex --enable-thread-safe-client
809
 
--enable-local-infile --with-named-z-libs=no --enable-thread-safe-clie
810
 
nt
 
756
--enable-local-infile --with-named-z-libs=no --enable-thread-safe-cli
 
757
ent
811
758
--disable-shared
812
759
 
813
 
 
814
760
     * SCO UnixWare 7.1.4 i386 with CC 3.2:
815
761
CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql
816
762
--with-extra-charsets=complex --enable-thread-safe-client
817
 
--enable-local-infile --with-named-z-libs=no --enable-thread-safe-clie
818
 
nt
 
763
--enable-local-infile --with-named-z-libs=no --enable-thread-safe-cli
 
764
ent
819
765
--disable-shared --with-readline
820
766
 
821
 
 
822
767
     * SCO OpenServer 6.0.0 i386 with CC 3.2:
823
768
CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql
824
769
--with-extra-charsets=complex --enable-thread-safe-client
825
 
--enable-local-infile --with-named-z-libs=no --enable-thread-safe-clie
826
 
nt
 
770
--enable-local-infile --with-named-z-libs=no --enable-thread-safe-cli
 
771
ent
827
772
--disable-shared --with-readline
828
773
 
829
 
 
830
774
     * Compaq Tru64 OSF/1 V5.1 732 alpha with cc/cxx (Compaq C
831
775
       V6.3-029i / DIGITAL C++ V6.1-027):
832
776
CC="cc -pthread" CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline
834
778
-fast -inline speed -speculate all -noexceptions -nortti" ./configure
835
779
--prefix=/usr/local/mysql --with-extra-charsets=complex
836
780
--enable-thread-safe-client --enable-local-infile
837
 
--with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-shared
 
781
--with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-share
 
782
d
838
783
--with-mysqld-ldflags=-all-static
839
784
 
840
 
 
841
785
     * SGI Irix 6.5 IP32 with gcc 3.0.1:
842
786
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXXFLAGS="-O3
843
787
-fno-omit-frame-pointer -felide-constructors -fno-exceptions
845
789
--with-extra-charsets=complex --enable-thread-safe-client
846
790
--enable-local-infile --disable-shared
847
791
 
848
 
 
849
792
     * FreeBSD/sparc64 5.0 with gcc 3.2.1:
850
793
CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql
851
 
--localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bi
852
 
n
 
794
--localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/b
 
795
in
853
796
--with-extra-charsets=complex --enable-thread-safe-client
854
797
--enable-local-infile --disable-shared --with-innodb
855
798
 
856
 
   The following compile options have been used for binary
857
 
   packages that we have provided in the past. These binaries no
858
 
   longer are being updated, but the compile options are listed
859
 
   here for reference purposes.
 
799
   The following compile options have been used for binary packages
 
800
   that we have provided in the past. These binaries no longer are
 
801
   being updated, but the compile options are listed here for
 
802
   reference purposes.
860
803
 
861
804
     * Linux 2.2.xx SPARC with egcs 1.1.2:
862
805
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
865
808
--with-extra-charsets=complex --enable-thread-safe-client
866
809
--enable-local-infile --enable-assembler --disable-shared
867
810
 
868
 
 
869
811
     * Linux 2.2.x with x686 with gcc 2.95.2:
870
812
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro
871
813
-felide-constructors -fno-exceptions -fno-rtti" ./configure
873
815
--with-mysqld-ldflags=-all-static --disable-shared
874
816
--with-extra-charsets=complex
875
817
 
876
 
 
877
818
     * SunOS 4.1.4 2 sun4c with gcc 2.7.2.1:
878
819
CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure
879
 
--prefix=/usr/local/mysql --disable-shared --with-extra-charsets=compl
880
 
ex
 
820
--prefix=/usr/local/mysql --disable-shared --with-extra-charsets=comp
 
821
lex
881
822
--enable-assembler
882
823
 
883
 
 
884
 
     * SunOS 5.5.1 (and above) sun4u with egcs 1.0.3a or 2.90.27
885
 
       or gcc 2.95.2 and newer:
 
824
     * SunOS 5.5.1 (and above) sun4u with egcs 1.0.3a or 2.90.27 or
 
825
       gcc 2.95.2 and newer:
886
826
CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors
887
827
-fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql
888
828
--with-low-memory --with-extra-charsets=complex --enable-assembler
889
829
 
890
 
 
891
830
     * SunOS 5.6 i86pc with gcc 2.8.1:
892
831
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
893
832
--with-low-memory --with-extra-charsets=complex
894
833
 
895
 
 
896
834
     * BSDI BSD/OS 3.1 i386 with gcc 2.7.2.1:
897
835
CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql
898
836
--with-extra-charsets=complex
899
837
 
900
 
 
901
838
     * BSDI BSD/OS 2.1 i386 with gcc 2.7.2:
902
839
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
903
840
--with-extra-charsets=complex
904
841
 
905
 
 
906
842
     * AIX 4.2 with gcc 2.7.2.2:
907
843
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
908
844
--with-extra-charsets=complex
909
845
 
910
846
2.1.3. How to Get MySQL
911
847
 
912
 
   Check our downloads page at http://dev.mysql.com/downloads/
913
 
   for information about the current version of MySQL and for
914
 
   downloading instructions. For a complete up-to-date list of
915
 
   MySQL download mirror sites, see
916
 
   http://dev.mysql.com/downloads/mirrors.html. You can also
917
 
   find information there about becoming a MySQL mirror site and
918
 
   how to report a bad or out-of-date mirror.
 
848
   Check our downloads page at http://dev.mysql.com/downloads/ for
 
849
   information about the current version of MySQL and for downloading
 
850
   instructions. For a complete up-to-date list of MySQL download
 
851
   mirror sites, see http://dev.mysql.com/downloads/mirrors.html. You
 
852
   can also find information there about becoming a MySQL mirror site
 
853
   and how to report a bad or out-of-date mirror.
919
854
 
920
 
   Our main mirror is located at
921
 
   http://mirrors.sunsite.dk/mysql/.
 
855
   Our main mirror is located at http://mirrors.sunsite.dk/mysql/.
922
856
 
923
857
2.1.4. Verifying Package Integrity Using MD5 Checksums or GnuPG
924
858
 
925
 
   After you have downloaded the MySQL package that suits your
926
 
   needs and before you attempt to install it, you should make
927
 
   sure that it is intact and has not been tampered with. There
928
 
   are three means of integrity checking:
 
859
   After you have downloaded the MySQL package that suits your needs
 
860
   and before you attempt to install it, you should make sure that it
 
861
   is intact and has not been tampered with. There are three means of
 
862
   integrity checking:
929
863
 
930
864
     * MD5 checksums
931
865
 
932
 
     * Cryptographic signatures using GnuPG, the GNU Privacy
933
 
       Guard
 
866
     * Cryptographic signatures using GnuPG, the GNU Privacy Guard
934
867
 
935
868
     * For RPM packages, the built-in RPM integrity verification
936
869
       mechanism
938
871
   The following sections describe how to use these methods.
939
872
 
940
873
   If you notice that the MD5 checksum or GPG signatures do not
941
 
   match, first try to download the respective package one more
942
 
   time, perhaps from another mirror site. If you repeatedly
943
 
   cannot successfully verify the integrity of the package,
944
 
   please notify us about such incidents, including the full
945
 
   package name and the download site you have been using, at
946
 
   webmaster@mysql.com or build@mysql.com. Do not report
947
 
   downloading problems using the bug-reporting system.
 
874
   match, first try to download the respective package one more time,
 
875
   perhaps from another mirror site. If you repeatedly cannot
 
876
   successfully verify the integrity of the package, please notify us
 
877
   about such incidents, including the full package name and the
 
878
   download site you have been using, at webmaster@mysql.com or
 
879
   build@mysql.com. Do not report downloading problems using the
 
880
   bug-reporting system.
948
881
 
949
882
2.1.4.1. Verifying the MD5 Checksum
950
883
 
951
 
   After you have downloaded a MySQL package, you should make
952
 
   sure that its MD5 checksum matches the one provided on the
953
 
   MySQL download pages. Each package has an individual checksum
954
 
   that you can verify with the following command, where
955
 
   package_name is the name of the package you downloaded:
 
884
   After you have downloaded a MySQL package, you should make sure
 
885
   that its MD5 checksum matches the one provided on the MySQL
 
886
   download pages. Each package has an individual checksum that you
 
887
   can verify with the following command, where package_name is the
 
888
   name of the package you downloaded:
956
889
shell> md5sum package_name
957
890
 
958
891
   Example:
959
 
shell> md5sum mysql-standard-5.1.31-linux-i686.tar.gz
960
 
aaab65abbec64d5e907dcd41b8699945  mysql-standard-5.1.31-linux-i686.tar
961
 
.gz
 
892
shell> md5sum mysql-standard-5.1.35-linux-i686.tar.gz
 
893
aaab65abbec64d5e907dcd41b8699945  mysql-standard-5.1.35-linux-i686.ta
 
894
r.gz
962
895
 
963
896
   You should verify that the resulting checksum (the string of
964
 
   hexadecimal digits) matches the one displayed on the download
965
 
   page immediately below the respective package.
 
897
   hexadecimal digits) matches the one displayed on the download page
 
898
   immediately below the respective package.
966
899
 
967
900
Note
968
901
 
969
 
   Make sure to verify the checksum of the archive file (for
970
 
   example, the .zip or .tar.gz file) and not of the files that
971
 
   are contained inside of the archive.
 
902
   Make sure to verify the checksum of the archive file (for example,
 
903
   the .zip or .tar.gz file) and not of the files that are contained
 
904
   inside of the archive.
972
905
 
973
 
   Note that not all operating systems support the md5sum
974
 
   command. On some, it is simply called md5, and others do not
975
 
   ship it at all. On Linux, it is part of the GNU Text
976
 
   Utilities package, which is available for a wide range of
977
 
   platforms. You can download the source code from
978
 
   http://www.gnu.org/software/textutils/ as well. If you have
979
 
   OpenSSL installed, you can use the command openssl md5
980
 
   package_name instead. A Windows implementation of the md5
981
 
   command line utility is available from
982
 
   http://www.fourmilab.ch/md5/. winMd5Sum is a graphical MD5
983
 
   checking tool that can be obtained from
984
 
   http://www.nullriver.com/index/products/winmd5sum.
 
906
   Note that not all operating systems support the md5sum command. On
 
907
   some, it is simply called md5, and others do not ship it at all.
 
908
   On Linux, it is part of the GNU Text Utilities package, which is
 
909
   available for a wide range of platforms. You can download the
 
910
   source code from http://www.gnu.org/software/textutils/ as well.
 
911
   If you have OpenSSL installed, you can use the command openssl md5
 
912
   package_name instead. A Windows implementation of the md5 command
 
913
   line utility is available from http://www.fourmilab.ch/md5/.
 
914
   winMd5Sum is a graphical MD5 checking tool that can be obtained
 
915
   from http://www.nullriver.com/index/products/winmd5sum.
985
916
 
986
917
2.1.4.2. Signature Checking Using GnuPG
987
918
 
988
 
   Another method of verifying the integrity and authenticity of
989
 
   a package is to use cryptographic signatures. This is more
990
 
   reliable than using MD5 checksums, but requires more work.
 
919
   Another method of verifying the integrity and authenticity of a
 
920
   package is to use cryptographic signatures. This is more reliable
 
921
   than using MD5 checksums, but requires more work.
991
922
 
992
923
   We sign MySQL downloadable packages with GnuPG (GNU Privacy
993
924
   Guard). GnuPG is an Open Source alternative to the well-known
994
925
   Pretty Good Privacy (PGP) by Phil Zimmermann. See
995
 
   http://www.gnupg.org/ for more information about GnuPG and
996
 
   how to obtain and install it on your system. Most Linux
997
 
   distributions ship with GnuPG installed by default. For more
998
 
   information about GnuPG, see http://www.openpgp.org/.
 
926
   http://www.gnupg.org/ for more information about GnuPG and how to
 
927
   obtain and install it on your system. Most Linux distributions
 
928
   ship with GnuPG installed by default. For more information about
 
929
   GnuPG, see http://www.openpgp.org/.
999
930
 
1000
 
   To verify the signature for a specific package, you first
1001
 
   need to obtain a copy of our public GPG build key, which you
1002
 
   can download from http://keyserver.pgp.com/. The key that you
1003
 
   want to obtain is named build@mysql.com. Alternatively, you
1004
 
   can cut and paste the key directly from the following text:
 
931
   To verify the signature for a specific package, you first need to
 
932
   obtain a copy of our public GPG build key, which you can download
 
933
   from http://keyserver.pgp.com/. The key that you want to obtain is
 
934
   named build@mysql.com. Alternatively, you can cut and paste the
 
935
   key directly from the following text:
1005
936
-----BEGIN PGP PUBLIC KEY BLOCK-----
1006
937
Version: GnuPG v1.0.6 (GNU/Linux)
1007
938
Comment: For info see http://www.gnupg.org
1093
1024
=Xquv
1094
1025
-----END PGP PUBLIC KEY BLOCK-----
1095
1026
 
1096
 
 
1097
 
   To import the build key into your personal public GPG
1098
 
   keyring, use gpg --import. For example, if you have saved the
1099
 
   key in a file named mysql_pubkey.asc, the import command
1100
 
   looks like this:
 
1027
   To import the build key into your personal public GPG keyring, use
 
1028
   gpg --import. For example, if you have saved the key in a file
 
1029
   named mysql_pubkey.asc, the import command looks like this:
1101
1030
shell> gpg --import mysql_pubkey.asc
1102
 
gpg: key 5072E1F5: public key "MySQL Package signing key (www.mysql.co
1103
 
m) <build@mysql.com>" imported
 
1031
gpg: key 5072E1F5: public key "MySQL Package signing key (www.mysql.c
 
1032
om) <build@mysql.com>" imported
1104
1033
gpg: Total number processed: 1
1105
1034
gpg:               imported: 1
1106
1035
gpg: no ultimately trusted keys found
1107
1036
 
1108
 
   You can also download the key from the public keyserver using
1109
 
   the public key id, 5072E1F5:
 
1037
   You can also download the key from the public keyserver using the
 
1038
   public key id, 5072E1F5:
1110
1039
shell> gpg --recv-keys 5072E1F5
1111
1040
gpg: requesting key 5072E1F5 from hkp server subkeys.pgp.net
1112
 
gpg: key 5072E1F5: "MySQL Package signing key (www.mysql.com) <build@m
1113
 
ysql.com>" 2 new signatures
 
1041
gpg: key 5072E1F5: "MySQL Package signing key (www.mysql.com) <build@
 
1042
mysql.com>" 2 new signatures
1114
1043
gpg: no ultimately trusted keys found
1115
1044
gpg: Total number processed: 1
1116
1045
gpg:         new signatures: 2
1117
1046
 
1118
1047
   If you want to import the key into your RPM configuration to
1119
 
   validate RPM install packages, you should be able to import
1120
 
   the key directly:
 
1048
   validate RPM install packages, you should be able to import the
 
1049
   key directly:
1121
1050
shell> rpm --import mysql_pubkey.asc
1122
1051
 
1123
 
   If you experience problems, try exporting the key from gpg
1124
 
   and importing:
 
1052
   If you experience problems, try exporting the key from gpg and
 
1053
   importing:
1125
1054
shell> gpg --export -a 5072e1f5 > 5072e1f5.asc
1126
1055
shell> rpm --import 5072e1f5.asc
1127
1056
 
1128
 
   Alternatively, rpm also supports loading the key directly
1129
 
   from a URL, and you cas use this manual page:
1130
 
shell> rpm --import http://dev.mysql.com/doc/refman/5.1/en/checking-gp
1131
 
g-signature.html
 
1057
   Alternatively, rpm also supports loading the key directly from a
 
1058
   URL, and you cas use this manual page:
 
1059
shell> rpm --import http://dev.mysql.com/doc/refman/5.1/en/checking-g
 
1060
pg-signature.html
1132
1061
 
1133
1062
   After you have downloaded and imported the public build key,
1134
1063
   download your desired MySQL package and the corresponding
1135
 
   signature, which also is available from the download page.
1136
 
   The signature file has the same name as the distribution file
1137
 
   with an .asc extension. For example:
1138
 
   Distribution file mysql-standard-5.1.31-linux-i686.tar.gz
1139
 
   Signature file    mysql-standard-5.1.31-linux-i686.tar.gz.asc
 
1064
   signature, which also is available from the download page. The
 
1065
   signature file has the same name as the distribution file with an
 
1066
   .asc extension, as shown by the examples in the following table.
 
1067
   Distribution file mysql-standard-5.1.35-linux-i686.tar.gz
 
1068
   Signature file    mysql-standard-5.1.35-linux-i686.tar.gz.asc
1140
1069
 
1141
 
   Make sure that both files are stored in the same directory
1142
 
   and then run the following command to verify the signature
1143
 
   for the distribution file:
 
1070
   Make sure that both files are stored in the same directory and
 
1071
   then run the following command to verify the signature for the
 
1072
   distribution file:
1144
1073
shell> gpg --verify package_name.asc
1145
1074
 
1146
1075
   Example:
1147
 
shell> gpg --verify mysql-standard-5.1.31-linux-i686.tar.gz.asc
1148
 
gpg: Signature made Tue 12 Jul 2005 23:35:41 EST using DSA key ID 5072
1149
 
E1F5
1150
 
gpg: Good signature from "MySQL Package signing key (www.mysql.com) <b
1151
 
uild@mysql.com>"
1152
 
 
1153
 
   The Good signature message indicates that everything is all
1154
 
   right. You can ignore any insecure memory warning you might
1155
 
   obtain.
1156
 
 
1157
 
   See the GPG documentation for more information on how to work
1158
 
   with public keys.
 
1076
shell> gpg --verify mysql-standard-5.1.35-linux-i686.tar.gz.asc
 
1077
gpg: Signature made Tue 12 Jul 2005 23:35:41 EST using DSA key ID 507
 
1078
2E1F5
 
1079
gpg: Good signature from "MySQL Package signing key (www.mysql.com) <
 
1080
build@mysql.com>"
 
1081
 
 
1082
   The Good signature message indicates that everything is all right.
 
1083
   You can ignore any insecure memory warning you might obtain.
 
1084
 
 
1085
   See the GPG documentation for more information on how to work with
 
1086
   public keys.
1159
1087
 
1160
1088
2.1.4.3. Signature Checking Using RPM
1161
1089
 
1162
 
   For RPM packages, there is no separate signature. RPM
1163
 
   packages have a built-in GPG signature and MD5 checksum. You
1164
 
   can verify a package by running the following command:
 
1090
   For RPM packages, there is no separate signature. RPM packages
 
1091
   have a built-in GPG signature and MD5 checksum. You can verify a
 
1092
   package by running the following command:
1165
1093
shell> rpm --checksig package_name.rpm
1166
1094
 
1167
1095
   Example:
1168
 
shell> rpm --checksig MySQL-server-5.1.31-0.glibc23.i386.rpm
1169
 
MySQL-server-5.1.31-0.glibc23.i386.rpm: md5 gpg OK
 
1096
shell> rpm --checksig MySQL-server-5.1.35-0.glibc23.i386.rpm
 
1097
MySQL-server-5.1.35-0.glibc23.i386.rpm: md5 gpg OK
1170
1098
 
1171
1099
Note
1172
1100
 
1173
1101
   If you are using RPM 4.1 and it complains about (GPG) NOT OK
1174
 
   (MISSING KEYS: GPG#5072e1f5), even though you have imported
1175
 
   the MySQL public build key into your own GPG keyring, you
1176
 
   need to import the key into the RPM keyring first. RPM 4.1 no
1177
 
   longer uses your personal GPG keyring (or GPG itself).
1178
 
   Rather, it maintains its own keyring because it is a
1179
 
   system-wide application and a user's GPG public keyring is a
1180
 
   user-specific file. To import the MySQL public key into the
1181
 
   RPM keyring, first obtain the key as described in Section
1182
 
   2.1.4.2, "Signature Checking Using GnuPG." Then use rpm
1183
 
   --import to import the key. For example, if you have saved
1184
 
   the public key in a file named mysql_pubkey.asc, import it
 
1102
   (MISSING KEYS: GPG#5072e1f5), even though you have imported the
 
1103
   MySQL public build key into your own GPG keyring, you need to
 
1104
   import the key into the RPM keyring first. RPM 4.1 no longer uses
 
1105
   your personal GPG keyring (or GPG itself). Rather, it maintains
 
1106
   its own keyring because it is a system-wide application and a
 
1107
   user's GPG public keyring is a user-specific file. To import the
 
1108
   MySQL public key into the RPM keyring, first obtain the key as
 
1109
   described in Section 2.1.4.2, "Signature Checking Using GnuPG."
 
1110
   Then use rpm --import to import the key. For example, if you have
 
1111
   saved the public key in a file named mysql_pubkey.asc, import it
1185
1112
   using this command:
1186
1113
shell> rpm --import mysql_pubkey.asc
1187
1114
 
1188
 
   If you need to obtain the MySQL public key, see Section
1189
 
   2.1.4.2, "Signature Checking Using GnuPG."
 
1115
   If you need to obtain the MySQL public key, see Section 2.1.4.2,
 
1116
   "Signature Checking Using GnuPG."
1190
1117
 
1191
1118
2.1.5. Installation Layouts
1192
1119
 
1193
1120
   This section describes the default layout of the directories
1194
 
   created by installing binary or source distributions provided
1195
 
   by Sun Microsystems, Inc. A distribution provided by another
1196
 
   vendor might use a layout different from those shown here.
 
1121
   created by installing binary or source distributions provided by
 
1122
   Sun Microsystems, Inc. A distribution provided by another vendor
 
1123
   might use a layout different from those shown here.
1197
1124
 
1198
 
   For MySQL 5.1 on Windows, the default installation directory
1199
 
   is C:\Program Files\MySQL\MySQL Server 5.1. (Some Windows
1200
 
   users prefer to install in C:\mysql, the directory that
1201
 
   formerly was used as the default. However, the layout of the
1202
 
   subdirectories remains the same.) The installation directory
1203
 
   has the following subdirectories:
 
1125
   For MySQL 5.1 on Windows, the default installation directory is
 
1126
   C:\Program Files\MySQL\MySQL Server 5.1. (Some Windows users
 
1127
   prefer to install in C:\mysql, the directory that formerly was
 
1128
   used as the default. However, the layout of the subdirectories
 
1129
   remains the same.) The installation directory has the following
 
1130
   subdirectories.
1204
1131
   Directory Contents of Directory
1205
1132
   bin       Client programs and the mysqld server
1206
1133
   data      Log files, databases
1211
1138
   scripts   Utility scripts
1212
1139
   share     Error message files
1213
1140
 
1214
 
   Installations created from our Linux RPM distributions result
1215
 
   in files under the following system directories:
 
1141
   Installations created from our Linux RPM distributions result in
 
1142
   files under the following system directories.
1216
1143
   Directory            Contents of Directory
1217
1144
   /usr/bin             Client programs and scripts
1218
1145
   /usr/sbin            The mysqld server
1224
1151
   /usr/share/mysql     Error message and character set files
1225
1152
   /usr/share/sql-bench Benchmarks
1226
1153
 
1227
 
   On Unix, a tar file binary distribution is installed by
1228
 
   unpacking it at the installation location you choose
1229
 
   (typically /usr/local/mysql) and creates the following
1230
 
   directories in that location:
 
1154
   On Unix, a tar file binary distribution is installed by unpacking
 
1155
   it at the installation location you choose (typically
 
1156
   /usr/local/mysql) and creates the following directories in that
 
1157
   location.
1231
1158
   Directory   Contents of Directory
1232
1159
   bin         Client programs and the mysqld server
1233
1160
   data        Log files, databases
1239
1166
   share/mysql Error message files
1240
1167
   sql-bench   Benchmarks
1241
1168
 
1242
 
   A source distribution is installed after you configure and
1243
 
   compile it. By default, the installation step installs files
1244
 
   under /usr/local, in the following subdirectories:
 
1169
   A source distribution is installed after you configure and compile
 
1170
   it. By default, the installation step installs files under
 
1171
   /usr/local, in the following subdirectories.
1245
1172
   Directory     Contents of Directory
1246
1173
   bin           Client programs and scripts
1247
1174
   include/mysql Include (header) files
1254
1181
   var           Databases and log files
1255
1182
 
1256
1183
   Within its installation directory, the layout of a source
1257
 
   installation differs from that of a binary installation in
1258
 
   the following ways:
 
1184
   installation differs from that of a binary installation in the
 
1185
   following ways:
1259
1186
 
1260
 
     * The mysqld server is installed in the libexec directory
1261
 
       rather than in the bin directory.
 
1187
     * The mysqld server is installed in the libexec directory rather
 
1188
       than in the bin directory.
1262
1189
 
1263
1190
     * The data directory is var rather than data.
1264
1191
 
1265
 
     * mysql_install_db is installed in the bin directory rather
1266
 
       than in the scripts directory.
1267
 
 
1268
 
     * The header file and library directories are include/mysql
1269
 
       and lib/mysql rather than include and lib.
1270
 
 
1271
 
   You can create your own binary installation from a compiled
1272
 
   source distribution by executing the
1273
 
   scripts/make_binary_distribution script from the top
1274
 
   directory of the source distribution.
 
1192
     * mysql_install_db is installed in the bin directory rather than
 
1193
       in the scripts directory.
 
1194
 
 
1195
     * The header file and library directories are include/mysql and
 
1196
       lib/mysql rather than include and lib.
 
1197
 
 
1198
   You can create your own binary installation from a compiled source
 
1199
   distribution by executing the scripts/make_binary_distribution
 
1200
   script from the top directory of the source distribution.
1275
1201
 
1276
1202
2.2. Standard MySQL Installation Using a Binary Distribution
1277
1203
 
1278
1204
   The next several sections cover the installation of MySQL on
1279
1205
   platforms where we offer packages using the native packaging
1280
1206
   format of the respective platform. (This is also known as
1281
 
   performing a "binary install.") However, binary distributions
1282
 
   of MySQL are available for many other platforms as well. See
1283
 
   Section 2.9, "Installing MySQL from tar.gz Packages on Other
1284
 
   Unix-Like Systems," for generic installation instructions for
1285
 
   these packages that apply to all platforms.
 
1207
   performing a "binary install.") However, binary distributions of
 
1208
   MySQL are available for many other platforms as well. See Section
 
1209
   2.9, "Installing MySQL from tar.gz Packages on Other Unix-Like
 
1210
   Systems," for generic installation instructions for these packages
 
1211
   that apply to all platforms.
1286
1212
 
1287
1213
   See Section 2.1, "General Installation Issues," for more
1288
 
   information on what other binary distributions are available
1289
 
   and how to obtain them.
 
1214
   information on what other binary distributions are available and
 
1215
   how to obtain them.
1290
1216
 
1291
1217
2.3. Installing MySQL on Windows
1292
1218
 
1293
 
   A native Windows distribution of MySQL has been available
1294
 
   since version 3.21 and represents a sizable percentage of the
1295
 
   daily downloads of MySQL. This section describes the process
1296
 
   for installing MySQL on Windows.
 
1219
   A native Windows distribution of MySQL has been available since
 
1220
   version 3.21 and represents a sizable percentage of the daily
 
1221
   downloads of MySQL. This section describes the process for
 
1222
   installing MySQL on Windows.
1297
1223
 
1298
1224
Note
1299
1225
 
1300
 
   If you are upgrading MySQL from an existing installation
1301
 
   older than MySQL 4.1.5, you must first perform the procedure
1302
 
   described in Section 2.3.14, "Upgrading MySQL on Windows."
 
1226
   If you are upgrading MySQL from an existing installation older
 
1227
   than MySQL 4.1.5, you must first perform the procedure described
 
1228
   in Section 2.3.14, "Upgrading MySQL on Windows."
1303
1229
 
1304
1230
   To run MySQL on Windows, you need the following:
1305
1231
 
1306
 
     * A 32-bit Windows operating system such as Windows 2000,
1307
 
       Windows XP, Windows Vista, Windows Server 2003, or
1308
 
       Windows Server 2008.
1309
 
       A Windows operating system permits you to run the MySQL
1310
 
       server as a service. See Section 2.3.11, "Starting MySQL
1311
 
       as a Windows Service."
 
1232
     * A Windows operating system such as Windows 2000, Windows XP,
 
1233
       Windows Vista, Windows Server 2003, or Windows Server 2008.
 
1234
       A Windows operating system permits you to run the MySQL server
 
1235
       as a service. See Section 2.3.11, "Starting MySQL as a Windows
 
1236
       Service."
1312
1237
       Generally, you should install MySQL on Windows using an
1313
1238
       account that has administrator rights. Otherwise, you may
1314
 
       encounter problems with certain operations such as
1315
 
       editing the PATH environment variable or accessing the
1316
 
       Service Control Manager. Once installed, MySQL does not
1317
 
       need to be executed using a user with Administrator
1318
 
       privileges.
 
1239
       encounter problems with certain operations such as editing the
 
1240
       PATH environment variable or accessing the Service Control
 
1241
       Manager. Once installed, MySQL does not need to be executed
 
1242
       using a user with Administrator privileges.
1319
1243
 
1320
1244
     * TCP/IP protocol support.
1321
1245
 
1322
 
     * Enough space on the hard drive to unpack, install, and
1323
 
       create the databases in accordance with your requirements
1324
 
       (generally a minimum of 200 megabytes is recommended.)
1325
 
 
1326
 
   For a list of limitations within the Windows version of
1327
 
   MySQL, see Section D.7.3, "Windows Platform Limitations."
1328
 
 
1329
 
   There may also be other requirements, depending on how you
1330
 
   plan to use MySQL:
1331
 
 
1332
 
     * If you plan to connect to the MySQL server via ODBC, you
1333
 
       need a Connector/ODBC driver. See Section 21.1, "MySQL
 
1246
     * Enough space on the hard drive to unpack, install, and create
 
1247
       the databases in accordance with your requirements (generally
 
1248
       a minimum of 200 megabytes is recommended.)
 
1249
 
 
1250
   For a list of limitations within the Windows version of MySQL, see
 
1251
   Section D.7.3, "Windows Platform Limitations."
 
1252
 
 
1253
   There may also be other requirements, depending on how you plan to
 
1254
   use MySQL:
 
1255
 
 
1256
     * If you plan to connect to the MySQL server via ODBC, you need
 
1257
       a Connector/ODBC driver. See Section 21.1, "MySQL
1334
1258
       Connector/ODBC."
1335
1259
 
1336
 
     * If you plan to use MySQL server with ADO.NET
1337
 
       applications, you need the Connector/NET driver. See
1338
 
       Section 21.2, "MySQL Connector/NET."
1339
 
 
1340
 
     * If you need tables with a size larger than 4GB, install
1341
 
       MySQL on an NTFS or newer filesystem. Don't forget to use
1342
 
       MAX_ROWS and AVG_ROW_LENGTH when you create tables. See
1343
 
       Section 12.1.17, "CREATE TABLE Syntax."
1344
 
 
1345
 
   MySQL for Windows is available in several distribution
1346
 
   formats:
 
1260
     * If you plan to use MySQL server with ADO.NET applications, you
 
1261
       need the Connector/NET driver. See Section 21.2, "MySQL
 
1262
       Connector/NET."
 
1263
 
 
1264
     * If you need tables with a size larger than 4GB, install MySQL
 
1265
       on an NTFS or newer file system. Don't forget to use MAX_ROWS
 
1266
       and AVG_ROW_LENGTH when you create tables. See Section
 
1267
       12.1.17, "CREATE TABLE Syntax."
 
1268
 
 
1269
   MySQL for Windows is available in several distribution formats:
1347
1270
 
1348
1271
     * Binary distributions are available that contain a setup
1349
1272
       program that installs everything you need so that you can
1354
1277
       Package."
1355
1278
 
1356
1279
     * The source distribution contains all the code and support
1357
 
       files for building the executables using the Visual
1358
 
       Studio compiler system.
 
1280
       files for building the executables using the Visual Studio
 
1281
       compiler system.
1359
1282
 
1360
1283
   Generally speaking, you should use a binary distribution that
1361
 
   includes an installer. It is simpler to use than the others,
1362
 
   and you need no additional tools to get MySQL up and running.
1363
 
   The installer for the Windows version of MySQL, combined with
1364
 
   a GUI Configuration Wizard, automatically installs MySQL,
1365
 
   creates an option file, starts the server, and secures the
1366
 
   default user accounts.
 
1284
   includes an installer. It is simpler to use than the others, and
 
1285
   you need no additional tools to get MySQL up and running. The
 
1286
   installer for the Windows version of MySQL, combined with a GUI
 
1287
   Configuration Wizard, automatically installs MySQL, creates an
 
1288
   option file, starts the server, and secures the default user
 
1289
   accounts.
1367
1290
 
1368
1291
Caution
1369
1292
 
1370
 
   Using virus scanning software such as Norton/Symantec
1371
 
   Anti-Virus on directories containing MySQL data and temporary
1372
 
   tables can cause issues, both in terms of the performance of
1373
 
   MySQL and the virus-scanning software mis-identifying the
1374
 
   contents of the files as containing spam. This is because of
1375
 
   the fingerprinting mechanism used by the virus scanning
1376
 
   software, and the way in which MySQL rapidly updates
1377
 
   different files, which may be identified as a potential
1378
 
   security risk.
 
1293
   Using virus scanning software such as Norton/Symantec Anti-Virus
 
1294
   on directories containing MySQL data and temporary tables can
 
1295
   cause issues, both in terms of the performance of MySQL and the
 
1296
   virus-scanning software mis-identifying the contents of the files
 
1297
   as containing spam. This is because of the fingerprinting
 
1298
   mechanism used by the virus scanning software, and the way in
 
1299
   which MySQL rapidly updates different files, which may be
 
1300
   identified as a potential security risk.
1379
1301
 
1380
 
   After installing MySQL Server, it is recommended that you
1381
 
   disable virus scanning on the main directory (datadir) being
1382
 
   used to store your MySQL table data. There is usually a
1383
 
   system built into the virus scanning software to allow
1384
 
   certain directories to be specifically ignored during virus
1385
 
   scanning.
 
1302
   After installing MySQL Server, it is recommended that you disable
 
1303
   virus scanning on the main directory (datadir) being used to store
 
1304
   your MySQL table data. There is usually a system built into the
 
1305
   virus scanning software to allow certain directories to be
 
1306
   specifically ignored during virus scanning.
1386
1307
 
1387
1308
   In addition, by default, MySQL creates temporary files in the
1388
 
   standard Windows temporary directory. To prevent the
1389
 
   temporary files also being scanned, you should configure a
1390
 
   separate temporary directory for MySQL temporary files and
1391
 
   add this to the virus scanning exclusion list. To do this,
1392
 
   add a configuration option for the tmpdir parameter to your
1393
 
   my.ini configuration file. For more information, see Section
1394
 
   2.3.7, "Creating an Option File," and tmpdir.
 
1309
   standard Windows temporary directory. To prevent the temporary
 
1310
   files also being scanned, you should configure a separate
 
1311
   temporary directory for MySQL temporary files and add this to the
 
1312
   virus scanning exclusion list. To do this, add a configuration
 
1313
   option for the tmpdir parameter to your my.ini configuration file.
 
1314
   For more information, see Section 2.3.7, "Creating an Option
 
1315
   File."
1395
1316
 
1396
 
   The following section describes how to install MySQL on
1397
 
   Windows using a binary distribution. To use an installation
1398
 
   package that does not include an installer, follow the
1399
 
   procedure described in Section 2.3.5, "Installing MySQL from
1400
 
   a Noinstall Zip Archive." To install using a source
1401
 
   distribution, see Section 2.10.6, "Installing MySQL from
1402
 
   Source on Windows."
 
1317
   The following section describes how to install MySQL on Windows
 
1318
   using a binary distribution. To use an installation package that
 
1319
   does not include an installer, follow the procedure described in
 
1320
   Section 2.3.5, "Installing MySQL from a Noinstall Zip Archive." To
 
1321
   install using a source distribution, see Section 2.10.6,
 
1322
   "Installing MySQL from Source on Windows."
1403
1323
 
1404
1324
   MySQL distributions for Windows can be downloaded from
1405
 
   http://dev.mysql.com/downloads/. See Section 2.1.3, "How to
1406
 
   Get MySQL."
 
1325
   http://dev.mysql.com/downloads/. See Section 2.1.3, "How to Get
 
1326
   MySQL."
1407
1327
 
1408
1328
2.3.1. Choosing An Installation Package
1409
1329
 
1410
 
   For MySQL 5.1, there are three installation packages to
1411
 
   choose from when installing MySQL on Windows:
1412
 
 
1413
 
     * The Essentials Package: This package has a filename
1414
 
       similar to mysql-essential-5.1.31-win32.msi and contains
1415
 
       the minimum set of files needed to install MySQL on
1416
 
       Windows, including the Configuration Wizard. This package
1417
 
       does not include optional components such as the embedded
1418
 
       server and benchmark suite.
1419
 
 
1420
 
     * The Complete Package: This package has a filename similar
1421
 
       to mysql-5.1.31-win32.zip and contains all files needed
1422
 
       for a complete Windows installation, including the
1423
 
       Configuration Wizard. This package includes optional
1424
 
       components such as the embedded server and benchmark
1425
 
       suite.
1426
 
 
1427
 
     * The Noinstall Archive: This package has a filename
1428
 
       similar to mysql-noinstall-5.1.31-win32.zip and contains
1429
 
       all the files found in the Complete install package, with
1430
 
       the exception of the Configuration Wizard. This package
1431
 
       does not include an automated installer, and must be
1432
 
       manually installed and configured.
 
1330
   For MySQL 5.1, there are three installation packages to choose
 
1331
   from when installing MySQL on Windows:
 
1332
 
 
1333
     * The Essentials Package: This package has a file name similar
 
1334
       to mysql-essential-5.1.35-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
 
 
1339
     * The Complete Package: This package has a file name similar to
 
1340
       mysql-5.1.35-win32.zip and contains all files needed for a
 
1341
       complete Windows installation, including the Configuration
 
1342
       Wizard. This package includes optional components such as the
 
1343
       embedded server and benchmark suite.
 
1344
 
 
1345
     * The Noinstall Archive: This package has a file name similar to
 
1346
       mysql-noinstall-5.1.35-win32.zip and contains all the files
 
1347
       found in the Complete install package, with the exception of
 
1348
       the Configuration Wizard. This package does not include an
 
1349
       automated installer, and must be manually installed and
 
1350
       configured.
1433
1351
 
1434
1352
   The Essentials package is recommended for most users. It is
1435
 
   provided as an .msi file for use with the Windows Installer.
1436
 
   The Complete and Noinstall distributions are packaged as Zip
1437
 
   archives. To use them, you must have a tool that can unpack
1438
 
   .zip files.
 
1353
   provided as an .msi file for use with the Windows Installer. The
 
1354
   Complete and Noinstall distributions are packaged as Zip archives.
 
1355
   To use them, you must have a tool that can unpack .zip files.
1439
1356
 
1440
 
   Your choice of install package affects the installation
1441
 
   process you must follow. If you choose to install either the
1442
 
   Essentials or Complete install packages, see Section 2.3.2,
1443
 
   "Installing MySQL with the Automated Installer." If you
1444
 
   choose to install MySQL from the Noinstall archive, see
1445
 
   Section 2.3.5, "Installing MySQL from a Noinstall Zip
1446
 
   Archive."
 
1357
   Your choice of install package affects the installation process
 
1358
   you must follow. If you choose to install either the Essentials or
 
1359
   Complete install packages, see Section 2.3.2, "Installing MySQL
 
1360
   with the Automated Installer." If you choose to install MySQL from
 
1361
   the Noinstall archive, see Section 2.3.5, "Installing MySQL from a
 
1362
   Noinstall Zip Archive."
1447
1363
 
1448
1364
2.3.2. Installing MySQL with the Automated Installer
1449
1365
 
1450
 
   New MySQL users can use the MySQL Installation Wizard and
1451
 
   MySQL Configuration Wizard to install MySQL on Windows. These
1452
 
   are designed to install and configure MySQL in such a way
1453
 
   that new users can immediately get started using MySQL.
 
1366
   New MySQL users can use the MySQL Installation Wizard and MySQL
 
1367
   Configuration Wizard to install MySQL on Windows. These are
 
1368
   designed to install and configure MySQL in such a way that new
 
1369
   users can immediately get started using MySQL.
1454
1370
 
1455
 
   The MySQL Installation Wizard and MySQL Configuration Wizard
1456
 
   are available in the Essentials and Complete install
1457
 
   packages. They are recommended for most standard MySQL
1458
 
   installations. Exceptions include users who need to install
1459
 
   multiple instances of MySQL on a single server host and
1460
 
   advanced users who want complete control of server
1461
 
   configuration.
 
1371
   The MySQL Installation Wizard and MySQL Configuration Wizard are
 
1372
   available in the Essentials and Complete install packages. They
 
1373
   are recommended for most standard MySQL installations. Exceptions
 
1374
   include users who need to install multiple instances of MySQL on a
 
1375
   single server host and advanced users who want complete control of
 
1376
   server configuration.
1462
1377
 
1463
1378
2.3.3. Using the MySQL Installation Wizard
1464
1379
 
1465
 
   MySQL Installation Wizard is an installer for the MySQL
1466
 
   server that uses the latest installer technologies for
1467
 
   Microsoft Windows. The MySQL Installation Wizard, in
1468
 
   combination with the MySQL Configuration Wizard, allows a
1469
 
   user to install and configure a MySQL server that is ready
1470
 
   for use immediately after installation.
 
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.
1471
1385
 
1472
 
   The MySQL Installation Wizard is the standard installer for
1473
 
   all MySQL server distributions, version 4.1.5 and higher.
1474
 
   Users of previous versions of MySQL need to shut down and
1475
 
   remove their existing MySQL installations manually before
1476
 
   installing MySQL with the MySQL Installation Wizard. See
1477
 
   Section 2.3.3.6, "Upgrading MySQL with the Installation
1478
 
   Wizard," for more information on upgrading from a previous
1479
 
   version.
 
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.3.3.6, "Upgrading
 
1391
   MySQL with the Installation Wizard," for more information on
 
1392
   upgrading from a previous version.
1480
1393
 
1481
1394
   Microsoft has included an improved version of their Microsoft
1482
 
   Windows Installer (MSI) in the recent versions of Windows.
1483
 
   MSI has become the de-facto standard for application
1484
 
   installations on Windows 2000, Windows XP, and Windows Server
1485
 
   2003. The MySQL Installation Wizard makes use of this
1486
 
   technology to provide a smoother and more flexible
1487
 
   installation process.
 
1395
   Windows Installer (MSI) in the recent versions of Windows. MSI has
 
1396
   become the de-facto standard for application installations on
 
1397
   Windows 2000, Windows XP, and Windows Server 2003. The MySQL
 
1398
   Installation Wizard makes use of this technology to provide a
 
1399
   smoother and more flexible installation process.
1488
1400
 
1489
1401
   The Microsoft Windows Installer Engine was updated with the
1490
 
   release of Windows XP; those using a previous version of
1491
 
   Windows can reference this Microsoft Knowledge Base article
1492
 
   (http://support.microsoft.com/default.aspx?scid=kb;EN-US;2925
1493
 
   39) for information on upgrading to the latest version of the
1494
 
   Windows Installer Engine.
1495
 
 
1496
 
   In addition, Microsoft has introduced the WiX (Windows
1497
 
   Installer XML) toolkit recently. This is the first highly
1498
 
   acknowledged Open Source project from Microsoft. We have
1499
 
   switched to WiX because it is an Open Source project and it
1500
 
   allows us to handle the complete Windows installation process
1501
 
   in a flexible manner using scripts.
1502
 
 
1503
 
   Improving the MySQL Installation Wizard depends on the
1504
 
   support and feedback of users like you. If you find that the
1505
 
   MySQL Installation Wizard is lacking some feature important
1506
 
   to you, or if you discover a bug, please report it in our
1507
 
   bugs database using the instructions given in Section 1.6,
1508
 
   "How to Report Bugs or Problems."
 
1402
   release of Windows XP; those using a previous version of Windows
 
1403
   can reference this Microsoft Knowledge Base article
 
1404
   (http://support.microsoft.com/default.aspx?scid=kb;EN-US;292539)
 
1405
   for information on upgrading to the latest version of the Windows
 
1406
   Installer Engine.
 
1407
 
 
1408
   In addition, Microsoft has introduced the WiX (Windows Installer
 
1409
   XML) toolkit recently. This is the first highly acknowledged Open
 
1410
   Source project from Microsoft. We have switched to WiX because it
 
1411
   is an Open Source project and it allows us to handle the complete
 
1412
   Windows installation process in a flexible manner using scripts.
 
1413
 
 
1414
   Improving the MySQL Installation Wizard depends on the support and
 
1415
   feedback of users like you. If you find that the MySQL
 
1416
   Installation Wizard is lacking some feature important to you, or
 
1417
   if you discover a bug, please report it in our bugs database using
 
1418
   the instructions given in Section 1.6, "How to Report Bugs or
 
1419
   Problems."
1509
1420
 
1510
1421
2.3.3.1. Downloading and Starting the MySQL Installation Wizard
1511
1422
 
1512
1423
   The MySQL installation packages can be downloaded from
1513
 
   http://dev.mysql.com/downloads/. If the package you download
1514
 
   is contained within a Zip archive, you need to extract the
1515
 
   archive first.
 
1424
   http://dev.mysql.com/downloads/. If the package you download is
 
1425
   contained within a Zip archive, you need to extract the archive
 
1426
   first.
1516
1427
 
1517
1428
Note
1518
1429
 
1519
1430
   If you are installing on Windows Vista it is best to open a
1520
 
   network port before beginning the installation. To do this,
1521
 
   first ensure that you are logged in as an Administrator, go
1522
 
   to the Control Panel, and double click the Windows Firewall
1523
 
   icon. Choose the Allow a program through Windows Firewall
1524
 
   option and click the Add port button. Enter MySQL into the
1525
 
   Name text box and 3306 (or the port of your choice) into the
1526
 
   Port number text box. Also ensure that the TCP protocol radio
1527
 
   button is selected. If you wish, you can also limit access to
1528
 
   the MySQL server by choosing the Change scope button. Confirm
1529
 
   your choices by clicking the OK button. If you do not open a
1530
 
   port prior to installation, you cannot configure the MySQL
1531
 
   server immediately after installation. Additionally, when
1532
 
   running the MySQL Installation Wizard on Windows Vista,
1533
 
   ensure that you are logged in as a user with administrative
1534
 
   rights.
 
1431
   network port before beginning the installation. To do this, first
 
1432
   ensure that you are logged in as an Administrator, go to the
 
1433
   Control Panel, and double click the Windows Firewall icon. Choose
 
1434
   the Allow a program through Windows Firewall option and click the
 
1435
   Add port button. Enter MySQL into the Name text box and 3306 (or
 
1436
   the port of your choice) into the Port number text box. Also
 
1437
   ensure that the TCP protocol radio button is selected. If you
 
1438
   wish, you can also limit access to the MySQL server by choosing
 
1439
   the Change scope button. Confirm your choices by clicking the OK
 
1440
   button. If you do not open a port prior to installation, you
 
1441
   cannot configure the MySQL server immediately after installation.
 
1442
   Additionally, when running the MySQL Installation Wizard on
 
1443
   Windows Vista, ensure that you are logged in as a user with
 
1444
   administrative rights.
1535
1445
 
1536
 
   The process for starting the wizard depends on the contents
1537
 
   of the installation package you download. If there is a
1538
 
   setup.exe file present, double-click it to start the
1539
 
   installation process. If there is an .msi file present,
1540
 
   double-click it to start the installation process.
 
1446
   The process for starting the wizard depends on the contents of the
 
1447
   installation package you download. If there is a setup.exe file
 
1448
   present, double-click it to start the installation process. If
 
1449
   there is an .msi file present, double-click it to start the
 
1450
   installation process.
1541
1451
 
1542
1452
2.3.3.2. Choosing an Install Type
1543
1453
 
1544
 
   There are three installation types available: Typical,
1545
 
   Complete, and Custom.
1546
 
 
1547
 
   The Typical installation type installs the MySQL server, the
1548
 
   mysql command-line client, and the command-line utilities.
1549
 
   The command-line clients and utilities include mysqldump,
1550
 
   myisamchk, and several other tools to help you manage the
1551
 
   MySQL server.
1552
 
 
1553
 
   The Complete installation type installs all components
1554
 
   included in the installation package. The full installation
1555
 
   package includes components such as the embedded server
1556
 
   library, the benchmark suite, support scripts, and
1557
 
   documentation.
1558
 
 
1559
 
   The Custom installation type gives you complete control over
1560
 
   which packages you wish to install and the installation path
1561
 
   that is used. See Section 2.3.3.3, "The Custom Install
1562
 
   Dialog," for more information on performing a custom install.
1563
 
 
1564
 
   If you choose the Typical or Complete installation types and
1565
 
   click the Next button, you advance to the confirmation screen
1566
 
   to verify your choices and begin the installation. If you
1567
 
   choose the Custom installation type and click the Next
1568
 
   button, you advance to the custom installation dialog,
1569
 
   described in Section 2.3.3.3, "The Custom Install Dialog."
 
1454
   There are three installation types available: Typical, Complete,
 
1455
   and Custom.
 
1456
 
 
1457
   The Typical installation type installs the MySQL server, the mysql
 
1458
   command-line client, and the command-line utilities. The
 
1459
   command-line clients and utilities include mysqldump, myisamchk,
 
1460
   and several other tools to help you manage the MySQL server.
 
1461
 
 
1462
   The Complete installation type installs all components included in
 
1463
   the installation package. The full installation package includes
 
1464
   components such as the embedded server library, the benchmark
 
1465
   suite, support scripts, and documentation.
 
1466
 
 
1467
   The Custom installation type gives you complete control over which
 
1468
   packages you wish to install and the installation path that is
 
1469
   used. See Section 2.3.3.3, "The Custom Install Dialog," for more
 
1470
   information on performing a custom install.
 
1471
 
 
1472
   If you choose the Typical or Complete installation types and click
 
1473
   the Next button, you advance to the confirmation screen to verify
 
1474
   your choices and begin the installation. If you choose the Custom
 
1475
   installation type and click the Next button, you advance to the
 
1476
   custom installation dialog, described in Section 2.3.3.3, "The
 
1477
   Custom Install Dialog."
1570
1478
 
1571
1479
2.3.3.3. The Custom Install Dialog
1572
1480
 
1573
1481
   If you wish to change the installation path or the specific
1574
 
   components that are installed by the MySQL Installation
1575
 
   Wizard, choose the Custom installation type.
 
1482
   components that are installed by the MySQL Installation Wizard,
 
1483
   choose the Custom installation type.
1576
1484
 
1577
 
   A tree view on the left side of the custom install dialog
1578
 
   lists all available components. Components that are not
1579
 
   installed have a red X icon; components that are installed
1580
 
   have a gray icon. To change whether a component is installed,
1581
 
   click on that component's icon and choose a new option from
1582
 
   the drop-down list that appears.
 
1485
   A tree view on the left side of the custom install dialog lists
 
1486
   all available components. Components that are not installed have a
 
1487
   red X icon; components that are installed have a gray icon. To
 
1488
   change whether a component is installed, click on that component's
 
1489
   icon and choose a new option from the drop-down list that appears.
1583
1490
 
1584
1491
   You can change the default installation path by clicking the
1585
 
   Change... button to the right of the displayed installation
1586
 
   path.
 
1492
   Change... button to the right of the displayed installation path.
1587
1493
 
1588
 
   After choosing your installation components and installation
1589
 
   path, click the Next button to advance to the confirmation
1590
 
   dialog.
 
1494
   After choosing your installation components and installation path,
 
1495
   click the Next button to advance to the confirmation dialog.
1591
1496
 
1592
1497
2.3.3.4. The Confirmation Dialog
1593
1498
 
1594
 
   Once you choose an installation type and optionally choose
1595
 
   your installation components, you advance to the confirmation
1596
 
   dialog. Your installation type and installation path are
1597
 
   displayed for you to review.
1598
 
 
1599
 
   To install MySQL if you are satisfied with your settings,
1600
 
   click the Install button. To change your settings, click the
1601
 
   Back button. To exit the MySQL Installation Wizard without
1602
 
   installing MySQL, click the Cancel button.
1603
 
 
1604
 
   After installation is complete, you have the option of
1605
 
   registering with the MySQL web site. Registration gives you
1606
 
   access to post in the MySQL forums at forums.mysql.com
1607
 
   (http://forums.mysql.com), along with the ability to report
1608
 
   bugs at bugs.mysql.com (http://bugs.mysql.com) and to
1609
 
   subscribe to our newsletter. The final screen of the
1610
 
   installer provides a summary of the installation and gives
1611
 
   you the option to launch the MySQL Configuration Wizard,
1612
 
   which you can use to create a configuration file, install the
1613
 
   MySQL service, and configure security settings.
 
1499
   Once you choose an installation type and optionally choose your
 
1500
   installation components, you advance to the confirmation dialog.
 
1501
   Your installation type and installation path are displayed for you
 
1502
   to review.
 
1503
 
 
1504
   To install MySQL if you are satisfied with your settings, click
 
1505
   the Install button. To change your settings, click the Back
 
1506
   button. To exit the MySQL Installation Wizard without installing
 
1507
   MySQL, click the Cancel button.
 
1508
 
 
1509
   After installation is complete, you have the option of registering
 
1510
   with the MySQL web site. Registration gives you access to post in
 
1511
   the MySQL forums at forums.mysql.com (http://forums.mysql.com),
 
1512
   along with the ability to report bugs at bugs.mysql.com
 
1513
   (http://bugs.mysql.com) and to subscribe to our newsletter. The
 
1514
   final screen of the installer provides a summary of the
 
1515
   installation and gives you the option to launch the MySQL
 
1516
   Configuration Wizard, which you can use to create a configuration
 
1517
   file, install the MySQL service, and configure security settings.
1614
1518
 
1615
1519
2.3.3.5. Changes Made by MySQL Installation Wizard
1616
1520
 
1617
 
   Once you click the Install button, the MySQL Installation
1618
 
   Wizard begins the installation process and makes certain
1619
 
   changes to your system which are described in the sections
1620
 
   that follow.
 
1521
   Once you click the Install button, the MySQL Installation Wizard
 
1522
   begins the installation process and makes certain changes to your
 
1523
   system which are described in the sections that follow.
1621
1524
 
1622
1525
   Changes to the Registry
1623
1526
 
1624
 
   The MySQL Installation Wizard creates one Windows registry
1625
 
   key in a typical install situation, located in
 
1527
   The MySQL Installation Wizard creates one Windows registry key in
 
1528
   a typical install situation, located in
1626
1529
   HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB.
1627
1530
 
1628
 
   The MySQL Installation Wizard creates a key named after the
1629
 
   major version of the server that is being installed, such as
1630
 
   MySQL Server 5.1. It contains two string values, Location and
1631
 
   Version. The Location string contains the path to the
1632
 
   installation directory. In a default installation it contains
1633
 
   C:\Program Files\MySQL\MySQL Server 5.1\. The Version string
1634
 
   contains the release number. For example, for an installation
1635
 
   of MySQL Server 5.1.31, the key contains a value of 5.1.31.
 
1531
   The MySQL Installation Wizard creates a key named after the major
 
1532
   version of the server that is being installed, such as MySQL
 
1533
   Server 5.1. It contains two string values, Location and Version.
 
1534
   The Location string contains the path to the installation
 
1535
   directory. In a default installation it contains C:\Program
 
1536
   Files\MySQL\MySQL Server 5.1\. The Version string contains the
 
1537
   release number. For example, for an installation of MySQL Server
 
1538
   5.1.35, the key contains a value of 5.1.35.
1636
1539
 
1637
 
   These registry keys are used to help external tools identify
1638
 
   the installed location of the MySQL server, preventing a
1639
 
   complete scan of the hard-disk to determine the installation
1640
 
   path of the MySQL server. The registry keys are not required
1641
 
   to run the server, and if you install MySQL using the
1642
 
   noinstall Zip archive, the registry keys are not created.
 
1540
   These registry keys are used to help external tools identify the
 
1541
   installed location of the MySQL server, preventing a complete scan
 
1542
   of the hard-disk to determine the installation path of the MySQL
 
1543
   server. The registry keys are not required to run the server, and
 
1544
   if you install MySQL using the noinstall Zip archive, the registry
 
1545
   keys are not created.
1643
1546
 
1644
1547
   Changes to the Start Menu
1645
1548
 
1646
 
   The MySQL Installation Wizard creates a new entry in the
1647
 
   Windows Start menu under a common MySQL menu heading named
1648
 
   after the major version of MySQL that you have installed. For
1649
 
   example, if you install MySQL 5.1, the MySQL Installation
1650
 
   Wizard creates a MySQL Server 5.1 section in the Start menu.
 
1549
   The MySQL Installation Wizard creates a new entry in the Windows
 
1550
   Start menu under a common MySQL menu heading named after the major
 
1551
   version of MySQL that you have installed. For example, if you
 
1552
   install MySQL 5.1, the MySQL Installation Wizard creates a MySQL
 
1553
   Server 5.1 section in the Start menu.
1651
1554
 
1652
1555
   The following entries are created within the new Start menu
1653
1556
   section:
1654
1557
 
1655
 
     * MySQL Command Line Client: This is a shortcut to the
1656
 
       mysql command-line client and is configured to connect as
1657
 
       the root user. The shortcut prompts for a root user
1658
 
       password when you connect.
 
1558
     * MySQL Command Line Client: This is a shortcut to the mysql
 
1559
       command-line client and is configured to connect as the root
 
1560
       user. The shortcut prompts for a root user password when you
 
1561
       connect.
1659
1562
 
1660
 
     * MySQL Server Instance Config Wizard: This is a shortcut
1661
 
       to the MySQL Configuration Wizard. Use this shortcut to
1662
 
       configure a newly installed server, or to reconfigure an
1663
 
       existing server.
 
1563
     * MySQL Server Instance Config Wizard: This is a shortcut to the
 
1564
       MySQL Configuration Wizard. Use this shortcut to configure a
 
1565
       newly installed server, or to reconfigure an existing server.
1664
1566
 
1665
1567
     * MySQL Documentation: This is a link to the MySQL server
1666
1568
       documentation that is stored locally in the MySQL server
1667
 
       installation directory. This option is not available when
1668
 
       the MySQL server is installed using the Essentials
1669
 
       installation package.
 
1569
       installation directory. This option is not available when the
 
1570
       MySQL server is installed using the Essentials installation
 
1571
       package.
1670
1572
 
1671
1573
   Changes to the File System
1672
1574
 
1673
 
   The MySQL Installation Wizard by default installs the MySQL
1674
 
   5.1 server to C:\Program Files\MySQL\MySQL Server 5.1, where
1675
 
   Program Files is the default location for applications in
1676
 
   your system, and 5.1 is the major version of your MySQL
1677
 
   server. This is the recommended location for the MySQL
1678
 
   server, replacing the former default location C:\mysql.
 
1575
   The MySQL Installation Wizard by default installs the MySQL 5.1
 
1576
   server to C:\Program Files\MySQL\MySQL Server 5.1, where Program
 
1577
   Files is the default location for applications in your system, and
 
1578
   5.1 is the major version of your MySQL server. This is the
 
1579
   recommended location for the MySQL server, replacing the former
 
1580
   default location C:\mysql.
1679
1581
 
1680
1582
   By default, all MySQL applications are stored in a common
1681
 
   directory at C:\Program Files\MySQL, where Program Files is
1682
 
   the default location for applications in your Windows
1683
 
   installation. A typical MySQL installation on a developer
1684
 
   machine might look like this:
 
1583
   directory at C:\Program Files\MySQL, where Program Files is the
 
1584
   default location for applications in your Windows installation. A
 
1585
   typical MySQL installation on a developer machine might look like
 
1586
   this:
1685
1587
C:\Program Files\MySQL\MySQL Server 5.1
1686
1588
C:\Program Files\MySQL\MySQL Administrator 1.0
1687
1589
C:\Program Files\MySQL\MySQL Query Browser 1.0
1688
1590
 
1689
 
   This approach makes it easier to manage and maintain all
1690
 
   MySQL applications installed on a particular system.
 
1591
   This approach makes it easier to manage and maintain all MySQL
 
1592
   applications installed on a particular system.
1691
1593
 
1692
 
   In MySQL 5.1.23 and earlier, the default location for the
1693
 
   data files used by MySQL is located within the corresponding
1694
 
   MySQL Server installation directory. For MySQL 5.1.24 and
1695
 
   later, the default location of the data directory is the
1696
 
   AppData directory configured for the user that installed the
1697
 
   MySQL application.
 
1594
   In MySQL 5.1.23 and earlier, the default location for the data
 
1595
   files used by MySQL is located within the corresponding MySQL
 
1596
   Server installation directory. For MySQL 5.1.24 and later, the
 
1597
   default location of the data directory is the AppData directory
 
1598
   configured for the user that installed the MySQL application.
1698
1599
 
1699
1600
2.3.3.6. Upgrading MySQL with the Installation Wizard
1700
1601
 
1701
1602
   The MySQL Installation Wizard can perform server upgrades
1702
 
   automatically using the upgrade capabilities of MSI. That
1703
 
   means you do not need to remove a previous installation
1704
 
   manually before installing a new release. The installer
1705
 
   automatically shuts down and removes the previous MySQL
1706
 
   service before installing the new version.
 
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.
1707
1608
 
1708
1609
   Automatic upgrades are available only when upgrading between
1709
 
   installations that have the same major and minor version
1710
 
   numbers. For example, you can upgrade automatically from
1711
 
   MySQL 4.1.5 to MySQL 4.1.6, but not from MySQL 5.0 to MySQL
1712
 
   5.1.
 
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 5.0 to MySQL 5.1.
1713
1613
 
1714
1614
   See Section 2.3.14, "Upgrading MySQL on Windows."
1715
1615
 
1716
1616
2.3.4. MySQL Server Instance Configuration Wizard
1717
1617
 
1718
 
   The MySQL Server Instance Configuration Wizard helps automate
1719
 
   the process of configuring your server. It creates a custom
1720
 
   MySQL configuration file (my.ini or my.cnf) by asking you a
1721
 
   series of questions and then applying your responses to a
1722
 
   template to generate the configuration file that is tuned to
1723
 
   your installation.
 
1618
   The MySQL Server Instance Configuration Wizard helps automate the
 
1619
   process 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.
1724
1624
 
1725
 
   The MySQL Server Instance Configuration Wizard is included
1726
 
   with the MySQL 5.1 server. The MySQL Server Instance
1727
 
   Configuration Wizard is only available for Windows.
 
1625
   The MySQL Server Instance Configuration Wizard is included with
 
1626
   the MySQL 5.1 server. The MySQL Server Instance Configuration
 
1627
   Wizard is only available for Windows.
1728
1628
 
1729
1629
2.3.4.1. Starting the MySQL Server Instance Configuration Wizard
1730
1630
 
1731
 
   The MySQL Server Instance Configuration Wizard is normally
1732
 
   started as part of the installation process. You should only
1733
 
   need to run the MySQL Server Instance Configuration Wizard
1734
 
   again when you need to change the configuration parameters of
1735
 
   your server.
 
1631
   The MySQL Server Instance Configuration Wizard is normally started
 
1632
   as part of the installation process. You should only need to run
 
1633
   the MySQL Server Instance Configuration Wizard again when you need
 
1634
   to change the configuration parameters of your server.
1736
1635
 
1737
1636
   If you chose not to open a port prior to installing MySQL on
1738
1637
   Windows Vista, you can choose to use the MySQL Server
1739
 
   Configuration Wizard after installation. However, you must
1740
 
   open a port in the Windows Firewall. To do this see the
1741
 
   instructions given in Section 2.3.3.1, "Downloading and
1742
 
   Starting the MySQL Installation Wizard." Rather than opening
1743
 
   a port, you also have the option of adding MySQL as a program
1744
 
   that bypasses the Windows Firewall. One or the other option
1745
 
   is sufficient --- you need not do both. Additionally, when
1746
 
   running the MySQL Server Configuration Wizard on Windows
1747
 
   Vista ensure that you are logged in as a user with
1748
 
   administrative rights.
 
1638
   Configuration Wizard after installation. However, you must open a
 
1639
   port in the Windows Firewall. To do this see the instructions
 
1640
   given in Section 2.3.3.1, "Downloading and Starting the MySQL
 
1641
   Installation Wizard." Rather than opening a port, you also have
 
1642
   the option of adding MySQL as a program that bypasses the Windows
 
1643
   Firewall. One or the other option is sufficient --- you need not
 
1644
   do both. Additionally, when running the MySQL Server Configuration
 
1645
   Wizard on Windows Vista ensure that you are logged in as a user
 
1646
   with administrative rights.
1749
1647
   MySQL Server Instance Configuration Wizard
1750
1648
 
1751
1649
   You can launch the MySQL Configuration Wizard by clicking the
1752
 
   MySQL Server Instance Config Wizard entry in the MySQL
1753
 
   section of the Windows Start menu.
1754
 
 
1755
 
   Alternatively, you can navigate to the bin directory of your
1756
 
   MySQL installation and launch the MySQLInstanceConfig.exe
1757
 
   file directly.
1758
 
 
1759
 
   The MySQL Server Instance Configuration Wizard places the
1760
 
   my.ini file in the installation directory for the MySQL
1761
 
   server. This helps associate configuration files with
1762
 
   particular server instances.
1763
 
 
1764
 
   To ensure that the MySQL server knows where to look for the
1765
 
   my.ini file, an argument similar to this is passed to the
1766
 
   MySQL server as part of the service installation:
 
1650
   MySQL Server Instance Config Wizard entry in the MySQL section of
 
1651
   the Windows Start menu.
 
1652
 
 
1653
   Alternatively, you can navigate to the bin directory of your MySQL
 
1654
   installation and launch the MySQLInstanceConfig.exe file directly.
 
1655
 
 
1656
   The MySQL Server Instance Configuration Wizard places the my.ini
 
1657
   file in the installation directory for the MySQL server. This
 
1658
   helps associate configuration files with particular server
 
1659
   instances.
 
1660
 
 
1661
   To ensure that the MySQL server knows where to look for the my.ini
 
1662
   file, an argument similar to this is passed to the MySQL server as
 
1663
   part of the service installation:
1767
1664
--defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini"
1768
1665
 
1769
 
   Here, C:\Program Files\MySQL\MySQL Server 5.1 is replaced
1770
 
   with the installation path to the MySQL Server. The
1771
 
   --defaults-file option instructs the MySQL server to read the
1772
 
   specified file for configuration options when it starts.
 
1666
   Here, C:\Program Files\MySQL\MySQL Server 5.1 is replaced with the
 
1667
   installation path to the MySQL Server. The --defaults-file option
 
1668
   instructs the MySQL server to read the specified file for
 
1669
   configuration options when it starts.
1773
1670
 
1774
 
   Apart from making changes to the my.ini file by running the
1775
 
   MySQL Server Instance Configuration Wizard again, you can
1776
 
   modify it by opening it with a text editor and making any
1777
 
   necessary changes. You can also modify the server
1778
 
   configuration with the MySQL Administrator
1779
 
   (http://www.mysql.com/products/administrator/) utility. For
1780
 
   more information about server configuration, see Section
1781
 
   5.1.2, "Server Command Options."
 
1671
   Apart from making changes to the my.ini file by running the MySQL
 
1672
   Server Instance Configuration Wizard again, you can modify it by
 
1673
   opening it with a text editor and making any necessary changes.
 
1674
   You can also modify the server configuration with the MySQL
 
1675
   Administrator (http://www.mysql.com/products/administrator/)
 
1676
   utility. For more information about server configuration, see
 
1677
   Section 5.1.2, "Server Command Options."
1782
1678
 
1783
1679
   MySQL clients and utilities such as the mysql and mysqldump
1784
1680
   command-line clients are not able to locate the my.ini file
1785
 
   located in the server installation directory. To configure
1786
 
   the client and utility applications, create a new my.ini file
1787
 
   in the Windows installation directory (for example,
1788
 
   C:\WINDOWS).
 
1681
   located in the server installation directory. To configure the
 
1682
   client and utility applications, create a new my.ini file in the
 
1683
   Windows installation directory (for example, C:\WINDOWS).
1789
1684
 
1790
 
   Under Windows Server 2003, Windows Server 2000, Windows XP,
1791
 
   and Windows Vista MySQL Server Instance Configuration Wizard
1792
 
   will configure MySQL to work as a Windows service. To start
1793
 
   and stop MySQL you use the Services application that is
1794
 
   supplied as part of the Windows Administrator Tools.
 
1685
   Under Windows Server 2003, Windows Server 2000, Windows XP, and
 
1686
   Windows Vista MySQL Server Instance Configuration Wizard will
 
1687
   configure MySQL to work as a Windows service. To start and stop
 
1688
   MySQL you use the Services application that is supplied as part of
 
1689
   the Windows Administrator Tools.
1795
1690
 
1796
1691
2.3.4.2. Choosing a Maintenance Option
1797
1692
 
1803
1698
 
1804
1699
   To reconfigure an existing server, choose the Re-configure
1805
1700
   Instance option and click the Next button. Any existing
1806
 
   configuration file is not overwritten, but renamed (within
1807
 
   the same directory) using a timestamp (Windows) or sequential
1808
 
   number (Linux). To remove the existing server instance,
1809
 
   choose the Remove Instance option and click the Next button.
 
1701
   configuration file is not overwritten, but renamed (within the
 
1702
   same directory) using a timestamp (Windows) or sequential number
 
1703
   (Linux). To remove the existing server instance, choose the Remove
 
1704
   Instance option and click the Next button.
1810
1705
 
1811
1706
   If you choose the Remove Instance option, you advance to a
1812
 
   confirmation window. Click the Execute button. The MySQL
1813
 
   Server Configuration Wizard stops and removes the MySQL
1814
 
   service, and then deletes the configuration file. The server
1815
 
   installation and its data folder are not removed.
 
1707
   confirmation window. Click the Execute button. The MySQL Server
 
1708
   Configuration Wizard stops and removes the MySQL service, and then
 
1709
   deletes the configuration file. The server installation and its
 
1710
   data folder are not removed.
1816
1711
 
1817
 
   If you choose the Re-configure Instance option, you advance
1818
 
   to the Configuration Type dialog where you can choose the
1819
 
   type of installation that you wish to configure.
 
1712
   If you choose the Re-configure Instance option, you advance to the
 
1713
   Configuration Type dialog where you can choose the type of
 
1714
   installation that you wish to configure.
1820
1715
 
1821
1716
2.3.4.3. Choosing a Configuration Type
1822
1717
 
1823
 
   When you start the MySQL Server Instance Configuration Wizard
1824
 
   for a new MySQL installation, or choose the Re-configure
1825
 
   Instance option for an existing installation, you advance to
1826
 
   the Configuration Type dialog.
1827
 
   MySQL Server Instance Configuration Wizard: Configuration
1828
 
   Type
 
1718
   When you start the MySQL Server Instance Configuration Wizard for
 
1719
   a new MySQL installation, or choose the Re-configure Instance
 
1720
   option for an existing installation, you advance to the
 
1721
   Configuration Type dialog.
 
1722
   MySQL Server Instance Configuration Wizard: Configuration Type
1829
1723
 
1830
1724
   There are two configuration types available: Detailed
1831
1725
   Configuration and Standard Configuration. The Standard
1832
 
   Configuration option is intended for new users who want to
1833
 
   get started with MySQL quickly without having to make many
1834
 
   decisions about server configuration. The Detailed
1835
 
   Configuration option is intended for advanced users who want
1836
 
   more fine-grained control over server configuration.
 
1726
   Configuration option is intended for new users who want to get
 
1727
   started with MySQL quickly without having to make many decisions
 
1728
   about server configuration. The Detailed Configuration option is
 
1729
   intended for advanced users who want more fine-grained control
 
1730
   over server configuration.
1837
1731
 
1838
1732
   If you are new to MySQL and need a server configured as a
1839
 
   single-user developer machine, the Standard Configuration
1840
 
   should suit your needs. Choosing the Standard Configuration
1841
 
   option causes the MySQL Configuration Wizard to set all
1842
 
   configuration options automatically with the exception of
1843
 
   Service Options and Security Options.
 
1733
   single-user developer machine, the Standard Configuration should
 
1734
   suit your needs. Choosing the Standard Configuration option causes
 
1735
   the MySQL Configuration Wizard to set all configuration options
 
1736
   automatically with the exception of Service Options and Security
 
1737
   Options.
1844
1738
 
1845
 
   The Standard Configuration sets options that may be
1846
 
   incompatible with systems where there are existing MySQL
1847
 
   installations. If you have an existing MySQL installation on
1848
 
   your system in addition to the installation you wish to
1849
 
   configure, the Detailed Configuration option is recommended.
 
1739
   The Standard Configuration sets options that may be incompatible
 
1740
   with systems where there are existing MySQL installations. If you
 
1741
   have an existing MySQL installation on your system in addition to
 
1742
   the installation you wish to configure, the Detailed Configuration
 
1743
   option is recommended.
1850
1744
 
1851
1745
   To complete the Standard Configuration, please refer to the
1852
1746
   sections on Service Options and Security Options in Section
1853
 
   2.3.4.10, "The Service Options Dialog," and Section 2.3.4.11,
1854
 
   "The Security Options Dialog," respectively.
 
1747
   2.3.4.10, "The Service Options Dialog," and Section 2.3.4.11, "The
 
1748
   Security Options Dialog," respectively.
1855
1749
 
1856
1750
2.3.4.4. The Server Type Dialog
1857
1751
 
1858
 
   There are three different server types available to choose
1859
 
   from. The server type that you choose affects the decisions
1860
 
   that the MySQL Server Instance Configuration Wizard makes
1861
 
   with regard to memory, disk, and processor usage.
 
1752
   There are three different server types available to choose from.
 
1753
   The server type that you choose affects the decisions that the
 
1754
   MySQL Server Instance Configuration Wizard makes with regard to
 
1755
   memory, disk, and processor usage.
1862
1756
   MySQL Server Instance Configuration Wizard: Server Type
1863
1757
 
1864
 
     * Developer Machine: Choose this option for a typical
1865
 
       desktop workstation where MySQL is intended only for
1866
 
       personal use. It is assumed that many other desktop
1867
 
       applications are running. The MySQL server is configured
1868
 
       to use minimal system resources.
 
1758
     * Developer Machine: Choose this option for a typical desktop
 
1759
       workstation where MySQL is intended only for personal use. It
 
1760
       is assumed that many other desktop applications are running.
 
1761
       The MySQL server is configured to use minimal system
 
1762
       resources.
1869
1763
 
1870
 
     * Server Machine: Choose this option for a server machine
1871
 
       where the MySQL server is running alongside other server
1872
 
       applications such as FTP, email, and Web servers. The
1873
 
       MySQL server is configured to use a moderate portion of
1874
 
       the system resources.
 
1764
     * Server Machine: Choose this option for a server machine where
 
1765
       the MySQL server is running alongside other server
 
1766
       applications such as FTP, email, and Web servers. The MySQL
 
1767
       server is configured to use a moderate portion of the system
 
1768
       resources.
1875
1769
 
1876
1770
     * Dedicated MySQL Server Machine: Choose this option for a
1877
 
       server machine that is intended to run only the MySQL
1878
 
       server. It is assumed that no other applications are
1879
 
       running. The MySQL server is configured to use all
1880
 
       available system resources.
 
1771
       server machine that is intended to run only the MySQL server.
 
1772
       It is assumed that no other applications are running. The
 
1773
       MySQL server is configured to use all available system
 
1774
       resources.
1881
1775
 
1882
1776
Note
1883
1777
 
1884
 
   By selecting one of the preconfigured configurations, the
1885
 
   values and settings of various options in your my.cnf or
1886
 
   my.ini will be altered accordingly. The default values and
1887
 
   options as described in the reference manual may therefore be
1888
 
   different to the options and values that were created during
1889
 
   the execution of the configuration wizard.
 
1778
   By selecting one of the preconfigured configurations, the values
 
1779
   and settings of various options in your my.cnf or my.ini will be
 
1780
   altered accordingly. The default values and options as described
 
1781
   in the reference manual may therefore be different to the options
 
1782
   and values that were created during the execution of the
 
1783
   configuration wizard.
1890
1784
 
1891
1785
2.3.4.5. The Database Usage Dialog
1892
1786
 
1893
1787
   The Database Usage dialog allows you to indicate the storage
1894
 
   engines that you expect to use when creating MySQL tables.
1895
 
   The option you choose determines whether the InnoDB storage
1896
 
   engine is available and what percentage of the server
1897
 
   resources are available to InnoDB.
 
1788
   engines that you expect to use when creating MySQL tables. The
 
1789
   option you choose determines whether the InnoDB storage engine is
 
1790
   available and what percentage of the server resources are
 
1791
   available to InnoDB.
1898
1792
   MySQL Server Instance Configuration Wizard: Usage Dialog
1899
1793
 
1900
 
     * Multifunctional Database: This option enables both the
1901
 
       InnoDB and MyISAM storage engines and divides resources
1902
 
       evenly between the two. This option is recommended for
1903
 
       users who use both storage engines on a regular basis.
 
1794
     * Multifunctional Database: This option enables both the InnoDB
 
1795
       and MyISAM storage engines and divides resources evenly
 
1796
       between the two. This option is recommended for users who use
 
1797
       both storage engines on a regular basis.
1904
1798
 
1905
1799
     * Transactional Database Only: This option enables both the
1906
 
       InnoDB and MyISAM storage engines, but dedicates most
1907
 
       server resources to the InnoDB storage engine. This
1908
 
       option is recommended for users who use InnoDB almost
1909
 
       exclusively and make only minimal use of MyISAM.
 
1800
       InnoDB and MyISAM storage engines, but dedicates most server
 
1801
       resources to the InnoDB storage engine. This option is
 
1802
       recommended for users who use InnoDB almost exclusively and
 
1803
       make only minimal use of MyISAM.
1910
1804
 
1911
1805
     * Non-Transactional Database Only: This option disables the
1912
1806
       InnoDB storage engine completely and dedicates all server
1913
1807
       resources to the MyISAM storage engine. This option is
1914
1808
       recommended for users who do not use InnoDB.
1915
1809
 
1916
 
   The Configuration Wizard uses a template to generate the
1917
 
   server configuration file. The Database Usage dialog sets one
1918
 
   of the following option strings:
 
1810
   The Configuration Wizard uses a template to generate the server
 
1811
   configuration file. The Database Usage dialog sets one of the
 
1812
   following option strings:
1919
1813
Multifunctional Database:        MIXED
1920
1814
Transactional Database Only:     INNODB
1921
1815
Non-Transactional Database Only: MYISAM
1941
1835
 
1942
1836
2.3.4.6. The InnoDB Tablespace Dialog
1943
1837
 
1944
 
   Some users may want to locate the InnoDB tablespace files in
1945
 
   a different location than the MySQL server data directory.
1946
 
   Placing the tablespace files in a separate location can be
1947
 
   desirable if your system has a higher capacity or higher
1948
 
   performance storage device available, such as a RAID storage
1949
 
   system.
1950
 
   MySQL Server Instance Configuration Wizard: InnoDB Data
1951
 
   Tablespace
1952
 
 
1953
 
   To change the default location for the InnoDB tablespace
1954
 
   files, choose a new drive from the drop-down list of drive
1955
 
   letters and choose a new path from the drop-down list of
1956
 
   paths. To create a custom path, click the ... button.
1957
 
 
1958
 
   If you are modifying the configuration of an existing server,
1959
 
   you must click the Modify button before you change the path.
1960
 
   In this situation you must move the existing tablespace files
1961
 
   to the new location manually before starting the server.
 
1838
   Some users may want to locate the InnoDB tablespace files in a
 
1839
   different location than the MySQL server data directory. Placing
 
1840
   the tablespace files in a separate location can be desirable if
 
1841
   your system has a higher capacity or higher performance storage
 
1842
   device available, such as a RAID storage system.
 
1843
   MySQL Server Instance Configuration Wizard: InnoDB Data Tablespace
 
1844
 
 
1845
   To change the default location for the InnoDB tablespace files,
 
1846
   choose a new drive from the drop-down list of drive letters and
 
1847
   choose a new path from the drop-down list of paths. To create a
 
1848
   custom path, click the ... button.
 
1849
 
 
1850
   If you are modifying the configuration of an existing server, you
 
1851
   must click the Modify button before you change the path. In this
 
1852
   situation you must move the existing tablespace files to the new
 
1853
   location manually before starting the server.
1962
1854
 
1963
1855
2.3.4.7. The Concurrent Connections Dialog
1964
1856
 
1965
1857
   To prevent the server from running out of resources, it is
1966
 
   important to limit the number of concurrent connections to
1967
 
   the MySQL server that can be established. The Concurrent
1968
 
   Connections dialog allows you to choose the expected usage of
1969
 
   your server, and sets the limit for concurrent connections
1970
 
   accordingly. It is also possible to set the concurrent
1971
 
   connection limit manually.
 
1858
   important to limit the number of concurrent connections to the
 
1859
   MySQL server that can be established. The Concurrent Connections
 
1860
   dialog allows you to choose the expected usage of your server, and
 
1861
   sets the limit for concurrent connections accordingly. It is also
 
1862
   possible to set the concurrent connection limit manually.
1972
1863
   MySQL Server Instance Configuration Wizard: Connections
1973
1864
 
1974
 
     * Decision Support (DSS)/OLAP: Choose this option if your
1975
 
       server does not require a large number of concurrent
1976
 
       connections. The maximum number of connections is set at
1977
 
       100, with an average of 20 concurrent connections
1978
 
       assumed.
1979
 
 
1980
 
     * Online Transaction Processing (OLTP): Choose this option
1981
 
       if your server requires a large number of concurrent
1982
 
       connections. The maximum number of connections is set at
1983
 
       500.
1984
 
 
1985
 
     * Manual Setting: Choose this option to set the maximum
1986
 
       number of concurrent connections to the server manually.
1987
 
       Choose the number of concurrent connections from the
1988
 
       drop-down box provided, or enter the maximum number of
1989
 
       connections into the drop-down box if the number you
1990
 
       desire is not listed.
 
1865
     * Decision Support (DSS)/OLAP: Choose this option if your server
 
1866
       does not require a large number of concurrent connections. The
 
1867
       maximum number of connections is set at 100, with an average
 
1868
       of 20 concurrent connections assumed.
 
1869
 
 
1870
     * Online Transaction Processing (OLTP): Choose this option if
 
1871
       your server requires a large number of concurrent connections.
 
1872
       The maximum number of connections is set at 500.
 
1873
 
 
1874
     * Manual Setting: Choose this option to set the maximum number
 
1875
       of concurrent connections to the server manually. Choose the
 
1876
       number of concurrent connections from the drop-down box
 
1877
       provided, or enter the maximum number of connections into the
 
1878
       drop-down box if the number you desire is not listed.
1991
1879
 
1992
1880
2.3.4.8. The Networking and Strict Mode Options Dialog
1993
1881
 
1994
1882
   Use the Networking Options dialog to enable or disable TCP/IP
1995
1883
   networking and to configure the port number that is used to
1996
1884
   connect to the MySQL server.
1997
 
   MySQL Server Instance Configuration Wizard: Network
1998
 
   Configuration
 
1885
   MySQL Server Instance Configuration Wizard: Network Configuration
1999
1886
 
2000
1887
   TCP/IP networking is enabled by default. To disable TCP/IP
2001
 
   networking, uncheck the box next to the Enable TCP/IP
2002
 
   Networking option.
2003
 
 
2004
 
   Port 3306 is used by default. To change the port used to
2005
 
   access MySQL, choose a new port number from the drop-down box
2006
 
   or type a new port number directly into the drop-down box. If
2007
 
   the port number you choose is in use, you are prompted to
2008
 
   confirm your choice of port number.
2009
 
 
2010
 
   Set the Server SQL Mode to either enable or disable strict
2011
 
   mode. Enabling strict mode (default) makes MySQL behave more
2012
 
   like other database management systems. If you run
2013
 
   applications that rely on MySQL's old "forgiving" behavior,
2014
 
   make sure to either adapt those applications or to disable
2015
 
   strict mode. For more information about strict mode, see
2016
 
   Section 5.1.7, "Server SQL Modes."
 
1888
   networking, uncheck the box next to the Enable TCP/IP Networking
 
1889
   option.
 
1890
 
 
1891
   Port 3306 is used by default. To change the port used to access
 
1892
   MySQL, choose a new port number from the drop-down box or type a
 
1893
   new port number directly into the drop-down box. If the port
 
1894
   number you choose is in use, you are prompted to confirm your
 
1895
   choice of port number.
 
1896
 
 
1897
   Set the Server SQL Mode to either enable or disable strict mode.
 
1898
   Enabling strict mode (default) makes MySQL behave more like other
 
1899
   database management systems. If you run applications that rely on
 
1900
   MySQL's old "forgiving" behavior, make sure to either adapt those
 
1901
   applications or to disable strict mode. For more information about
 
1902
   strict mode, see Section 5.1.7, "Server SQL Modes."
2017
1903
 
2018
1904
2.3.4.9. The Character Set Dialog
2019
1905
 
2020
1906
   The MySQL server supports multiple character sets and it is
2021
 
   possible to set a default server character set that is
2022
 
   applied to all tables, columns, and databases unless
2023
 
   overridden. Use the Character Set dialog to change the
2024
 
   default character set of the MySQL server.
 
1907
   possible to set a default server character set that is applied to
 
1908
   all tables, columns, and databases unless overridden. Use the
 
1909
   Character Set dialog to change the default character set of the
 
1910
   MySQL server.
2025
1911
   MySQL Server Instance Configuration Wizard: Character Set
2026
1912
 
2027
 
     * Standard Character Set: Choose this option if you want to
2028
 
       use latin1 as the default server character set. latin1 is
2029
 
       used for English and many Western European languages.
2030
 
 
2031
 
     * Best Support For Multilingualism: Choose this option if
2032
 
       you want to use utf8 as the default server character set.
2033
 
       This is a Unicode character set that can store characters
2034
 
       from many different languages.
2035
 
 
2036
 
     * Manual Selected Default Character Set / Collation: Choose
2037
 
       this option if you want to pick the server's default
2038
 
       character set manually. Choose the desired character set
2039
 
       from the provided drop-down list.
 
1913
     * Standard Character Set: Choose this option if you want to use
 
1914
       latin1 as the default server character set. latin1 is used for
 
1915
       English and many Western European languages.
 
1916
 
 
1917
     * Best Support For Multilingualism: Choose this option if you
 
1918
       want to use utf8 as the default server character set. This is
 
1919
       a Unicode character set that can store characters from many
 
1920
       different languages.
 
1921
 
 
1922
     * Manual Selected Default Character Set / Collation: Choose this
 
1923
       option if you want to pick the server's default character set
 
1924
       manually. Choose the desired character set from the provided
 
1925
       drop-down list.
2040
1926
 
2041
1927
2.3.4.10. The Service Options Dialog
2042
1928
 
2043
1929
   On Windows platforms, the MySQL server can be installed as a
2044
 
   Windows service. When installed this way, the MySQL server
2045
 
   can be started automatically during system startup, and even
2046
 
   restarted automatically by Windows in the event of a service
2047
 
   failure.
 
1930
   Windows service. When installed this way, the MySQL server can be
 
1931
   started automatically during system startup, and even restarted
 
1932
   automatically by Windows in the event of a service failure.
2048
1933
 
2049
 
   The MySQL Server Instance Configuration Wizard installs the
2050
 
   MySQL server as a service by default, using the service name
2051
 
   MySQL. If you do not wish to install the service, uncheck the
2052
 
   box next to the Install As Windows Service option. You can
2053
 
   change the service name by picking a new service name from
2054
 
   the drop-down box provided or by entering a new service name
2055
 
   into the drop-down box.
 
1934
   The MySQL Server Instance Configuration Wizard installs the MySQL
 
1935
   server as a service by default, using the service name MySQL. If
 
1936
   you do not wish to install the service, uncheck the box next to
 
1937
   the Install As Windows Service option. You can change the service
 
1938
   name by picking a new service name from the drop-down box provided
 
1939
   or by entering a new service name into the drop-down box.
2056
1940
 
2057
1941
Note
2058
1942
 
2059
 
   Service names can include any legal character except forward
2060
 
   (/) or backward (\) slashes, and must be less than 256
2061
 
   characters long.
 
1943
   Service names can include any legal character except forward (/)
 
1944
   or backward (\) slashes, and must be less than 256 characters
 
1945
   long.
2062
1946
 
2063
1947
Warning
2064
1948
 
2065
 
   If you are installing multiple versions of MySQL onto the
2066
 
   same machine, you must choose a different service name for
2067
 
   each version that you install. If you do not choose a
2068
 
   different service for each installed version then the service
2069
 
   manager information will be inconsistent and this will cause
2070
 
   problems when you try to uninstall a previous version.
2071
 
 
2072
 
   If you have already installed multiple versions using the
2073
 
   same service name, you must manually edit the contents of the
2074
 
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
2075
 
   parameters within the Windows registry to update the
2076
 
   association of the service name with the correct server
2077
 
   version.
2078
 
 
2079
 
   Typically, when installing multiple versions you create a
2080
 
   service name based on the version information. For example,
2081
 
   you might install MySQL 5.x as mysql5, or specific versions
2082
 
   such as MySQL 5.1.30 as mysql5130.
2083
 
 
2084
 
   To install the MySQL server as a service but not have it
2085
 
   started automatically at startup, uncheck the box next to the
2086
 
   Launch the MySQL Server Automatically option.
 
1949
   If you are installing multiple versions of MySQL onto the same
 
1950
   machine, you must choose a different service name for each version
 
1951
   that you install. If you do not choose a different service for
 
1952
   each installed version then the service manager information will
 
1953
   be inconsistent and this will cause problems when you try to
 
1954
   uninstall a previous version.
 
1955
 
 
1956
   If you have already installed multiple versions using the same
 
1957
   service name, you must manually edit the contents of the
 
1958
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services parameters
 
1959
   within the Windows registry to update the association of the
 
1960
   service name with the correct server version.
 
1961
 
 
1962
   Typically, when installing multiple versions you create a service
 
1963
   name based on the version information. For example, you might
 
1964
   install MySQL 5.x as mysql5, or specific versions such as MySQL
 
1965
   5.1.30 as mysql5130.
 
1966
 
 
1967
   To install the MySQL server as a service but not have it started
 
1968
   automatically at startup, uncheck the box next to the Launch the
 
1969
   MySQL Server Automatically option.
2087
1970
 
2088
1971
2.3.4.11. The Security Options Dialog
2089
1972
 
2090
 
   It is strongly recommended that you set a root password for
2091
 
   your MySQL server, and the MySQL Server Instance
2092
 
   Configuration Wizard requires by default that you do so. If
2093
 
   you do not wish to set a root password, uncheck the box next
2094
 
   to the Modify Security Settings option.
 
1973
   It is strongly recommended that you set a root password for your
 
1974
   MySQL server, and the MySQL Server Instance Configuration Wizard
 
1975
   requires by default that you do so. If you do not wish to set a
 
1976
   root password, uncheck the box next to the Modify Security
 
1977
   Settings option.
2095
1978
   MySQL Server Instance Configuration Wizard: Security
2096
1979
 
2097
 
   To set the root password, enter the desired password into
2098
 
   both the New root password and Confirm boxes. If you are
2099
 
   reconfiguring an existing server, you need to enter the
2100
 
   existing root password into the Current root password box.
2101
 
 
2102
 
   To prevent root logins from across the network, check the box
2103
 
   next to the Root may only connect from localhost option. This
2104
 
   increases the security of your root account.
2105
 
 
2106
 
   To create an anonymous user account, check the box next to
2107
 
   the Create An Anonymous Account option. Creating an anonymous
2108
 
   account can decrease server security and cause login and
2109
 
   permission difficulties. For this reason, it is not
2110
 
   recommended.
 
1980
   To set the root password, enter the desired password into both the
 
1981
   New root password and Confirm boxes. If you are reconfiguring an
 
1982
   existing server, you need to enter the existing root password into
 
1983
   the Current root password box.
 
1984
 
 
1985
   To prevent root logins from across the network, check the box next
 
1986
   to the Root may only connect from localhost option. This increases
 
1987
   the security of your root account.
 
1988
 
 
1989
   To create an anonymous user account, check the box next to the
 
1990
   Create An Anonymous Account option. Creating an anonymous account
 
1991
   can decrease server security and cause login and permission
 
1992
   difficulties. For this reason, it is not recommended.
2111
1993
 
2112
1994
2.3.4.12. The Confirmation Dialog
2113
1995
 
2114
 
   The final dialog in the MySQL Server Instance Configuration
2115
 
   Wizard is the Confirmation Dialog. To start the configuration
2116
 
   process, click the Execute button. To return to a previous
2117
 
   dialog, click the Back button. To exit the MySQL Server
2118
 
   Instance Configuration Wizard without configuring the server,
2119
 
   click the Cancel button.
 
1996
   The final dialog in the MySQL Server Instance Configuration Wizard
 
1997
   is the Confirmation Dialog. To start the configuration process,
 
1998
   click the Execute button. To return to a previous dialog, click
 
1999
   the Back button. To exit the MySQL Server Instance Configuration
 
2000
   Wizard without configuring the server, click the Cancel button.
2120
2001
   MySQL Server Instance Configuration Wizard: Confirmation
2121
2002
 
2122
2003
   After you click the Execute button, the MySQL Server Instance
2123
 
   Configuration Wizard performs a series of tasks and displays
2124
 
   the progress onscreen as the tasks are performed.
2125
 
 
2126
 
   The MySQL Server Instance Configuration Wizard first
2127
 
   determines configuration file options based on your choices
2128
 
   using a template prepared by MySQL developers and engineers.
2129
 
   This template is named my-template.ini and is located in your
2130
 
   server installation directory.
2131
 
 
2132
 
   The MySQL Configuration Wizard then writes these options to
2133
 
   the corresponding configuration file.
2134
 
 
2135
 
   If you chose to create a service for the MySQL server, the
2136
 
   MySQL Server Instance Configuration Wizard creates and starts
2137
 
   the service. If you are reconfiguring an existing service,
2138
 
   the MySQL Server Instance Configuration Wizard restarts the
2139
 
   service to apply your configuration changes.
 
2004
   Configuration Wizard performs a series of tasks and displays the
 
2005
   progress onscreen as the tasks are performed.
 
2006
 
 
2007
   The MySQL Server Instance Configuration Wizard first determines
 
2008
   configuration file options based on your choices using a template
 
2009
   prepared by MySQL developers and engineers. This template is named
 
2010
   my-template.ini and is located in your server installation
 
2011
   directory.
 
2012
 
 
2013
   The MySQL Configuration Wizard then writes these options to the
 
2014
   corresponding configuration file.
 
2015
 
 
2016
   If you chose to create a service for the MySQL server, the MySQL
 
2017
   Server Instance Configuration Wizard creates and starts the
 
2018
   service. If you are reconfiguring an existing service, the MySQL
 
2019
   Server Instance Configuration Wizard restarts the service to apply
 
2020
   your configuration changes.
2140
2021
 
2141
2022
   If you chose to set a root password, the MySQL Configuration
2142
 
   Wizard connects to the server, sets your new root password,
2143
 
   and applies any other security settings you may have
2144
 
   selected.
 
2023
   Wizard connects to the server, sets your new root password, and
 
2024
   applies any other security settings you may have selected.
2145
2025
 
2146
 
   After the MySQL Server Instance Configuration Wizard has
2147
 
   completed its tasks, it displays a summary. Click the Finish
2148
 
   button to exit the MySQL Server Configuration Wizard.
 
2026
   After the MySQL Server Instance Configuration Wizard has completed
 
2027
   its tasks, it displays a summary. Click the Finish button to exit
 
2028
   the MySQL Server Configuration Wizard.
2149
2029
 
2150
2030
2.3.5. Installing MySQL from a Noinstall Zip Archive
2151
2031
 
2152
 
   Users who are installing from the Noinstall package can use
2153
 
   the instructions in this section to manually install MySQL.
2154
 
   The process for installing MySQL from a Zip archive is as
2155
 
   follows:
 
2032
   Users who are installing from the Noinstall package can use the
 
2033
   instructions in this section to manually install MySQL. The
 
2034
   process for installing MySQL from a Zip archive is as follows:
2156
2035
 
2157
2036
    1. Extract the archive to the desired install directory
2158
2037
 
2170
2049
 
2171
2050
   To install MySQL manually, do the following:
2172
2051
 
2173
 
    1. If you are upgrading from a previous version please refer
2174
 
       to Section 2.3.14, "Upgrading MySQL on Windows," before
2175
 
       beginning the upgrade process.
 
2052
    1. If you are upgrading from a previous version please refer to
 
2053
       Section 2.3.14, "Upgrading MySQL on Windows," before beginning
 
2054
       the upgrade process.
2176
2055
 
2177
 
    2. Make sure that you are logged in as a user with
2178
 
       administrator privileges.
 
2056
    2. Make sure that you are logged in as a user with administrator
 
2057
       privileges.
2179
2058
 
2180
2059
    3. Choose an installation location. Traditionally, the MySQL
2181
 
       server is installed in C:\mysql. The MySQL Installation
2182
 
       Wizard installs MySQL under C:\Program Files\MySQL. If
2183
 
       you do not install MySQL at C:\mysql, you must specify
2184
 
       the path to the install directory during startup or in an
2185
 
       option file. See Section 2.3.7, "Creating an Option
2186
 
       File."
 
2060
       server is installed in C:\mysql. The MySQL Installation Wizard
 
2061
       installs MySQL under C:\Program Files\MySQL. If you do not
 
2062
       install MySQL at C:\mysql, you must specify the path to the
 
2063
       install directory during startup or in an option file. See
 
2064
       Section 2.3.7, "Creating an Option File."
2187
2065
 
2188
2066
    4. Extract the install archive to the chosen installation
2189
 
       location using your preferred Zip archive tool. Some
2190
 
       tools may extract the archive to a folder within your
2191
 
       chosen installation location. If this occurs, you can
2192
 
       move the contents of the subfolder into the chosen
2193
 
       installation location.
 
2067
       location using your preferred Zip archive tool. Some tools may
 
2068
       extract the archive to a folder within your chosen
 
2069
       installation location. If this occurs, you can move the
 
2070
       contents of the subfolder into the chosen installation
 
2071
       location.
2194
2072
 
2195
2073
2.3.7. Creating an Option File
2196
2074
 
2197
 
   If you need to specify startup options when you run the
2198
 
   server, you can indicate them on the command line or place
2199
 
   them in an option file. For options that are used every time
2200
 
   the server starts, you may find it most convenient to use an
2201
 
   option file to specify your MySQL configuration. This is
2202
 
   particularly true under the following circumstances:
2203
 
 
2204
 
     * The installation or data directory locations are
2205
 
       different from the default locations (C:\Program
2206
 
       Files\MySQL\MySQL Server 5.1 and C:\Program
2207
 
       Files\MySQL\MySQL Server 5.1\data).
2208
 
 
2209
 
     * You need to tune the server settings, such as memory,
2210
 
       cache, or InnoDB configuration information.
2211
 
 
2212
 
   When the MySQL server starts on Windows, it looks for options
2213
 
   in two files: the my.ini file in the Windows directory, and
2214
 
   the C:\my.cnf file. The Windows directory typically is named
2215
 
   something like C:\WINDOWS. You can determine its exact
2216
 
   location from the value of the WINDIR environment variable
2217
 
   using the following command:
 
2075
   If you need to specify startup options when you run the server,
 
2076
   you can indicate them on the command line or place them in an
 
2077
   option file. For options that are used every time the server
 
2078
   starts, you may find it most convenient to use an option file to
 
2079
   specify your MySQL configuration. This is particularly true under
 
2080
   the following circumstances:
 
2081
 
 
2082
     * The installation or data directory locations are different
 
2083
       from the default locations (C:\Program Files\MySQL\MySQL
 
2084
       Server 5.1 and C:\Program Files\MySQL\MySQL Server 5.1\data).
 
2085
 
 
2086
     * You need to tune the server settings, such as memory, cache,
 
2087
       or InnoDB configuration information.
 
2088
 
 
2089
   When the MySQL server starts on Windows, it looks for options in
 
2090
   two files: the my.ini file in the Windows directory, and the
 
2091
   C:\my.cnf file. The Windows directory typically is named something
 
2092
   like C:\WINDOWS. You can determine its exact location from the
 
2093
   value of the WINDIR environment variable using the following
 
2094
   command:
2218
2095
C:\> echo %WINDIR%
2219
2096
 
2220
 
   MySQL looks for options first in the my.ini file, and then in
2221
 
   the my.cnf file. However, to avoid confusion, it's best if
2222
 
   you use only one file. If your PC uses a boot loader where C:
2223
 
   is not the boot drive, your only option is to use the my.ini
2224
 
   file. Whichever option file you use, it must be a plain text
2225
 
   file.
2226
 
 
2227
 
   You can also make use of the example option files included
2228
 
   with your MySQL distribution; see Section 4.2.3.2.2,
2229
 
   "Preconfigured Option Files."
2230
 
 
2231
 
   An option file can be created and modified with any text
2232
 
   editor, such as Notepad. For example, if MySQL is installed
2233
 
   in E:\mysql and the data directory is in E:\mydata\data, you
2234
 
   can create an option file containing a [mysqld] section to
2235
 
   specify values for the basedir and datadir options:
 
2097
   MySQL looks for options first in the my.ini file, and then in the
 
2098
   my.cnf file. However, to avoid confusion, it is best if you use
 
2099
   only one file. If your PC uses a boot loader where C: is not the
 
2100
   boot drive, your only option is to use the my.ini file. Whichever
 
2101
   option file you use, it must be a plain text file.
 
2102
 
 
2103
   You can also make use of the example option files included with
 
2104
   your MySQL distribution; see Section 4.2.3.2.2, "Preconfigured
 
2105
   Option Files."
 
2106
 
 
2107
   An option file can be created and modified with any text editor,
 
2108
   such as Notepad. For example, if MySQL is installed in E:\mysql
 
2109
   and the data directory is in E:\mydata\data, you can create an
 
2110
   option file containing a [mysqld] section to specify values for
 
2111
   the basedir and datadir options:
2236
2112
[mysqld]
2237
2113
# set basedir to your installation path
2238
2114
basedir=E:/mysql
2239
2115
# set datadir to the location of your data directory
2240
2116
datadir=E:/mydata/data
2241
2117
 
2242
 
   Note that Windows pathnames are specified in option files
2243
 
   using (forward) slashes rather than backslashes. If you do
2244
 
   use backslashes, you must double them:
 
2118
   Note that Windows path names are specified in option files using
 
2119
   (forward) slashes rather than backslashes. If you do use
 
2120
   backslashes, you must double them:
2245
2121
[mysqld]
2246
2122
# set basedir to your installation path
2247
2123
basedir=E:\\mysql
2253
2129
   Enterprise Monitor. For more information, see
2254
2130
   http://www.mysql.com/products/enterprise/advisors.html.
2255
2131
 
2256
 
   In MySQL 5.1.23 and earlier, the MySQL installer places the
2257
 
   data directory directly under the directory where you install
2258
 
   MySQL. On MySQL 5.1.24 and later, the data directory is
2259
 
   located within the AppData directory for the user running
2260
 
   MySQL.
2261
 
 
2262
 
   If you would like to use a data directory in a different
2263
 
   location, you should copy the entire contents of the data
2264
 
   directory to the new location. For example, if you want to
2265
 
   use E:\mydata as the data directory instead, you must do two
2266
 
   things:
2267
 
 
2268
 
    1. Move the entire data directory and all of its contents
2269
 
       from the default location (for example C:\Program
2270
 
       Files\MySQL\MySQL Server 5.1\data) to E:\mydata.
 
2132
   In MySQL 5.1.23 and earlier, the MySQL installer places the data
 
2133
   directory directly under the directory where you install MySQL. On
 
2134
   MySQL 5.1.24 and later, the data directory is located within the
 
2135
   AppData directory for the user running MySQL.
 
2136
 
 
2137
   If you would like to use a data directory in a different location,
 
2138
   you should copy the entire contents of the data directory to the
 
2139
   new location. For example, if you want to use E:\mydata as the
 
2140
   data directory instead, you must do two things:
 
2141
 
 
2142
    1. Move the entire data directory and all of its contents from
 
2143
       the default location (for example C:\Program Files\MySQL\MySQL
 
2144
       Server 5.1\data) to E:\mydata.
2271
2145
 
2272
2146
    2. Use a --datadir option to specify the new data directory
2273
2147
       location each time you start the server.
2274
2148
 
2275
2149
2.3.8. Selecting a MySQL Server Type
2276
2150
 
2277
 
   The following table shows the available servers for Windows
2278
 
   in MySQL 5.1.20 and earlier.
 
2151
   The following table shows the available servers for Windows in
 
2152
   MySQL 5.1.20 and earlier.
2279
2153
   Binary Description
2280
2154
   mysqld-nt Optimized binary with named-pipe support
2281
2155
   mysqld Optimized binary without named-pipe support
2282
 
   mysqld-debug Like mysqld-nt, but compiled with full debugging
2283
 
   and automatic memory allocation checking
 
2156
   mysqld-debug Like mysqld-nt, but compiled with full debugging and
 
2157
   automatic memory allocation checking
2284
2158
 
2285
 
   The following table shows the available servers for Windows
2286
 
   in MySQL 5.1.21 and later.
 
2159
   The following table shows the available servers for Windows in
 
2160
   MySQL 5.1.21 and later.
2287
2161
   Binary Description
2288
2162
   mysqld Optimized binary with named-pipe support
2289
 
   mysqld-debug Like mysqld, but compiled with full debugging
2290
 
   and automatic memory allocation checking
 
2163
   mysqld-debug Like mysqld, but compiled with full debugging and
 
2164
   automatic memory allocation checking
2291
2165
 
2292
2166
   All of the preceding binaries are optimized for modern Intel
2293
2167
   processors, but should work on any Intel i386-class or higher
2294
2168
   processor.
2295
2169
 
2296
2170
   Each of the servers in a distribution support the same set of
2297
 
   storage engines. The SHOW ENGINES statement displays which
2298
 
   engines a given server supports.
2299
 
 
2300
 
   All Windows MySQL 5.1 servers have support for symbolic
2301
 
   linking of database directories.
2302
 
 
2303
 
   MySQL supports TCP/IP on all Windows platforms. MySQL servers
2304
 
   on Windows support named pipes as indicated in the following
2305
 
   list. However, the default is to use TCP/IP regardless of
2306
 
   platform. (Named pipes are slower than TCP/IP in many Windows
 
2171
   storage engines. The SHOW ENGINES statement displays which engines
 
2172
   a given server supports.
 
2173
 
 
2174
   All Windows MySQL 5.1 servers have support for symbolic linking of
 
2175
   database directories.
 
2176
 
 
2177
   MySQL supports TCP/IP on all Windows platforms. MySQL servers on
 
2178
   Windows support named pipes as indicated in the following list.
 
2179
   However, the default is to use TCP/IP regardless of platform.
 
2180
   (Named pipes are slower than TCP/IP in many Windows
2307
2181
   configurations.)
2308
2182
 
2309
2183
   Use of named pipes is subject to these conditions:
2310
2184
 
2311
 
     * Named pipes are enabled only if you start the server with
2312
 
       the --enable-named-pipe option. It is necessary to use
2313
 
       this option explicitly because some users have
2314
 
       experienced problems with shutting down the MySQL server
2315
 
       when named pipes were used.
 
2185
     * Named pipes are enabled only if you start the server with the
 
2186
       --enable-named-pipe option. It is necessary to use this option
 
2187
       explicitly because some users have experienced problems with
 
2188
       shutting down the MySQL server when named pipes were used.
2316
2189
 
2317
2190
     * For MySQL 5.1.20 and earlier, named-pipe connections are
2318
 
       allowed only by the mysqld-nt and mysqld-debug servers.
2319
 
       For MySQL 5.1.21 and later, the mysqld and mysqld-debug
2320
 
       servers both contain support for named-pipe connections.
 
2191
       allowed only by the mysqld-nt and mysqld-debug servers. For
 
2192
       MySQL 5.1.21 and later, the mysqld and mysqld-debug servers
 
2193
       both contain support for named-pipe connections.
2321
2194
 
2322
2195
Note
2323
2196
 
2324
 
   Most of the examples in this manual use mysqld as the server
2325
 
   name. If you choose to use a different server, such as
2326
 
   mysqld-nt or mysqld-debug, make the appropriate substitutions
2327
 
   in the commands that are shown in the examples.
 
2197
   Most of the examples in this manual use mysqld as the server name.
 
2198
   If you choose to use a different server, such as mysqld-nt or
 
2199
   mysqld-debug, make the appropriate substitutions in the commands
 
2200
   that are shown in the examples.
2328
2201
 
2329
2202
2.3.9. Starting the Server for the First Time
2330
2203
 
2331
2204
   This section gives a general overview of starting the MySQL
2332
 
   server. The following sections provide more specific
2333
 
   information for starting the MySQL server from the command
2334
 
   line or as a Windows service.
 
2205
   server. The following sections provide more specific information
 
2206
   for starting the MySQL server from the command line or as a
 
2207
   Windows service.
2335
2208
 
2336
2209
   The information here applies primarily if you installed MySQL
2337
 
   using the Noinstall version, or if you wish to configure and
2338
 
   test MySQL manually rather than with the GUI tools.
 
2210
   using the Noinstall version, or if you wish to configure and test
 
2211
   MySQL manually rather than with the GUI tools.
2339
2212
 
2340
2213
   The examples in these sections assume that MySQL is installed
2341
 
   under the default location of C:\Program Files\MySQL\MySQL
2342
 
   Server 5.1. Adjust the pathnames shown in the examples if you
2343
 
   have MySQL installed in a different location.
2344
 
 
2345
 
   Clients have two options. They can use TCP/IP, or they can
2346
 
   use a named pipe if the server supports named-pipe
2347
 
   connections.
2348
 
 
2349
 
   MySQL for Windows also supports shared-memory connections if
2350
 
   the server is started with the --shared-memory option.
2351
 
   Clients can connect through shared memory by using the
2352
 
   --protocol=MEMORY option.
 
2214
   under the default location of C:\Program Files\MySQL\MySQL Server
 
2215
   5.1. Adjust the path names shown in the examples if you have MySQL
 
2216
   installed in a different location.
 
2217
 
 
2218
   Clients have two options. They can use TCP/IP, or they can use a
 
2219
   named pipe if the server supports named-pipe connections.
 
2220
 
 
2221
   MySQL for Windows also supports shared-memory connections if the
 
2222
   server is started with the --shared-memory option. Clients can
 
2223
   connect through shared memory by using the --protocol=MEMORY
 
2224
   option.
2353
2225
 
2354
2226
   For information about which server binary to run, see Section
2355
2227
   2.3.8, "Selecting a MySQL Server Type."
2356
2228
 
2357
 
   Testing is best done from a command prompt in a console
2358
 
   window (or "DOS window"). In this way you can have the server
2359
 
   display status messages in the window where they are easy to
2360
 
   see. If something is wrong with your configuration, these
2361
 
   messages make it easier for you to identify and fix any
2362
 
   problems.
 
2229
   Testing is best done from a command prompt in a console window (or
 
2230
   "DOS window"). In this way you can have the server display status
 
2231
   messages in the window where they are easy to see. If something is
 
2232
   wrong with your configuration, these messages make it easier for
 
2233
   you to identify and fix any problems.
2363
2234
 
2364
2235
   To start the server, enter this command:
2365
2236
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --console
2366
2237
 
2367
2238
   For a server that includes InnoDB support, you should see the
2368
 
   messages similar to those following as it starts (the
2369
 
   pathnames and sizes may differ):
 
2239
   messages similar to those following as it starts (the path names
 
2240
   and sizes may differ):
2370
2241
InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
2371
2242
InnoDB: a new database to be created!
2372
2243
InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
2373
2244
InnoDB: Database physically writes the file full: wait...
2374
 
InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be create
2375
 
d
 
2245
InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be creat
 
2246
ed
2376
2247
InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
2377
 
InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be create
2378
 
d
 
2248
InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be creat
 
2249
ed
2379
2250
InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
2380
 
InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be create
2381
 
d
 
2251
InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be creat
 
2252
ed
2382
2253
InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
2383
2254
InnoDB: Doublewrite buffer not found: creating new
2384
2255
InnoDB: Doublewrite buffer created
2387
2258
011024 10:58:25  InnoDB: Started
2388
2259
 
2389
2260
   When the server finishes its startup sequence, you should see
2390
 
   something like this, which indicates that the server is ready
2391
 
   to service client connections:
 
2261
   something like this, which indicates that the server is ready to
 
2262
   service client connections:
2392
2263
mysqld: ready for connections
2393
 
Version: '5.1.31'  socket: ''  port: 3306
 
2264
Version: '5.1.35'  socket: ''  port: 3306
2394
2265
 
2395
2266
   The server continues to write to the console any further
2396
 
   diagnostic output it produces. You can open a new console
2397
 
   window in which to run client programs.
 
2267
   diagnostic output it produces. You can open a new console window
 
2268
   in which to run client programs.
2398
2269
 
2399
 
   If you omit the --console option, the server writes
2400
 
   diagnostic output to the error log in the data directory
2401
 
   (C:\Program Files\MySQL\MySQL Server 5.1\data by default).
2402
 
   The error log is the file with the .err extension.
 
2270
   If you omit the --console option, the server writes diagnostic
 
2271
   output to the error log in the data directory (C:\Program
 
2272
   Files\MySQL\MySQL Server 5.1\data by default). The error log is
 
2273
   the file with the .err extension.
2403
2274
 
2404
2275
Note
2405
2276
 
2406
 
   The accounts that are listed in the MySQL grant tables
2407
 
   initially have no passwords. After starting the server, you
2408
 
   should set up passwords for them using the instructions in
2409
 
   Section 2.11, "Post-Installation Setup and Testing."
 
2277
   The accounts that are listed in the MySQL grant tables initially
 
2278
   have no passwords. After starting the server, you should set up
 
2279
   passwords for them using the instructions in Section 2.11,
 
2280
   "Post-Installation Setup and Testing."
2410
2281
 
2411
2282
2.3.10. Starting MySQL from the Windows Command Line
2412
2283
 
2413
 
   The MySQL server can be started manually from the command
2414
 
   line. This can be done on any version of Windows.
 
2284
   The MySQL server can be started manually from the command line.
 
2285
   This can be done on any version of Windows.
2415
2286
 
2416
 
   To start the mysqld server from the command line, you should
2417
 
   start a console window (or "DOS window") and enter this
2418
 
   command:
 
2287
   To start the mysqld server from the command line, you should start
 
2288
   a console window (or "DOS window") and enter this command:
2419
2289
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld"
2420
2290
 
2421
 
   The path to mysqld may vary depending on the install location
2422
 
   of MySQL on your system.
 
2291
   The path to mysqld may vary depending on the install location of
 
2292
   MySQL on your system.
2423
2293
 
2424
2294
   You can stop the MySQL server by executing this command:
2425
2295
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" -u root
2426
 
shutdown
 
2296
 shutdown
2427
2297
 
2428
2298
Note
2429
2299
 
2430
 
   If the MySQL root user account has a password, you need to
2431
 
   invoke mysqladmin with the -p option and supply the password
2432
 
   when prompted.
2433
 
 
2434
 
   This command invokes the MySQL administrative utility
2435
 
   mysqladmin to connect to the server and tell it to shut down.
2436
 
   The command connects as the MySQL root user, which is the
2437
 
   default administrative account in the MySQL grant system.
2438
 
   Note that users in the MySQL grant system are wholly
2439
 
   independent from any login users under Windows.
2440
 
 
2441
 
   If mysqld doesn't start, check the error log to see whether
2442
 
   the server wrote any messages there to indicate the cause of
2443
 
   the problem. The error log is located in the C:\Program
2444
 
   Files\MySQL\MySQL Server 5.1\data directory. It is the file
2445
 
   with a suffix of .err. You can also try to start the server
2446
 
   as mysqld --console; in this case, you may get some useful
2447
 
   information on the screen that may help solve the problem.
 
2300
   If the MySQL root user account has a password, you need to invoke
 
2301
   mysqladmin with the -p option and supply the password when
 
2302
   prompted.
 
2303
 
 
2304
   This command invokes the MySQL administrative utility mysqladmin
 
2305
   to connect to the server and tell it to shut down. The command
 
2306
   connects as the MySQL root user, which is the default
 
2307
   administrative account in the MySQL grant system. Note that users
 
2308
   in the MySQL grant system are wholly independent from any login
 
2309
   users under Windows.
 
2310
 
 
2311
   If mysqld doesn't start, check the error log to see whether the
 
2312
   server wrote any messages there to indicate the cause of the
 
2313
   problem. The error log is located in the C:\Program
 
2314
   Files\MySQL\MySQL Server 5.1\data directory. It is the file with a
 
2315
   suffix of .err. You can also try to start the server as mysqld
 
2316
   --console; in this case, you may get some useful information on
 
2317
   the screen that may help solve the problem.
2448
2318
 
2449
2319
   The last option is to start mysqld with the --standalone and
2450
2320
   --debug options. In this case, mysqld writes a log file
2451
 
   C:\mysqld.trace that should contain the reason why mysqld
2452
 
   doesn't start. See MySQL Internals: Porting
 
2321
   C:\mysqld.trace that should contain the reason why mysqld doesn't
 
2322
   start. See MySQL Internals: Porting
2453
2323
   (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
2454
2324
 
2455
 
   Use mysqld --verbose --help to display all the options that
2456
 
   mysqld understands.
 
2325
   Use mysqld --verbose --help to display all the options that mysqld
 
2326
   understands.
2457
2327
 
2458
2328
2.3.11. Starting MySQL as a Windows Service
2459
2329
 
2460
 
   On Windows, the recommended way to run MySQL is to install it
2461
 
   as a Windows service, whereby MySQL starts and stops
2462
 
   automatically when Windows starts and stops. A MySQL server
2463
 
   installed as a service can also be controlled from the
2464
 
   command line using NET commands, or with the graphical
2465
 
   Services utility. Generally, to install MySQL as a Windows
2466
 
   service you should be logged in using an account that has
2467
 
   administrator rights.
2468
 
 
2469
 
   The Services utility (the Windows Service Control Manager)
2470
 
   can be found in the Windows Control Panel (under
2471
 
   Administrative Tools on Windows 2000, XP, Vista and Server
2472
 
   2003). To avoid conflicts, it is advisable to close the
2473
 
   Services utility while performing server installation or
2474
 
   removal operations from the command line.
2475
 
 
2476
 
   Before installing MySQL as a Windows service, you should
2477
 
   first stop the current server if it is running by using the
2478
 
   following command:
 
2330
   On Windows, the recommended way to run MySQL is to install it as a
 
2331
   Windows service, whereby MySQL starts and stops automatically when
 
2332
   Windows starts and stops. A MySQL server installed as a service
 
2333
   can also be controlled from the command line using NET commands,
 
2334
   or with the graphical Services utility. Generally, to install
 
2335
   MySQL as a Windows service you should be logged in using an
 
2336
   account that has administrator rights.
 
2337
 
 
2338
   The Services utility (the Windows Service Control Manager) can be
 
2339
   found in the Windows Control Panel (under Administrative Tools on
 
2340
   Windows 2000, XP, Vista and Server 2003). To avoid conflicts, it
 
2341
   is advisable to close the Services utility while performing server
 
2342
   installation or removal operations from the command line.
 
2343
 
 
2344
   Before installing MySQL as a Windows service, you should first
 
2345
   stop the current server if it is running by using the following
 
2346
   command:
2479
2347
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin"
2480
2348
          -u root shutdown
2481
2349
 
2482
2350
Note
2483
2351
 
2484
 
   If the MySQL root user account has a password, you need to
2485
 
   invoke mysqladmin with the -p option and supply the password
2486
 
   when prompted.
 
2352
   If the MySQL root user account has a password, you need to invoke
 
2353
   mysqladmin with the -p option and supply the password when
 
2354
   prompted.
2487
2355
 
2488
 
   This command invokes the MySQL administrative utility
2489
 
   mysqladmin to connect to the server and tell it to shut down.
2490
 
   The command connects as the MySQL root user, which is the
2491
 
   default administrative account in the MySQL grant system.
2492
 
   Note that users in the MySQL grant system are wholly
2493
 
   independent from any login users under Windows.
 
2356
   This command invokes the MySQL administrative utility mysqladmin
 
2357
   to connect to the server and tell it to shut down. The command
 
2358
   connects as the MySQL root user, which is the default
 
2359
   administrative account in the MySQL grant system. Note that users
 
2360
   in the MySQL grant system are wholly independent from any login
 
2361
   users under Windows.
2494
2362
 
2495
2363
   Install the server as a service using this command:
2496
2364
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install
2498
2366
   The service-installation command does not start the server.
2499
2367
   Instructions for that are given later in this section.
2500
2368
 
2501
 
   To make it easier to invoke MySQL programs, you can add the
2502
 
   pathname of the MySQL bin directory to your Windows system
2503
 
   PATH environment variable:
2504
 
 
2505
 
     * On the Windows desktop, right-click on the My Computer
2506
 
       icon, and select Properties
2507
 
 
2508
 
     * Next select the Advanced tab from the System Properties
2509
 
       menu that appears, and click the Environment Variables
2510
 
       button.
2511
 
 
2512
 
     * Under System Variables, select Path, and then click the
2513
 
       Edit button. The Edit System Variable dialogue should
2514
 
       appear.
 
2369
   To make it easier to invoke MySQL programs, you can add the path
 
2370
   name of the MySQL bin directory to your Windows system PATH
 
2371
   environment variable:
 
2372
 
 
2373
     * On the Windows desktop, right-click on the My Computer icon,
 
2374
       and select Properties.
 
2375
 
 
2376
     * Next select the Advanced tab from the System Properties menu
 
2377
       that appears, and click the Environment Variables button.
 
2378
 
 
2379
     * Under System Variables, select Path, and then click the Edit
 
2380
       button. The Edit System Variable dialogue should appear.
2515
2381
 
2516
2382
     * Place your cursor at the end of the text appearing in the
2517
 
       space marked Variable Value. (Use the End key to ensure
2518
 
       that your cursor is positioned at the very end of the
2519
 
       text in this space.) Then enter the complete pathname of
2520
 
       your MySQL bin directory (for example, C:\Program
2521
 
       Files\MySQL\MySQL Server 5.1\bin), Note that there should
2522
 
       be a semicolon separating this path from any values
2523
 
       present in this field. Dismiss this dialogue, and each
2524
 
       dialogue in turn, by clicking OK until all of the
2525
 
       dialogues that were opened have been dismissed. You
2526
 
       should now be able to invoke any MySQL executable program
2527
 
       by typing its name at the DOS prompt from any directory
2528
 
       on the system, without having to supply the path. This
2529
 
       includes the servers, the mysql client, and all MySQL
2530
 
       command-line utilities such as mysqladmin and mysqldump.
2531
 
       You should not add the MySQL bin directory to your
2532
 
       Windows PATH if you are running multiple MySQL servers on
2533
 
       the same machine.
 
2383
       space marked Variable Value. (Use the End key to ensure that
 
2384
       your cursor is positioned at the very end of the text in this
 
2385
       space.) Then enter the complete path name of your MySQL bin
 
2386
       directory (for example, C:\Program Files\MySQL\MySQL Server
 
2387
       5.1\bin), Note that there should be a semicolon separating
 
2388
       this path from any values present in this field. Dismiss this
 
2389
       dialogue, and each dialogue in turn, by clicking OK until all
 
2390
       of the dialogues that were opened have been dismissed. You
 
2391
       should now be able to invoke any MySQL executable program by
 
2392
       typing its name at the DOS prompt from any directory on the
 
2393
       system, without having to supply the path. This includes the
 
2394
       servers, the mysql client, and all MySQL command-line
 
2395
       utilities such as mysqladmin and mysqldump.
 
2396
       You should not add the MySQL bin directory to your Windows
 
2397
       PATH if you are running multiple MySQL servers on the same
 
2398
       machine.
2534
2399
 
2535
2400
Warning
2536
2401
 
2537
2402
   You must exercise great care when editing your system PATH by
2538
 
   hand; accidental deletion or modification of any portion of
2539
 
   the existing PATH value can leave you with a malfunctioning
2540
 
   or even unusable system.
 
2403
   hand; accidental deletion or modification of any portion of the
 
2404
   existing PATH value can leave you with a malfunctioning or even
 
2405
   unusable system.
2541
2406
 
2542
 
   The following additional arguments can be used in MySQL 5.1
2543
 
   when installing the service:
 
2407
   The following additional arguments can be used in MySQL 5.1 when
 
2408
   installing the service:
2544
2409
 
2545
2410
     * You can specify a service name immediately following the
2546
2411
       --install option. The default service name is MySQL.
2547
2412
 
2548
 
     * If a service name is given, it can be followed by a
2549
 
       single option. By convention, this should be
2550
 
       --defaults-file=file_name to specify the name of an
2551
 
       option file from which the server should read options
2552
 
       when it starts.
 
2413
     * If a service name is given, it can be followed by a single
 
2414
       option. By convention, this should be
 
2415
       --defaults-file=file_name to specify the name of an option
 
2416
       file from which the server should read options when it starts.
2553
2417
       The use of a single option other than --defaults-file is
2554
 
       possible but discouraged. --defaults-file is more
2555
 
       flexible because it enables you to specify multiple
2556
 
       startup options for the server by placing them in the
2557
 
       named option file.
 
2418
       possible but discouraged. --defaults-file is more flexible
 
2419
       because it enables you to specify multiple startup options for
 
2420
       the server by placing them in the named option file.
2558
2421
 
2559
 
     * You can also specify a --local-service option following
2560
 
       the service name. This causes the server to run using the
 
2422
     * You can also specify a --local-service option following the
 
2423
       service name. This causes the server to run using the
2561
2424
       LocalService Windows account that has limited system
2562
 
       privileges. This account is available only for Windows XP
2563
 
       or newer. If both --defaults-file and --local-service are
2564
 
       given following the service name, they can be in any
2565
 
       order.
2566
 
 
2567
 
   For a MySQL server that is installed as a Windows service,
2568
 
   the following rules determine the service name and option
2569
 
   files that the server uses:
2570
 
 
2571
 
     * If the service-installation command specifies no service
2572
 
       name or the default service name (MySQL) following the
2573
 
       --install option, the server uses the a service name of
2574
 
       MySQL and reads options from the [mysqld] group in the
2575
 
       standard option files.
2576
 
 
2577
 
     * If the service-installation command specifies a service
2578
 
       name other than MySQL following the --install option, the
2579
 
       server uses that service name. It reads options from the
2580
 
       [mysqld] group and the group that has the same name as
2581
 
       the service in the standard option files. This allows you
2582
 
       to use the [mysqld] group for options that should be used
2583
 
       by all MySQL services, and an option group with the
2584
 
       service name for use by the server installed with that
2585
 
       service name.
 
2425
       privileges. This account is available only for Windows XP or
 
2426
       newer. If both --defaults-file and --local-service are given
 
2427
       following the service name, they can be in any order.
 
2428
 
 
2429
   For a MySQL server that is installed as a Windows service, the
 
2430
   following rules determine the service name and option files that
 
2431
   the server uses:
 
2432
 
 
2433
     * If the service-installation command specifies no service name
 
2434
       or the default service name (MySQL) following the --install
 
2435
       option, the server uses the a service name of MySQL and reads
 
2436
       options from the [mysqld] group in the standard option files.
 
2437
 
 
2438
     * If the service-installation command specifies a service name
 
2439
       other than MySQL following the --install option, the server
 
2440
       uses that service name. It reads options from the [mysqld]
 
2441
       group and the group that has the same name as the service in
 
2442
       the standard option files. This allows you to use the [mysqld]
 
2443
       group for options that should be used by all MySQL services,
 
2444
       and an option group with the service name for use by the
 
2445
       server installed with that service name.
2586
2446
 
2587
2447
     * If the service-installation command specifies a
2588
2448
       --defaults-file option after the service name, the server
2589
 
       reads options only from the [mysqld] group of the named
2590
 
       file and ignores the standard option files.
 
2449
       reads options only from the [mysqld] group of the named file
 
2450
       and ignores the standard option files.
2591
2451
 
2592
2452
   As a more complex example, consider the following command:
2593
2453
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld"
2594
2454
          --install MySQL --defaults-file=C:\my-opts.cnf
2595
2455
 
2596
2456
   Here, the default service name (MySQL) is given after the
2597
 
   --install option. If no --defaults-file option had been
2598
 
   given, this command would have the effect of causing the
2599
 
   server to read the [mysqld] group from the standard option
2600
 
   files. However, because the --defaults-file option is
2601
 
   present, the server reads options from the [mysqld] option
2602
 
   group, and only from the named file.
 
2457
   --install option. If no --defaults-file option had been given,
 
2458
   this command would have the effect of causing the server to read
 
2459
   the [mysqld] group from the standard option files. However,
 
2460
   because the --defaults-file option is present, the server reads
 
2461
   options from the [mysqld] option group, and only from the named
 
2462
   file.
2603
2463
 
2604
 
   You can also specify options as Start parameters in the
2605
 
   Windows Services utility before you start the MySQL service.
 
2464
   You can also specify options as Start parameters in the Windows
 
2465
   Services utility before you start the MySQL service.
2606
2466
 
2607
2467
   Once a MySQL server has been installed as a service, Windows
2608
2468
   starts the service automatically whenever Windows starts. The
2609
 
   service also can be started immediately from the Services
2610
 
   utility, or by using a NET START MySQL command. The NET
2611
 
   command is not case sensitive.
 
2469
   service also can be started immediately from the Services utility,
 
2470
   or by using a NET START MySQL command. The NET command is not case
 
2471
   sensitive.
2612
2472
 
2613
 
   When run as a service, mysqld has no access to a console
2614
 
   window, so no messages can be seen there. If mysqld does not
2615
 
   start, check the error log to see whether the server wrote
2616
 
   any messages there to indicate the cause of the problem. The
2617
 
   error log is located in the MySQL data directory (for
2618
 
   example, C:\Program Files\MySQL\MySQL Server 5.1\data). It is
2619
 
   the file with a suffix of .err.
 
2473
   When run as a service, mysqld has no access to a console window,
 
2474
   so no messages can be seen there. If mysqld does not start, check
 
2475
   the error log to see whether the server wrote any messages there
 
2476
   to indicate the cause of the problem. The error log is located in
 
2477
   the MySQL data directory (for example, C:\Program
 
2478
   Files\MySQL\MySQL Server 5.1\data). It is the file with a suffix
 
2479
   of .err.
2620
2480
 
2621
2481
   When a MySQL server has been installed as a service, and the
2622
 
   service is running, Windows stops the service automatically
2623
 
   when Windows shuts down. The server also can be stopped
2624
 
   manually by using the Services utility, the NET STOP MySQL
2625
 
   command, or the mysqladmin shutdown command.
 
2482
   service is running, Windows stops the service automatically when
 
2483
   Windows shuts down. The server also can be stopped manually by
 
2484
   using the Services utility, the NET STOP MySQL command, or the
 
2485
   mysqladmin shutdown command.
2626
2486
 
2627
2487
   You also have the choice of installing the server as a manual
2628
2488
   service if you do not wish for the service to be started
2629
2489
   automatically during the boot process. To do this, use the
2630
2490
   --install-manual option rather than the --install option:
2631
 
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install-ma
2632
 
nual
 
2491
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install-m
 
2492
anual
2633
2493
 
2634
 
   To remove a server that is installed as a service, first stop
2635
 
   it if it is running by executing NET STOP MySQL. Then use the
 
2494
   To remove a server that is installed as a service, first stop it
 
2495
   if it is running by executing NET STOP MySQL. Then use the
2636
2496
   --remove option to remove it:
2637
2497
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --remove
2638
2498
 
2639
 
   If mysqld is not running as a service, you can start it from
2640
 
   the command line. For instructions, see Section 2.3.10,
2641
 
   "Starting MySQL from the Windows Command Line."
 
2499
   If mysqld is not running as a service, you can start it from the
 
2500
   command line. For instructions, see Section 2.3.10, "Starting
 
2501
   MySQL from the Windows Command Line."
2642
2502
 
2643
 
   Please see Section 2.3.13, "Troubleshooting a MySQL
2644
 
   Installation Under Windows," if you encounter difficulties
2645
 
   during installation.
 
2503
   Please see Section 2.3.13, "Troubleshooting a MySQL Installation
 
2504
   Under Windows," if you encounter difficulties during installation.
2646
2505
 
2647
2506
2.3.12. Testing The MySQL Installation
2648
2507
 
2649
 
   You can test whether the MySQL server is working by executing
2650
 
   any of the following commands:
 
2508
   You can test whether the MySQL server is working by executing any
 
2509
   of the following commands:
2651
2510
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlshow"
2652
 
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlshow" -u root m
2653
 
ysql
 
2511
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlshow" -u root
 
2512
mysql
2654
2513
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" version
2655
 
status proc
 
2514
 status proc
2656
2515
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql" test
2657
2516
 
2658
 
   If mysqld is slow to respond to TCP/IP connections from
2659
 
   client programs, there is probably a problem with your DNS.
2660
 
   In this case, start mysqld with the --skip-name-resolve
2661
 
   option and use only localhost and IP numbers in the Host
2662
 
   column of the MySQL grant tables.
2663
 
 
2664
 
   You can force a MySQL client to use a named-pipe connection
2665
 
   rather than TCP/IP by specifying the --pipe or
2666
 
   --protocol=PIPE option, or by specifying . (period) as the
2667
 
   host name. Use the --socket option to specify the name of the
2668
 
   pipe if you do not want to use the default pipe name.
2669
 
 
2670
 
   Note that if you have set a password for the root account,
2671
 
   deleted the anonymous account, or created a new user account,
2672
 
   then you must use the appropriate -u and -p options with the
2673
 
   commands shown above in order to connect with the MySQL
2674
 
   Server. See Section 4.2.2, "Connecting to the MySQL Server."
 
2517
   If mysqld is slow to respond to TCP/IP connections from client
 
2518
   programs, there is probably a problem with your DNS. In this case,
 
2519
   start mysqld with the --skip-name-resolve option and use only
 
2520
   localhost and IP numbers in the Host column of the MySQL grant
 
2521
   tables.
 
2522
 
 
2523
   You can force a MySQL client to use a named-pipe connection rather
 
2524
   than TCP/IP by specifying the --pipe or --protocol=PIPE option, or
 
2525
   by specifying . (period) as the host name. Use the --socket option
 
2526
   to specify the name of the pipe if you do not want to use the
 
2527
   default pipe name.
 
2528
 
 
2529
   Note that if you have set a password for the root account, deleted
 
2530
   the anonymous account, or created a new user account, then you
 
2531
   must use the appropriate -u and -p options with the commands shown
 
2532
   above in order to connect with the MySQL Server. See Section
 
2533
   4.2.2, "Connecting to the MySQL Server."
2675
2534
 
2676
2535
   For more information about mysqlshow, see Section 4.5.6,
2677
 
   "mysqlshow --- Display Database, Table, and Column
2678
 
   Information."
 
2536
   "mysqlshow --- Display Database, Table, and Column Information."
2679
2537
 
2680
2538
2.3.13. Troubleshooting a MySQL Installation Under Windows
2681
2539
 
2682
2540
   When installing and running MySQL for the first time, you may
2683
2541
   encounter certain errors that prevent the MySQL server from
2684
 
   starting. The purpose of this section is to help you diagnose
2685
 
   and correct some of these errors.
 
2542
   starting. The purpose of this section is to help you diagnose and
 
2543
   correct some of these errors.
2686
2544
 
2687
2545
   Your first resource when troubleshooting server issues is the
2688
2546
   error log. The MySQL server uses the error log to record
2689
 
   information relevant to the error that prevents the server
2690
 
   from starting. The error log is located in the data directory
2691
 
   specified in your my.ini file. The default data directory
2692
 
   location is C:\Program Files\MySQL\MySQL Server 5.1\data. See
2693
 
   Section 5.2.2, "The Error Log."
2694
 
 
2695
 
   Another source of information regarding possible errors is
2696
 
   the console messages displayed when the MySQL service is
2697
 
   starting. Use the NET START MySQL command from the command
2698
 
   line after installing mysqld as a service to see any error
2699
 
   messages regarding the starting of the MySQL server as a
2700
 
   service. See Section 2.3.11, "Starting MySQL as a Windows
2701
 
   Service."
2702
 
 
2703
 
   The following examples show other common error messages you
2704
 
   may encounter when installing MySQL and starting the server
2705
 
   for the first time:
2706
 
 
2707
 
     * If the MySQL server cannot find the mysql privileges
2708
 
       database or other critical files, you may see these
2709
 
       messages:
 
2547
   information relevant to the error that prevents the server from
 
2548
   starting. The error log is located in the data directory specified
 
2549
   in your my.ini file. The default data directory location is
 
2550
   C:\Program Files\MySQL\MySQL Server 5.1\data. See Section 5.2.2,
 
2551
   "The Error Log."
 
2552
 
 
2553
   Another source of information regarding possible errors is the
 
2554
   console messages displayed when the MySQL service is starting. Use
 
2555
   the NET START MySQL command from the command line after installing
 
2556
   mysqld as a service to see any error messages regarding the
 
2557
   starting of the MySQL server as a service. See Section 2.3.11,
 
2558
   "Starting MySQL as a Windows Service."
 
2559
 
 
2560
   The following examples show other common error messages you may
 
2561
   encounter when installing MySQL and starting the server for the
 
2562
   first time:
 
2563
 
 
2564
     * If the MySQL server cannot find the mysql privileges database
 
2565
       or other critical files, you may see these messages:
2710
2566
System error 1067 has occurred.
2711
 
Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't e
2712
 
xist
2713
 
 
 
2567
Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't
 
2568
exist
2714
2569
       These messages often occur when the MySQL base or data
2715
2570
       directories are installed in different locations than the
2716
 
       default locations (C:\Program Files\MySQL\MySQL Server
2717
 
       5.1 and C:\Program Files\MySQL\MySQL Server 5.1\data,
2718
 
       respectively).
2719
 
       This situation may occur when MySQL is upgraded and
2720
 
       installed to a new location, but the configuration file
2721
 
       is not updated to reflect the new location. In addition,
2722
 
       there may be old and new configuration files that
2723
 
       conflict. Be sure to delete or rename any old
2724
 
       configuration files when upgrading MySQL.
 
2571
       default locations (C:\Program Files\MySQL\MySQL Server 5.1 and
 
2572
       C:\Program Files\MySQL\MySQL Server 5.1\data, respectively).
 
2573
       This situation may occur when MySQL is upgraded and installed
 
2574
       to a new location, but the configuration file is not updated
 
2575
       to reflect the new location. In addition, there may be old and
 
2576
       new configuration files that conflict. Be sure to delete or
 
2577
       rename any old configuration files when upgrading MySQL.
2725
2578
       If you have installed MySQL to a directory other than
2726
 
       C:\Program Files\MySQL\MySQL Server 5.1, you need to
2727
 
       ensure that the MySQL server is aware of this through the
2728
 
       use of a configuration (my.ini) file. The my.ini file
2729
 
       needs to be located in your Windows directory, typically
2730
 
       C:\WINDOWS. You can determine its exact location from the
2731
 
       value of the WINDIR environment variable by issuing the
2732
 
       following command from the command prompt:
 
2579
       C:\Program Files\MySQL\MySQL Server 5.1, you need to ensure
 
2580
       that the MySQL server is aware of this through the use of a
 
2581
       configuration (my.ini) file. The my.ini file needs to be
 
2582
       located in your Windows directory, typically C:\WINDOWS. You
 
2583
       can determine its exact location from the value of the WINDIR
 
2584
       environment variable by issuing the following command from the
 
2585
       command prompt:
2733
2586
C:\> echo %WINDIR%
2734
 
 
2735
2587
       An option file can be created and modified with any text
2736
 
       editor, such as Notepad. For example, if MySQL is
2737
 
       installed in E:\mysql and the data directory is
2738
 
       D:\MySQLdata, you can create the option file and set up a
2739
 
       [mysqld] section to specify values for the basedir and
2740
 
       datadir options:
 
2588
       editor, such as Notepad. For example, if MySQL is installed in
 
2589
       E:\mysql and the data directory is D:\MySQLdata, you can
 
2590
       create the option file and set up a [mysqld] section to
 
2591
       specify values for the basedir and datadir options:
2741
2592
[mysqld]
2742
2593
# set basedir to your installation path
2743
2594
basedir=E:/mysql
2744
2595
# set datadir to the location of your data directory
2745
2596
datadir=D:/MySQLdata
2746
 
 
2747
 
       Note that Windows pathnames are specified in option files
2748
 
       using (forward) slashes rather than backslashes. If you
2749
 
       do use backslashes, you must double them:
 
2597
       Note that Windows path names are specified in option files
 
2598
       using (forward) slashes rather than backslashes. If you do use
 
2599
       backslashes, you must double them:
2750
2600
[mysqld]
2751
2601
# set basedir to your installation path
2752
2602
basedir=C:\\Program Files\\MySQL\\MySQL Server 5.1
2753
2603
# set datadir to the location of your data directory
2754
2604
datadir=D:\\MySQLdata
2755
 
 
2756
 
       If you change the datadir value in your MySQL
2757
 
       configuration file, you must move the contents of the
2758
 
       existing MySQL data directory before restarting the MySQL
2759
 
       server.
 
2605
       If you change the datadir value in your MySQL configuration
 
2606
       file, you must move the contents of the existing MySQL data
 
2607
       directory before restarting the MySQL server.
2760
2608
       See Section 2.3.7, "Creating an Option File."
2761
2609
 
2762
 
     * If you reinstall or upgrade MySQL without first stopping
2763
 
       and removing the existing MySQL service and install MySQL
2764
 
       using the MySQL Configuration Wizard, you may see this
2765
 
       error:
 
2610
     * If you reinstall or upgrade MySQL without first stopping and
 
2611
       removing the existing MySQL service and install MySQL using
 
2612
       the MySQL Configuration Wizard, you may see this error:
2766
2613
Error: Cannot create Windows service for MySql. Error: 0
2767
 
 
2768
 
       This occurs when the Configuration Wizard tries to
2769
 
       install the service and finds an existing service with
2770
 
       the same name.
2771
 
       One solution to this problem is to choose a service name
2772
 
       other than mysql when using the configuration wizard.
2773
 
       This allows the new service to be installed correctly,
2774
 
       but leaves the outdated service in place. Although this
2775
 
       is harmless, it is best to remove old services that are
2776
 
       no longer in use.
 
2614
       This occurs when the Configuration Wizard tries to install the
 
2615
       service and finds an existing service with the same name.
 
2616
       One solution to this problem is to choose a service name other
 
2617
       than mysql when using the configuration wizard. This allows
 
2618
       the new service to be installed correctly, but leaves the
 
2619
       outdated service in place. Although this is harmless, it is
 
2620
       best to remove old services that are no longer in use.
2777
2621
       To permanently remove the old mysql service, execute the
2778
 
       following command as a user with administrative
2779
 
       privileges, on the command-line:
 
2622
       following command as a user with administrative privileges, on
 
2623
       the command-line:
2780
2624
C:\> sc delete mysql
2781
2625
[SC] DeleteService SUCCESS
2782
 
 
2783
2626
       If the sc utility is not available for your version of
2784
2627
       Windows, download the delsrv utility from
2785
 
       http://www.microsoft.com/windows2000/techinfo/reskit/tool
2786
 
       s/existing/delsrv-o.asp and use the delsrv mysql syntax.
 
2628
       http://www.microsoft.com/windows2000/techinfo/reskit/tools/exi
 
2629
       sting/delsrv-o.asp and use the delsrv mysql syntax.
2787
2630
 
2788
2631
2.3.14. Upgrading MySQL on Windows
2789
2632
 
2790
2633
   This section lists some of the steps you should take when
2791
2634
   upgrading MySQL on Windows.
2792
2635
 
2793
 
    1. Review Section 2.12, "Upgrading MySQL," for additional
 
2636
    1. Review Section 2.12.1, "Upgrading MySQL," for additional
2794
2637
       information on upgrading MySQL that is not specific to
2795
2638
       Windows.
2796
2639
 
2802
2645
       http://dev.mysql.com/downloads/.
2803
2646
 
2804
2647
    4. Before upgrading MySQL, you must stop the server. If the
2805
 
       server is installed as a service, stop the service with
2806
 
       the following command from the command prompt:
 
2648
       server is installed as a service, stop the service with the
 
2649
       following command from the command prompt:
2807
2650
C:\> NET STOP MySQL
2808
 
 
2809
 
       If you are not running the MySQL server as a service, use
2810
 
       the following command to stop it:
 
2651
       If you are not running the MySQL server as a service, use the
 
2652
       following command to stop it:
2811
2653
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" -u root
2812
 
shutdown
 
2654
 shutdown
2813
2655
 
2814
2656
Note
2815
 
       If the MySQL root user account has a password, you need
2816
 
       to invoke mysqladmin with the -p option and supply the
2817
 
       password when prompted.
 
2657
       If the MySQL root user account has a password, you need to
 
2658
       invoke mysqladmin with the -p option and supply the password
 
2659
       when prompted.
2818
2660
 
2819
 
    5. When upgrading to MySQL 5.1 from a version previous to
2820
 
       4.1.5, or when upgrading from a version of MySQL
2821
 
       installed from a Zip archive to a version of MySQL
2822
 
       installed with the MySQL Installation Wizard, you must
2823
 
       manually remove the previous installation and MySQL
2824
 
       service (if the server is installed as a service).
 
2661
    5. When upgrading to MySQL 5.1 from a version previous to 4.1.5,
 
2662
       or when upgrading from a version of MySQL installed from a Zip
 
2663
       archive to a version of MySQL installed with the MySQL
 
2664
       Installation Wizard, you must manually remove the previous
 
2665
       installation and MySQL service (if the server is installed as
 
2666
       a service).
2825
2667
       To remove the MySQL service, use the following command:
2826
2668
C:\> C:\mysql\bin\mysqld --remove
2827
 
 
2828
2669
       If you do not remove the existing service, the MySQL
2829
 
       Installation Wizard may fail to properly install the new
2830
 
       MySQL service.
 
2670
       Installation Wizard may fail to properly install the new MySQL
 
2671
       service.
2831
2672
 
2832
 
    6. When upgrading from MySQL 5.1.23 to MySQL 5.1.24, the
2833
 
       change in the default location of the data directory from
2834
 
       a directory within the MySQL installation to the AppData
2835
 
       folder means that you must manually copy the data files
2836
 
       from your old installation to the new location.
 
2673
    6. When upgrading from MySQL 5.1.23 to MySQL 5.1.24, the change
 
2674
       in the default location of the data directory from a directory
 
2675
       within the MySQL installation to the AppData folder means that
 
2676
       you must manually copy the data files from your old
 
2677
       installation to the new location.
2837
2678
 
2838
2679
    7. If you are using the MySQL Installation Wizard, start the
2839
2680
       wizard as described in Section 2.3.3, "Using the MySQL
2840
2681
       Installation Wizard."
2841
2682
 
2842
 
    8. If you are installing MySQL from a Zip archive, extract
2843
 
       the archive. You may either overwrite your existing MySQL
2844
 
       installation (usually located at C:\mysql), or install it
2845
 
       into a different directory, such as C:\mysql5.
2846
 
       Overwriting the existing installation is recommended.
 
2683
    8. If you are installing MySQL from a Zip archive, extract the
 
2684
       archive. You may either overwrite your existing MySQL
 
2685
       installation (usually located at C:\mysql), or install it into
 
2686
       a different directory, such as C:\mysql5. Overwriting the
 
2687
       existing installation is recommended.
2847
2688
 
2848
 
    9. If you were running MySQL as a Windows service and you
2849
 
       had to remove the service earlier in this procedure,
2850
 
       reinstall the service. (See Section 2.3.11, "Starting
2851
 
       MySQL as a Windows Service.")
2852
 
   10. Restart the server. For example, use NET START MySQL if
2853
 
       you run MySQL as a service, or invoke mysqld directly
2854
 
       otherwise.
2855
 
   11. If you encounter errors, see Section 2.3.13,
2856
 
       "Troubleshooting a MySQL Installation Under Windows."
 
2689
    9. If you were running MySQL as a Windows service and you had to
 
2690
       remove the service earlier in this procedure, reinstall the
 
2691
       service. (See Section 2.3.11, "Starting MySQL as a Windows
 
2692
       Service.")
 
2693
   10. Restart the server. For example, use NET START MySQL if you
 
2694
       run MySQL as a service, or invoke mysqld directly otherwise.
 
2695
   11. If you encounter errors, see Section 2.3.13, "Troubleshooting
 
2696
       a MySQL Installation Under Windows."
2857
2697
 
2858
2698
2.3.15. MySQL on Windows Compared to MySQL on Unix
2859
2699
 
2860
 
   MySQL for Windows has proven itself to be very stable. The
2861
 
   Windows version of MySQL has the same features as the
2862
 
   corresponding Unix version, with the following exceptions:
 
2700
   MySQL for Windows has proven itself to be very stable. The Windows
 
2701
   version of MySQL has the same features as the corresponding Unix
 
2702
   version, with the following exceptions:
2863
2703
 
2864
2704
     * Limited number of ports
2865
 
       Windows systems have about 4,000 ports available for
2866
 
       client connections, and after a connection on a port
2867
 
       closes, it takes two to four minutes before the port can
2868
 
       be reused. In situations where clients connect to and
2869
 
       disconnect from the server at a high rate, it is possible
2870
 
       for all available ports to be used up before closed ports
2871
 
       become available again. If this happens, the MySQL server
2872
 
       appears to be unresponsive even though it is running.
2873
 
       Note that ports may be used by other applications running
2874
 
       on the machine as well, in which case the number of ports
2875
 
       available to MySQL is lower.
 
2705
       Windows systems have about 4,000 ports available for client
 
2706
       connections, and after a connection on a port closes, it takes
 
2707
       two to four minutes before the port can be reused. In
 
2708
       situations where clients connect to and disconnect from the
 
2709
       server at a high rate, it is possible for all available ports
 
2710
       to be used up before closed ports become available again. If
 
2711
       this happens, the MySQL server appears to be unresponsive even
 
2712
       though it is running. Note that ports may be used by other
 
2713
       applications running on the machine as well, in which case the
 
2714
       number of ports available to MySQL is lower.
2876
2715
       For more information about this problem, see
2877
 
       http://support.microsoft.com/default.aspx?scid=kb;en-us;1
2878
 
       96271.
 
2716
       http://support.microsoft.com/default.aspx?scid=kb;en-us;196271
 
2717
       .
2879
2718
 
2880
2719
     * Concurrent reads
2881
 
       MySQL depends on the pread() and pwrite() system calls to
2882
 
       be able to mix INSERT and SELECT. Currently, we use
2883
 
       mutexes to emulate pread() and pwrite(). We intend to
2884
 
       replace the file level interface with a virtual interface
2885
 
       in the future so that we can use the
2886
 
       readfile()/writefile() interface to get more speed. The
2887
 
       current implementation limits the number of open files
2888
 
       that MySQL 5.1 can use to 2,048, which means that you
2889
 
       cannot run as many concurrent threads on Windows as on
2890
 
       Unix.
 
2720
       MySQL depends on the pread() and pwrite() system calls to be
 
2721
       able to mix INSERT and SELECT. Currently, we use mutexes to
 
2722
       emulate pread() and pwrite(). We intend to replace the file
 
2723
       level interface with a virtual interface in the future so that
 
2724
       we can use the readfile()/writefile() interface to get more
 
2725
       speed. The current implementation limits the number of open
 
2726
       files that MySQL 5.1 can use to 2,048, which means that you
 
2727
       cannot run as many concurrent threads on Windows as on Unix.
2891
2728
 
2892
2729
     * Blocking read
2893
 
       MySQL uses a blocking read for each connection. That has
2894
 
       the following implications if named-pipe connections are
2895
 
       enabled:
 
2730
       MySQL uses a blocking read for each connection. That has the
 
2731
       following implications if named-pipe connections are enabled:
2896
2732
 
2897
2733
          + A connection is not disconnected automatically after
2898
 
            eight hours, as happens with the Unix version of
2899
 
            MySQL.
2900
 
 
2901
 
          + If a connection hangs, it is not possible to break
2902
 
            it without killing MySQL.
2903
 
 
2904
 
          + mysqladmin kill does not work on a sleeping
2905
 
            connection.
2906
 
 
2907
 
          + mysqladmin shutdown cannot abort as long as there
2908
 
            are sleeping connections.
 
2734
            eight hours, as happens with the Unix version of MySQL.
 
2735
 
 
2736
          + If a connection hangs, it is not possible to break it
 
2737
            without killing MySQL.
 
2738
 
 
2739
          + mysqladmin kill does not work on a sleeping connection.
 
2740
 
 
2741
          + mysqladmin shutdown cannot abort as long as there are
 
2742
            sleeping connections.
2909
2743
       We plan to fix this problem in the future.
2910
2744
 
2911
2745
     * ALTER TABLE
2912
 
       While you are executing an ALTER TABLE statement, the
2913
 
       table is locked from being used by other threads. This
2914
 
       has to do with the fact that on Windows, you can't delete
2915
 
       a file that is in use by another thread. In the future,
2916
 
       we may find some way to work around this problem.
 
2746
       While you are executing an ALTER TABLE statement, the table is
 
2747
       locked from being used by other threads. This has to do with
 
2748
       the fact that on Windows, you can't delete a file that is in
 
2749
       use by another thread. In the future, we may find some way to
 
2750
       work around this problem.
2917
2751
 
2918
2752
     * DROP TABLE
2919
 
       DROP TABLE on a table that is in use by a MERGE table
2920
 
       does not work on Windows because the MERGE handler does
2921
 
       the table mapping hidden from the upper layer of MySQL.
2922
 
       Because Windows does not allow dropping files that are
2923
 
       open, you first must flush all MERGE tables (with FLUSH
2924
 
       TABLES) or drop the MERGE table before dropping the
2925
 
       table.
 
2753
       DROP TABLE on a table that is in use by a MERGE table does not
 
2754
       work on Windows because the MERGE handler does the table
 
2755
       mapping hidden from the upper layer of MySQL. Because Windows
 
2756
       does not allow dropping files that are open, you first must
 
2757
       flush all MERGE tables (with FLUSH TABLES) or drop the MERGE
 
2758
       table before dropping the table.
2926
2759
 
2927
2760
     * DATA DIRECTORY and INDEX DIRECTORY
2928
2761
       The DATA DIRECTORY and INDEX DIRECTORY options for CREATE
2929
 
       TABLE are ignored on Windows, because Windows doesn't
2930
 
       support symbolic links. These options also are ignored on
2931
 
       systems that have a non-functional realpath() call.
 
2762
       TABLE are ignored on Windows, because Windows doesn't support
 
2763
       symbolic links. These options also are ignored on systems that
 
2764
       have a non-functional realpath() call.
2932
2765
 
2933
2766
     * DROP DATABASE
2934
2767
       You cannot drop a database that is in use by some thread.
2935
2768
 
2936
2769
     * Case-insensitive names
2937
 
       Filenames are not case sensitive on Windows, so MySQL
 
2770
       File names are not case sensitive on Windows, so MySQL
2938
2771
       database and table names are also not case sensitive on
2939
 
       Windows. The only restriction is that database and table
2940
 
       names must be specified using the same case throughout a
2941
 
       given statement. See Section 8.2.2, "Identifier Case
2942
 
       Sensitivity."
 
2772
       Windows. The only restriction is that database and table names
 
2773
       must be specified using the same case throughout a given
 
2774
       statement. See Section 8.2.2, "Identifier Case Sensitivity."
2943
2775
 
2944
 
     * The "\" pathname separator character
2945
 
       Pathname components in Windows are separated by the "\"
2946
 
       character, which is also the escape character in MySQL.
2947
 
       If you are using LOAD DATA INFILE or SELECT ... INTO
2948
 
       OUTFILE, use Unix-style filenames with "/" characters:
 
2776
     * The "\" path name separator character
 
2777
       Path name components in Windows are separated by the "\"
 
2778
       character, which is also the escape character in MySQL. If you
 
2779
       are using LOAD DATA INFILE or SELECT ... INTO OUTFILE, use
 
2780
       Unix-style file names with "/" characters:
2949
2781
mysql> LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr;
2950
2782
mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
2951
 
 
2952
2783
       Alternatively, you must double the "\" character:
2953
2784
mysql> LOAD DATA INFILE 'C:\\tmp\\skr.txt' INTO TABLE skr;
2954
2785
mysql> SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
2955
2786
 
2956
 
 
2957
2787
     * Problems with pipes
2958
2788
       Pipes do not work reliably from the Windows command-line
2959
2789
       prompt. If the pipe includes the character ^Z / CHAR(24),
2960
 
       Windows thinks that it has encountered end-of-file and
2961
 
       aborts the program.
2962
 
       This is mainly a problem when you try to apply a binary
2963
 
       log as follows:
 
2790
       Windows thinks that it has encountered end-of-file and aborts
 
2791
       the program.
 
2792
       This is mainly a problem when you try to apply a binary log as
 
2793
       follows:
2964
2794
C:\> mysqlbinlog binary_log_file | mysql --user=root
2965
 
 
2966
 
       If you have a problem applying the log and suspect that
2967
 
       it is because of a ^Z / CHAR(24) character, you can use
2968
 
       the following workaround:
 
2795
       If you have a problem applying the log and suspect that it is
 
2796
       because of a ^Z / CHAR(24) character, you can use the
 
2797
       following workaround:
2969
2798
C:\> mysqlbinlog binary_log_file --result-file=/tmp/bin.sql
2970
2799
C:\> mysql --user=root --execute "source /tmp/bin.sql"
2971
 
 
2972
 
       The latter command also can be used to reliably read in
2973
 
       any SQL file that may contain binary data.
 
2800
       The latter command also can be used to reliably read in any
 
2801
       SQL file that may contain binary data.
2974
2802
 
2975
2803
     * Access denied for user error
2976
 
       If MySQL cannot resolve your hostname properly, you may
2977
 
       get the following error when you attempt to run a MySQL
2978
 
       client program to connect to a server running on the same
2979
 
       machine:
 
2804
       If MySQL cannot resolve your host name properly, you may get
 
2805
       the following error when you attempt to run a MySQL client
 
2806
       program to connect to a server running on the same machine:
2980
2807
Access denied for user 'some_user'@'unknown'
2981
2808
to database 'mysql'
2982
 
 
2983
2809
       To fix this problem, you should create a file named
2984
2810
       \windows\hosts containing the following information:
2985
2811
127.0.0.1       localhost
2986
2812
 
2987
 
   Here are some open issues for anyone who might want to help
2988
 
   us improve MySQL on Windows:
 
2813
   Here are some open issues for anyone who might want to help us
 
2814
   improve MySQL on Windows:
2989
2815
 
2990
 
     * Add macros to use the faster thread-safe
2991
 
       increment/decrement methods provided by Windows.
 
2816
     * Add macros to use the faster thread-safe increment/decrement
 
2817
       methods provided by Windows.
2992
2818
 
2993
2819
2.4. Installing MySQL from RPM Packages on Linux
2994
2820
 
2995
2821
   The recommended way to install MySQL on RPM-based Linux
2996
2822
   distributions is by using the RPM packages. The RPMs that we
2997
 
   provide to the community should work on all versions of Linux
2998
 
   that support RPM packages and use glibc 2.3. To obtain RPM
2999
 
   packages, see Section 2.1.3, "How to Get MySQL."
3000
 
 
3001
 
   For non-RPM Linux distributions, you can install MySQL using
3002
 
   a .tar.gz package. See Section 2.9, "Installing MySQL from
3003
 
   tar.gz Packages on Other Unix-Like Systems."
3004
 
 
3005
 
   We do provide some platform-specific RPMs; the difference
3006
 
   between a platform-specific RPM and a generic RPM is that a
3007
 
   platform-specific RPM is built on the targeted platform and
3008
 
   is linked dynamically whereas a generic RPM is linked
3009
 
   statically with LinuxThreads.
 
2823
   provide to the community should work on all versions of Linux that
 
2824
   support RPM packages and use glibc 2.3. To obtain RPM packages,
 
2825
   see Section 2.1.3, "How to Get MySQL."
 
2826
 
 
2827
   For non-RPM Linux distributions, you can install MySQL using a
 
2828
   .tar.gz package. See Section 2.9, "Installing MySQL from tar.gz
 
2829
   Packages on Other Unix-Like Systems."
 
2830
 
 
2831
   We do provide some platform-specific RPMs; the difference between
 
2832
   a platform-specific RPM and a generic RPM is that a
 
2833
   platform-specific RPM is built on the targeted platform and is
 
2834
   linked dynamically whereas a generic RPM is linked statically with
 
2835
   LinuxThreads.
3010
2836
 
3011
2837
Note
3012
2838
 
3013
 
   RPM distributions of MySQL often are provided by other
3014
 
   vendors. Be aware that they may differ in features and
3015
 
   capabilities from those built by us, and that the
3016
 
   instructions in this manual do not necessarily apply to
3017
 
   installing them. The vendor's instructions should be
3018
 
   consulted instead.
 
2839
   RPM distributions of MySQL often are provided by other vendors. Be
 
2840
   aware that they may differ in features and capabilities from those
 
2841
   built by us, and that the instructions in this manual do not
 
2842
   necessarily apply to installing them. The vendor's instructions
 
2843
   should be consulted instead.
3019
2844
 
3020
 
   If you have problems with an RPM file (for example, if you
3021
 
   receive the error Sorry, the host 'xxxx' could not be looked
3022
 
   up), see Section 2.14.1.2, "Linux Binary Distribution Notes."
 
2845
   If you have problems with an RPM file (for example, if you receive
 
2846
   the error Sorry, the host 'xxxx' could not be looked up), see
 
2847
   Section 2.13.1.2, "Linux Binary Distribution Notes."
3023
2848
 
3024
2849
   In most cases, you need to install only the MySQL-server and
3025
 
   MySQL-client packages to get a functional MySQL installation.
3026
 
   The other packages are not required for a standard
3027
 
   installation.
 
2850
   MySQL-client packages to get a functional MySQL installation. The
 
2851
   other packages are not required for a standard installation.
3028
2852
 
3029
 
   RPMs for MySQL Cluster.  Beginning with MySQL 5.1.24,
3030
 
   standard MySQL server RPMs built by MySQL no longer provide
3031
 
   support for the NDBCLUSTER storage engine. MySQL Cluster
3032
 
   users wanting to upgrade MySQL 5.1.23 or earlier
3033
 
   installations from RPMs built by MySQL should upgrade to
3034
 
   MySQL Cluster NDB 6.2 or MySQL Cluster NDB 6.3; RPMs that
3035
 
   should work with most Linux distributions are available for
3036
 
   both of these release series.
 
2853
   RPMs for MySQL Cluster.  Beginning with MySQL 5.1.24, standard
 
2854
   MySQL server RPMs built by MySQL no longer provide support for the
 
2855
   NDBCLUSTER storage engine. MySQL Cluster users wanting to upgrade
 
2856
   MySQL 5.1.23 or earlier installations from RPMs built by MySQL
 
2857
   should upgrade to MySQL Cluster NDB 6.2 or MySQL Cluster NDB 6.3;
 
2858
   RPMs that should work with most Linux distributions are available
 
2859
   for both of these release series.
3037
2860
 
3038
2861
Important
3039
2862
 
3040
 
   When upgrading a MySQL Cluster RPM installation, you must
3041
 
   upgrade all installed RPMs, including the Server and Client
3042
 
   RPMs.
 
2863
   When upgrading a MySQL Cluster RPM installation, you must upgrade
 
2864
   all installed RPMs, including the Server and Client RPMs.
3043
2865
 
3044
 
   For more information about installing MySQL Cluster from
3045
 
   RPMs, see Section 17.2.2, "MySQL Cluster Multi-Computer
3046
 
   Installation."
 
2866
   For more information about installing MySQL Cluster from RPMs, see
 
2867
   Section 17.2.2, "MySQL Cluster Multi-Computer Installation."
3047
2868
 
3048
2869
   For upgrades, if your installation was originally produced by
3049
 
   installing multiple RPM packages, it is best to upgrade all
3050
 
   the packages, not just some. For example, if you previously
3051
 
   installed the server and client RPMs, do not upgrade just the
3052
 
   server RPM.
 
2870
   installing multiple RPM packages, it is best to upgrade all the
 
2871
   packages, not just some. For example, if you previously installed
 
2872
   the server and client RPMs, do not upgrade just the server RPM.
3053
2873
 
3054
2874
   If you get a dependency failure when trying to install MySQL
3055
 
   packages (for example, error: removing these packages would
3056
 
   break dependencies: libmysqlclient.so.10 is needed by ...),
3057
 
   you should also install the MySQL-shared-compat package,
3058
 
   which includes both the shared libraries for backward
3059
 
   compatibility (libmysqlclient.so.12 for MySQL 4.0 and
3060
 
   libmysqlclient.so.10 for MySQL 3.23).
 
2875
   packages (for example, error: removing these packages would break
 
2876
   dependencies: libmysqlclient.so.10 is needed by ...), you should
 
2877
   also install the MySQL-shared-compat package, which includes both
 
2878
   the shared libraries for backward compatibility
 
2879
   (libmysqlclient.so.12 for MySQL 4.0 and libmysqlclient.so.10 for
 
2880
   MySQL 3.23).
3061
2881
 
3062
2882
   Some Linux distributions still ship with MySQL 3.23 and they
3063
 
   usually link applications dynamically to save disk space. If
3064
 
   these shared libraries are in a separate package (for
3065
 
   example, MySQL-shared), it is sufficient to simply leave this
3066
 
   package installed and just upgrade the MySQL server and
3067
 
   client packages (which are statically linked and do not
3068
 
   depend on the shared libraries). For distributions that
3069
 
   include the shared libraries in the same package as the MySQL
3070
 
   server (for example, Red Hat Linux), you could either install
3071
 
   our 3.23 MySQL-shared RPM, or use the MySQL-shared-compat
3072
 
   package instead. (Do not install both.)
 
2883
   usually link applications dynamically to save disk space. If these
 
2884
   shared libraries are in a separate package (for example,
 
2885
   MySQL-shared), it is sufficient to simply leave this package
 
2886
   installed and just upgrade the MySQL server and client packages
 
2887
   (which are statically linked and do not depend on the shared
 
2888
   libraries). For distributions that include the shared libraries in
 
2889
   the same package as the MySQL server (for example, Red Hat Linux),
 
2890
   you could either install our 3.23 MySQL-shared RPM, or use the
 
2891
   MySQL-shared-compat package instead. (Do not install both.)
3073
2892
 
3074
 
   The RPM packages shown in the following list are available.
3075
 
   The names shown here use a suffix of .glibc23.i386.rpm, but
3076
 
   particular packages can have different suffixes, as described
3077
 
   later.
 
2893
   The RPM packages shown in the following list are available. The
 
2894
   names shown here use a suffix of .glibc23.i386.rpm, but particular
 
2895
   packages can have different suffixes, as described later.
3078
2896
 
3079
2897
     * MySQL-server-VERSION.glibc23.i386.rpm
3080
2898
       The MySQL server. You need this unless you only want to
3081
2899
       connect to a MySQL server running on another machine.
3082
2900
 
3083
2901
     * MySQL-client-VERSION.glibc23.i386.rpm
3084
 
       The standard MySQL client programs. You probably always
3085
 
       want to install this package.
 
2902
       The standard MySQL client programs. You probably always want
 
2903
       to install this package.
3086
2904
 
3087
2905
     * MySQL-devel-VERSION.glibc23.i386.rpm
3088
 
       The libraries and include files that are needed if you
3089
 
       want to compile other MySQL clients, such as the Perl
3090
 
       modules.
 
2906
       The libraries and include files that are needed if you want to
 
2907
       compile other MySQL clients, such as the Perl modules.
3091
2908
 
3092
2909
     * MySQL-debuginfo-VERSION.glibc23.i386.rpm
3093
 
       This package contains debugging information. debuginfo
3094
 
       RPMs are never needed to use MySQL software; this is true
3095
 
       both for the server and for client programs. However,
3096
 
       they contain additional information that might be needed
3097
 
       by a debugger to analyze a crash.
 
2910
       This package contains debugging information. debuginfo RPMs
 
2911
       are never needed to use MySQL software; this is true both for
 
2912
       the server and for client programs. However, they contain
 
2913
       additional information that might be needed by a debugger to
 
2914
       analyze a crash.
3098
2915
 
3099
2916
     * MySQL-shared-VERSION.glibc23.i386.rpm
3100
2917
       This package contains the shared libraries
3101
 
       (libmysqlclient.so*) that certain languages and
3102
 
       applications need to dynamically load and use MySQL. It
3103
 
       contains single-threaded and thread-safe libraries. If
3104
 
       you install this package, do not install the
3105
 
       MySQL-shared-compat package.
 
2918
       (libmysqlclient.so*) that certain languages and applications
 
2919
       need to dynamically load and use MySQL. It contains
 
2920
       single-threaded and thread-safe libraries. If you install this
 
2921
       package, do not install the MySQL-shared-compat package.
3106
2922
 
3107
2923
     * MySQL-shared-compat-VERSION.glibc23.i386.rpm
3108
 
       This package includes the shared libraries for MySQL
3109
 
       3.23, 4.0, 4.1, and 5.1. It contains single-threaded and
3110
 
       thread-safe libraries. Install this package instead of
3111
 
       MySQL-shared if you have applications installed that are
3112
 
       dynamically linked against older versions of MySQL but
3113
 
       you want to upgrade to the current version without
3114
 
       breaking the library dependencies.
 
2924
       This package includes the shared libraries for MySQL 3.23,
 
2925
       4.0, 4.1, and 5.1. It contains single-threaded and thread-safe
 
2926
       libraries. Install this package instead of MySQL-shared if you
 
2927
       have applications installed that are dynamically linked
 
2928
       against older versions of MySQL but you want to upgrade to the
 
2929
       current version without breaking the library dependencies.
3115
2930
 
3116
2931
     * MySQL-embedded-VERSION.glibc23.i386.rpm
3117
2932
       The embedded MySQL server library.
3124
2939
       installations.
3125
2940
 
3126
2941
Note
3127
 
       The MySQL-ndb-tools RPM requires a working installation
3128
 
       of perl. Prior to MySQL 5.1.18, the DBI and
3129
 
       HTML::Template packages were also required. See Section
3130
 
       2.16, "Perl Installation Notes," and Section 17.9.15,
3131
 
       "ndb_size.pl --- NDBCLUSTER Size Requirement Estimator,"
3132
 
       for more information.
 
2942
       The MySQL-ndb-tools RPM requires a working installation of
 
2943
       perl. Prior to MySQL 5.1.18, the DBI and HTML::Template
 
2944
       packages were also required. See Section 2.15, "Perl
 
2945
       Installation Notes," and Section 17.9.15, "ndb_size.pl ---
 
2946
       NDBCLUSTER Size Requirement Estimator," for more information.
3133
2947
 
3134
2948
     * MySQL-test-VERSION.glibc23.i386.rpm
3135
2949
       This package includes the MySQL test suite.
3136
2950
 
3137
2951
     * MySQL-VERSION.src.rpm
3138
2952
       This contains the source code for all of the previous
3139
 
       packages. It can also be used to rebuild the RPMs on
3140
 
       other architectures (for example, Alpha or SPARC).
 
2953
       packages. It can also be used to rebuild the RPMs on other
 
2954
       architectures (for example, Alpha or SPARC).
3141
2955
 
3142
 
   The suffix of RPM package names (following the VERSION value)
3143
 
   has the following syntax:
 
2956
   The suffix of RPM package names (following the VERSION value) has
 
2957
   the following syntax:
3144
2958
.PLATFORM.CPU.rpm
3145
2959
 
3146
 
   The PLATFORM and CPU values indicate the type of system for
3147
 
   which the package is built. PLATFORM indicates the platform
3148
 
   and CPU indicates the processor type or family.
 
2960
   The PLATFORM and CPU values indicate the type of system for which
 
2961
   the package is built. PLATFORM indicates the platform and CPU
 
2962
   indicates the processor type or family.
3149
2963
 
3150
2964
   All packages are dynamically linked against glibc 2.3. The
3151
2965
   PLATFORM value indicates whether the package is platform
3152
 
   independent or intended for a specific platform:
3153
 
   glibc23 Platform independent, should run on any Linux
3154
 
   distribution that supports glibc 2.3
 
2966
   independent or intended for a specific platform, as shown in the
 
2967
   following table.
 
2968
   glibc23 Platform independent, should run on any Linux distribution
 
2969
   that supports glibc 2.3
3155
2970
   rhel3, rhel4 Red Hat Enterprise Linux 3 or 4
3156
2971
   sles9, sles10 SuSE Linux Enterprise Server 9 or 10
3157
2972
 
3158
2973
   In MySQL 5.1, only glibc23 packages are available currently.
3159
2974
 
3160
 
   The CPU value indicates the processor type or family for
3161
 
   which the package is built:
 
2975
   The CPU value indicates the processor type or family for which the
 
2976
   package is built.
3162
2977
   i386   x86 processor, 386 and up
3163
2978
   i586   x86 processor, Pentium and up
3164
2979
   x86_64 64-bit x86 processor
3165
2980
   ia64   Itanium (IA-64) processor
3166
2981
 
3167
 
   To see all files in an RPM package (for example, a
3168
 
   MySQL-server RPM), run a command like this:
 
2982
   To see all files in an RPM package (for example, a MySQL-server
 
2983
   RPM), run a command like this:
3169
2984
shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm
3170
2985
 
3171
 
   To perform a standard minimal installation, install the
3172
 
   server and client RPMs:
 
2986
   To perform a standard minimal installation, install the server and
 
2987
   client RPMs:
3173
2988
shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm
3174
2989
shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
3175
2990
 
3176
 
   To install only the client programs, install just the client
3177
 
   RPM:
 
2991
   To install only the client programs, install just the client RPM:
3178
2992
shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
3179
2993
 
3180
 
   RPM provides a feature to verify the integrity and
3181
 
   authenticity of packages before installing them. If you would
3182
 
   like to learn more about this feature, see Section 2.1.4,
3183
 
   "Verifying Package Integrity Using MD5 Checksums or GnuPG."
3184
 
 
3185
 
   The server RPM places data under the /var/lib/mysql
3186
 
   directory. The RPM also creates a login account for a user
3187
 
   named mysql (if one does not exist) to use for running the
3188
 
   MySQL server, and creates the appropriate entries in
3189
 
   /etc/init.d/ to start the server automatically at boot time.
3190
 
   (This means that if you have performed a previous
3191
 
   installation and have made changes to its startup script, you
3192
 
   may want to make a copy of the script so that you don't lose
3193
 
   it when you install a newer RPM.) See Section 2.11.2.2,
3194
 
   "Starting and Stopping MySQL Automatically," for more
3195
 
   information on how MySQL can be started automatically on
3196
 
   system startup.
3197
 
 
3198
 
   If you want to install the MySQL RPM on older Linux
3199
 
   distributions that do not support initialization scripts in
3200
 
   /etc/init.d (directly or via a symlink), you should create a
3201
 
   symbolic link that points to the location where your
3202
 
   initialization scripts actually are installed. For example,
3203
 
   if that location is /etc/rc.d/init.d, use these commands
3204
 
   before installing the RPM to create /etc/init.d as a symbolic
3205
 
   link that points there:
 
2994
   RPM provides a feature to verify the integrity and authenticity of
 
2995
   packages before installing them. If you would like to learn more
 
2996
   about this feature, see Section 2.1.4, "Verifying Package
 
2997
   Integrity Using MD5 Checksums or GnuPG."
 
2998
 
 
2999
   The server RPM places data under the /var/lib/mysql directory. The
 
3000
   RPM also creates a login account for a user named mysql (if one
 
3001
   does not exist) to use for running the MySQL server, and creates
 
3002
   the appropriate entries in /etc/init.d/ to start the server
 
3003
   automatically at boot time. (This means that if you have performed
 
3004
   a previous installation and have made changes to its startup
 
3005
   script, you may want to make a copy of the script so that you
 
3006
   don't lose it when you install a newer RPM.) See Section 2.11.2.2,
 
3007
   "Starting and Stopping MySQL Automatically," for more information
 
3008
   on how MySQL can be started automatically on system startup.
 
3009
 
 
3010
   If you want to install the MySQL RPM on older Linux distributions
 
3011
   that do not support initialization scripts in /etc/init.d
 
3012
   (directly or via a symlink), you should create a symbolic link
 
3013
   that points to the location where your initialization scripts
 
3014
   actually are installed. For example, if that location is
 
3015
   /etc/rc.d/init.d, use these commands before installing the RPM to
 
3016
   create /etc/init.d as a symbolic link that points there:
3206
3017
shell> cd /etc
3207
3018
shell> ln -s rc.d/init.d .
3208
3019
 
3209
 
   However, all current major Linux distributions should support
3210
 
   the new directory layout that uses /etc/init.d, because it is
3211
 
   required for LSB (Linux Standard Base) compliance.
 
3020
   However, all current major Linux distributions should support the
 
3021
   new directory layout that uses /etc/init.d, because it is required
 
3022
   for LSB (Linux Standard Base) compliance.
3212
3023
 
3213
 
   If the RPM files that you install include MySQL-server, the
3214
 
   mysqld server should be up and running after installation.
3215
 
   You should be able to start using MySQL.
 
3024
   If the RPM files that you install include MySQL-server, the mysqld
 
3025
   server should be up and running after installation. You should be
 
3026
   able to start using MySQL.
3216
3027
 
3217
3028
   If something goes wrong, you can find more information in the
3218
 
   binary installation section. See Section 2.9, "Installing
3219
 
   MySQL from tar.gz Packages on Other Unix-Like Systems."
 
3029
   binary installation section. See Section 2.9, "Installing MySQL
 
3030
   from tar.gz Packages on Other Unix-Like Systems."
3220
3031
 
3221
3032
Note
3222
3033
 
3223
 
   The accounts that are listed in the MySQL grant tables
3224
 
   initially have no passwords. After starting the server, you
3225
 
   should set up passwords for them using the instructions in
3226
 
   Section 2.11, "Post-Installation Setup and Testing."
 
3034
   The accounts that are listed in the MySQL grant tables initially
 
3035
   have no passwords. After starting the server, you should set up
 
3036
   passwords for them using the instructions in Section 2.11,
 
3037
   "Post-Installation Setup and Testing."
3227
3038
 
3228
3039
   During RPM installation, a user named mysql and a group named
3229
 
   mysql are created on the system. This is done using the
3230
 
   useradd, groupadd, and usermod commands. Those commands
3231
 
   require appropriate administrative privileges, which is
3232
 
   ensured for locally managed users and groups (as listed in
3233
 
   the /etc/passwd and /etc/group files) by the RPM installation
3234
 
   process being run by root.
 
3040
   mysql are created on the system. This is done using the useradd,
 
3041
   groupadd, and usermod commands. Those commands require appropriate
 
3042
   administrative privileges, which is ensured for locally managed
 
3043
   users and groups (as listed in the /etc/passwd and /etc/group
 
3044
   files) by the RPM installation process being run by root.
3235
3045
 
3236
3046
   For non-local user management (LDAP, NIS, and so forth), the
3237
 
   administrative tools may require additional authentication
3238
 
   (such as a password), and will fail if the installing user
3239
 
   does not provide this authentication. Even if they fail, the
3240
 
   RPM installation will not abort but succeed, and this is
3241
 
   intentional. If they failed, some of the intended transfer of
3242
 
   ownership may be missing, and it is recommended that the
3243
 
   system administrator then manually ensures some appropriate
3244
 
   user andgroup exists and manually transfers ownership
3245
 
   following the actions in the RPM spec file.
 
3047
   administrative tools may require additional authentication (such
 
3048
   as a password), and will fail if the installing user does not
 
3049
   provide this authentication. Even if they fail, the RPM
 
3050
   installation will not abort but succeed, and this is intentional.
 
3051
   If they failed, some of the intended transfer of ownership may be
 
3052
   missing, and it is recommended that the system administrator then
 
3053
   manually ensures some appropriate user andgroup exists and
 
3054
   manually transfers ownership following the actions in the RPM spec
 
3055
   file.
3246
3056
 
3247
3057
2.5. Installing MySQL on Mac OS X
3248
3058
 
3249
3059
   You can install MySQL on Mac OS X 10.3.x ("Panther") or newer
3250
3060
   using a Mac OS X binary package in PKG format instead of the
3251
 
   binary tarball distribution. Please note that older versions
3252
 
   of Mac OS X (for example, 10.1.x or 10.2.x) are not supported
3253
 
   by this package.
 
3061
   binary tarball distribution. Please note that older versions of
 
3062
   Mac OS X (for example, 10.1.x or 10.2.x) are not supported by this
 
3063
   package.
3254
3064
 
3255
 
   The package is located inside a disk image (.dmg) file that
3256
 
   you first need to mount by double-clicking its icon in the
3257
 
   Finder. It should then mount the image and display its
3258
 
   contents.
 
3065
   The package is located inside a disk image (.dmg) file that you
 
3066
   first need to mount by double-clicking its icon in the Finder. It
 
3067
   should then mount the image and display its contents.
3259
3068
 
3260
3069
   To obtain MySQL, see Section 2.1.3, "How to Get MySQL."
3261
3070
 
3262
3071
Note
3263
3072
 
3264
 
   Before proceeding with the installation, be sure to shut down
3265
 
   all running MySQL server instances by either using the MySQL
3266
 
   Manager Application (on Mac OS X Server) or via mysqladmin
3267
 
   shutdown on the command line.
 
3073
   Before proceeding with the installation, be sure to shut down all
 
3074
   running MySQL server instances by either using the MySQL Manager
 
3075
   Application (on Mac OS X Server) or via mysqladmin shutdown on the
 
3076
   command line.
3268
3077
 
3269
3078
   To actually install the MySQL PKG file, double-click on the
3270
 
   package icon. This launches the Mac OS X Package Installer,
3271
 
   which guides you through the installation of MySQL.
 
3079
   package icon. This launches the Mac OS X Package Installer, which
 
3080
   guides you through the installation of MySQL.
3272
3081
 
3273
 
   Due to a bug in the Mac OS X package installer, you may see
3274
 
   this error message in the destination disk selection dialog:
 
3082
   Due to a bug in the Mac OS X package installer, you may see this
 
3083
   error message in the destination disk selection dialog:
3275
3084
You cannot install this software on this disk. (null)
3276
3085
 
3277
3086
   If this error occurs, simply click the Go Back button once to
3278
 
   return to the previous screen. Then click Continue to advance
3279
 
   to the destination disk selection again, and you should be
3280
 
   able to choose the destination disk correctly. We have
3281
 
   reported this bug to Apple and it is investigating this
3282
 
   problem.
 
3087
   return to the previous screen. Then click Continue to advance to
 
3088
   the destination disk selection again, and you should be able to
 
3089
   choose the destination disk correctly. We have reported this bug
 
3090
   to Apple and it is investigating this problem.
3283
3091
 
3284
3092
   The Mac OS X PKG of MySQL installs itself into
3285
3093
   /usr/local/mysql-VERSION and also installs a symbolic link,
3286
 
   /usr/local/mysql, that points to the new location. If a
3287
 
   directory named /usr/local/mysql exists, it is renamed to
3288
 
   /usr/local/mysql.bak first. Additionally, the installer
3289
 
   creates the grant tables in the mysql database by executing
 
3094
   /usr/local/mysql, that points to the new location. If a directory
 
3095
   named /usr/local/mysql exists, it is renamed to
 
3096
   /usr/local/mysql.bak first. Additionally, the installer creates
 
3097
   the grant tables in the mysql database by executing
3290
3098
   mysql_install_db.
3291
3099
 
3292
 
   The installation layout is similar to that of a tar file
3293
 
   binary distribution; all MySQL binaries are located in the
3294
 
   directory /usr/local/mysql/bin. The MySQL socket file is
3295
 
   created as /tmp/mysql.sock by default. See Section 2.1.5,
3296
 
   "Installation Layouts."
 
3100
   The installation layout is similar to that of a tar file binary
 
3101
   distribution; all MySQL binaries are located in the directory
 
3102
   /usr/local/mysql/bin. The MySQL socket file is created as
 
3103
   /tmp/mysql.sock by default. See Section 2.1.5, "Installation
 
3104
   Layouts."
3297
3105
 
3298
 
   MySQL installation requires a Mac OS X user account named
3299
 
   mysql. A user account with this name should exist by default
3300
 
   on Mac OS X 10.2 and up.
 
3106
   MySQL installation requires a Mac OS X user account named mysql. A
 
3107
   user account with this name should exist by default on Mac OS X
 
3108
   10.2 and up.
3301
3109
 
3302
3110
   If you are running Mac OS X Server, a version of MySQL should
3303
 
   already be installed. The following table shows the versions
3304
 
   of MySQL that ship with Mac OS X Server versions.
 
3111
   already be installed. The following table shows the versions of
 
3112
   MySQL that ship with Mac OS X Server versions.
3305
3113
   Mac OS X Server Version MySQL Version
3306
3114
   10.2-10.2.2             3.23.51
3307
3115
   10.2.3-10.2.6           3.23.53
3309
3117
   10.3.2                  4.0.16
3310
3118
   10.4.0                  4.1.10a
3311
3119
 
3312
 
   This manual section covers the installation of the official
3313
 
   MySQL Mac OS X PKG only. Make sure to read Apple's help
3314
 
   information about installing MySQL: Run the "Help View"
3315
 
   application, select "Mac OS X Server" help, do a search for
3316
 
   "MySQL," and read the item entitled "Installing MySQL."
3317
 
 
3318
 
   If you previously used Marc Liyanage's MySQL packages for Mac
3319
 
   OS X from http://www.entropy.ch, you can simply follow the
3320
 
   update instructions for packages using the binary
3321
 
   installation layout as given on his pages.
3322
 
 
3323
 
   If you are upgrading from Marc's 3.23.x versions or from the
3324
 
   Mac OS X Server version of MySQL to the official MySQL PKG,
3325
 
   you also need to convert the existing MySQL privilege tables
3326
 
   to the current format, because some new security privileges
3327
 
   have been added. See Section 4.4.8, "mysql_upgrade --- Check
3328
 
   Tables for MySQL Upgrade."
3329
 
 
3330
 
   If you want MySQL to start automatically during system
3331
 
   startup, you also need to install the MySQL Startup Item. It
3332
 
   is part of the Mac OS X installation disk images as a
3333
 
   separate installation package. Simply double-click the
3334
 
   MySQLStartupItem.pkg icon and follow the instructions to
3335
 
   install it. The Startup Item need be installed only once.
3336
 
   There is no need to install it each time you upgrade the
3337
 
   MySQL package later.
 
3120
   This manual section covers the installation of the official MySQL
 
3121
   Mac OS X PKG only. Make sure to read Apple's help information
 
3122
   about installing MySQL: Run the "Help View" application, select
 
3123
   "Mac OS X Server" help, do a search for "MySQL," and read the item
 
3124
   entitled "Installing MySQL."
 
3125
 
 
3126
   If you previously used Marc Liyanage's MySQL packages for Mac OS X
 
3127
   from http://www.entropy.ch, you can simply follow the update
 
3128
   instructions for packages using the binary installation layout as
 
3129
   given on his pages.
 
3130
 
 
3131
   If you are upgrading from Marc's 3.23.x versions or from the Mac
 
3132
   OS X Server version of MySQL to the official MySQL PKG, you also
 
3133
   need to convert the existing MySQL privilege tables to the current
 
3134
   format, because some new security privileges have been added. See
 
3135
   Section 4.4.8, "mysql_upgrade --- Check Tables for MySQL Upgrade."
 
3136
 
 
3137
   If you want MySQL to start automatically during system startup,
 
3138
   you also need to install the MySQL Startup Item. It is part of the
 
3139
   Mac OS X installation disk images as a separate installation
 
3140
   package. Simply double-click the MySQLStartupItem.pkg icon and
 
3141
   follow the instructions to install it. The Startup Item need be
 
3142
   installed only once. There is no need to install it each time you
 
3143
   upgrade the MySQL package later.
3338
3144
 
3339
3145
   The Startup Item for MySQL is installed into
3340
 
   /Library/StartupItems/MySQLCOM. (Before MySQL 4.1.2, the
3341
 
   location was /Library/StartupItems/MySQL, but that collided
3342
 
   with the MySQL Startup Item installed by Mac OS X Server.)
3343
 
   Startup Item installation adds a variable MYSQLCOM=-YES- to
3344
 
   the system configuration file /etc/hostconfig. If you want to
3345
 
   disable the automatic startup of MySQL, simply change this
3346
 
   variable to MYSQLCOM=-NO-.
 
3146
   /Library/StartupItems/MySQLCOM. (Before MySQL 4.1.2, the location
 
3147
   was /Library/StartupItems/MySQL, but that collided with the MySQL
 
3148
   Startup Item installed by Mac OS X Server.) Startup Item
 
3149
   installation adds a variable MYSQLCOM=-YES- to the system
 
3150
   configuration file /etc/hostconfig. If you want to disable the
 
3151
   automatic startup of MySQL, simply change this variable to
 
3152
   MYSQLCOM=-NO-.
3347
3153
 
3348
3154
   On Mac OS X Server, the default MySQL installation uses the
3349
 
   variable MYSQL in the /etc/hostconfig file. The MySQL Startup
3350
 
   Item installer disables this variable by setting it to
3351
 
   MYSQL=-NO-. This avoids boot time conflicts with the MYSQLCOM
3352
 
   variable used by the MySQL Startup Item. However, it does not
3353
 
   shut down a running MySQL server. You should do that
3354
 
   yourself.
 
3155
   variable MYSQL in the /etc/hostconfig file. The MySQL Startup Item
 
3156
   installer disables this variable by setting it to MYSQL=-NO-. This
 
3157
   avoids boot time conflicts with the MYSQLCOM variable used by the
 
3158
   MySQL Startup Item. However, it does not shut down a running MySQL
 
3159
   server. You should do that yourself.
3355
3160
 
3356
3161
   After the installation, you can start up MySQL by running the
3357
3162
   following commands in a terminal window. You must have
3362
3167
(Enter your password, if necessary)
3363
3168
(Press Control-D or enter "exit" to exit the shell)
3364
3169
 
3365
 
   If you don't use the Startup Item, enter the following
3366
 
   command sequence:
 
3170
   If you don't use the Startup Item, enter the following command
 
3171
   sequence:
3367
3172
shell> cd /usr/local/mysql
3368
3173
shell> sudo ./bin/mysqld_safe
3369
3174
(Enter your password, if necessary)
3371
3176
shell> bg
3372
3177
(Press Control-D or enter "exit" to exit the shell)
3373
3178
 
3374
 
   You should be able to connect to the MySQL server, for
3375
 
   example, by running /usr/local/mysql/bin/mysql.
 
3179
   You should be able to connect to the MySQL server, for example, by
 
3180
   running /usr/local/mysql/bin/mysql.
3376
3181
 
3377
3182
Note
3378
3183
 
3379
 
   The accounts that are listed in the MySQL grant tables
3380
 
   initially have no passwords. After starting the server, you
3381
 
   should set up passwords for them using the instructions in
3382
 
   Section 2.11, "Post-Installation Setup and Testing."
 
3184
   The accounts that are listed in the MySQL grant tables initially
 
3185
   have no passwords. After starting the server, you should set up
 
3186
   passwords for them using the instructions in Section 2.11,
 
3187
   "Post-Installation Setup and Testing."
3383
3188
 
3384
 
   You might want to add aliases to your shell's resource file
3385
 
   to make it easier to access commonly used programs such as
3386
 
   mysql and mysqladmin from the command line. The syntax for
3387
 
   bash is:
 
3189
   You might want to add aliases to your shell's resource file to
 
3190
   make it easier to access commonly used programs such as mysql and
 
3191
   mysqladmin from the command line. The syntax for bash is:
3388
3192
alias mysql=/usr/local/mysql/bin/mysql
3389
3193
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
3390
3194
 
3392
3196
alias mysql /usr/local/mysql/bin/mysql
3393
3197
alias mysqladmin /usr/local/mysql/bin/mysqladmin
3394
3198
 
3395
 
   Even better, add /usr/local/mysql/bin to your PATH
3396
 
   environment variable. You can do this by modifying the
3397
 
   appropriate startup file for your shell. For more
3398
 
   information, see Section 4.2.1, "Invoking MySQL Programs."
 
3199
   Even better, add /usr/local/mysql/bin to your PATH environment
 
3200
   variable. You can do this by modifying the appropriate startup
 
3201
   file for your shell. For more information, see Section 4.2.1,
 
3202
   "Invoking MySQL Programs."
3399
3203
 
3400
3204
   If you are upgrading an existing installation, note that
3401
 
   installing a new MySQL PKG does not remove the directory of
3402
 
   an older installation. Unfortunately, the Mac OS X Installer
3403
 
   does not yet offer the functionality required to properly
3404
 
   upgrade previously installed packages.
 
3205
   installing a new MySQL PKG does not remove the directory of an
 
3206
   older installation. Unfortunately, the Mac OS X Installer does not
 
3207
   yet offer the functionality required to properly upgrade
 
3208
   previously installed packages.
3405
3209
 
3406
 
   To use your existing databases with the new installation,
3407
 
   you'll need to copy the contents of the old data directory to
3408
 
   the new data directory. Make sure that neither the old server
3409
 
   nor the new one is running when you do this. After you have
3410
 
   copied over the MySQL database files from the previous
3411
 
   installation and have successfully started the new server,
3412
 
   you should consider removing the old installation files to
3413
 
   save disk space. Additionally, you should also remove older
3414
 
   versions of the Package Receipt directories located in
3415
 
   /Library/Receipts/mysql-VERSION.pkg.
 
3210
   To use your existing databases with the new installation, you'll
 
3211
   need to copy the contents of the old data directory to the new
 
3212
   data directory. Make sure that neither the old server nor the new
 
3213
   one is running when you do this. After you have copied over the
 
3214
   MySQL database files from the previous installation and have
 
3215
   successfully started the new server, you should consider removing
 
3216
   the old installation files to save disk space. Additionally, you
 
3217
   should also remove older versions of the Package Receipt
 
3218
   directories located in /Library/Receipts/mysql-VERSION.pkg.
3416
3219
 
3417
3220
2.6. Installing MySQL on Solaris
3418
3221
 
3419
3222
   If you install MySQL using a binary tarball distribution on
3420
 
   Solaris, you may run into trouble even before you get the
3421
 
   MySQL distribution unpacked, as the Solaris tar cannot handle
3422
 
   long filenames. This means that you may see errors when you
3423
 
   try to unpack MySQL.
 
3223
   Solaris, you may run into trouble even before you get the MySQL
 
3224
   distribution unpacked, as the Solaris tar cannot handle long file
 
3225
   names. This means that you may see errors when you try to unpack
 
3226
   MySQL.
3424
3227
 
3425
3228
   If this occurs, you must use GNU tar (gtar) to unpack the
3426
3229
   distribution. You can find a precompiled copy for Solaris at
3427
3230
   http://dev.mysql.com/downloads/os-solaris.html.
3428
3231
 
3429
 
   You can install MySQL on Solaris using a binary package in
3430
 
   PKG format instead of the binary tarball distribution. Before
 
3232
   You can install MySQL on Solaris using a binary package in PKG
 
3233
   format instead of the binary tarball distribution. Before
3431
3234
   installing using the binary PKG format, you should create the
3432
3235
   mysql user and group, for example:
3433
3236
groupadd mysql
3438
3241
     * To add a package:
3439
3242
pkgadd -d package_name.pkg
3440
3243
 
3441
 
 
3442
3244
     * To remove a package:
3443
3245
pkgrm package_name
3444
3246
 
3445
 
 
3446
3247
     * To get a full list of installed packages:
3447
3248
pkginfo
3448
3249
 
3449
 
 
3450
3250
     * To get detailed information for a package:
3451
3251
pkginfo -l package_name
3452
3252
 
3453
 
 
3454
3253
     * To list the files belonging to a package:
3455
3254
pkgchk -v package_name
3456
3255
 
3457
 
 
3458
3256
     * To get packaging information for an arbitrary file:
3459
3257
pkgchk -l -p file_name
3460
3258
 
3461
 
   For additional information about installing MySQL on Solaris,
3462
 
   see Section 2.14.3, "Solaris Notes."
 
3259
   For additional information about installing MySQL on Solaris, see
 
3260
   Section 2.13.3, "Solaris Notes."
3463
3261
 
3464
3262
2.7. Installing MySQL on i5/OS
3465
3263
 
3466
 
   The i5/OS POWER MySQL package was created in cooperation with
3467
 
   IBM. MySQL works within the Portable Application Solution
3468
 
   Environment (PASE) on the System i series of hardware and
3469
 
   will also provide database services for the Zend Core for
3470
 
   i5/OS.
3471
 
 
3472
 
   MySQL for i5/OS is provided as a save file (.savf) package
3473
 
   that can be downloaded and installed directly without any
3474
 
   additional installation steps required.
3475
 
 
3476
 
   MySQL is only supported on i5/OS V5R4 or later releases. The
3477
 
   i5/OS PASE must be installed for MySQL to operate. You must
3478
 
   be able to login as a user in *SECOFR class.
 
3264
   The i5/OS POWER MySQL package was created in cooperation with IBM.
 
3265
   MySQL works within the Portable Application Solution Environment
 
3266
   (PASE) on the System i series of hardware and will also provide
 
3267
   database services for the Zend Core for i5/OS.
 
3268
 
 
3269
   MySQL for i5/OS is provided as a save file (.savf) package that
 
3270
   can be downloaded and installed directly without any additional
 
3271
   installation steps required.
 
3272
 
 
3273
   MySQL is only supported on i5/OS V5R4 or later releases. The i5/OS
 
3274
   PASE must be installed for MySQL to operate. You must be able to
 
3275
   login as a user in *SECOFR class.
3479
3276
 
3480
3277
   You should the installation notes and tips for i5/OS before
3481
3278
   starting installation. See i5/OS Installation Notes.
3482
3279
 
3483
3280
Note
3484
3281
 
3485
 
   The installation package will use an existing configuration
3486
 
   if you have previously installed MySQL (which is identified
3487
 
   by looking for the file /etc/my.cnf). The values for the data
3488
 
   directory (DATADIR) and owner of the MySQL files (USRPRF)
3489
 
   specified during the installation will be ignored, and the
3490
 
   values determined from the /etc/my.cnf will be used instead.
 
3282
   The installation package will use an existing configuration if you
 
3283
   have previously installed MySQL (which is identified by looking
 
3284
   for the file /etc/my.cnf). The values for the data directory
 
3285
   (DATADIR) and owner of the MySQL files (USRPRF) specified during
 
3286
   the installation will be ignored, and the values determined from
 
3287
   the /etc/my.cnf will be used instead.
3491
3288
 
3492
 
   If you want to change these parameters during a new install,
3493
 
   you should temporarily rename /etc/my.cnf, install MySQL
3494
 
   using the new parameters you want to use, and then merge your
3495
 
   previous /etc/my.cnf configuration settings with the new
3496
 
   /etc/my.cnf file that is created during installation.
 
3289
   If you want to change these parameters during a new install, you
 
3290
   should temporarily rename /etc/my.cnf, install MySQL using the new
 
3291
   parameters you want to use, and then merge your previous
 
3292
   /etc/my.cnf configuration settings with the new /etc/my.cnf file
 
3293
   that is created during installation.
3497
3294
 
3498
3295
   To install MySQL on i5/OS, follow these steps:
3499
3296
 
3500
 
    1. Create a user profile MYSQL. The MYSQL user profile will
3501
 
       own all the MySQL files and databases and be the active
3502
 
       user used when the MySQL server is running. The profile
3503
 
       should be disabled so that you cannot log in as the MySQL
3504
 
       user. To create a user profile, use CRTUSRPRF:
 
3297
    1. Create a user profile MYSQL. The MYSQL user profile will own
 
3298
       all the MySQL files and databases and be the active user used
 
3299
       when the MySQL server is running. The profile should be
 
3300
       disabled so that you cannot log in as the MySQL user. To
 
3301
       create a user profile, use CRTUSRPRF:
3505
3302
CRTUSRPRF USRPRF(MYSQL) STATUS(*DISABLED) TEXT('MySQL user id')
3506
3303
 
3507
 
    2. On the System i machine, create a save file that will be
3508
 
       used to receive the downloaded installation save file.
3509
 
       The file should be located within the General Purpose
3510
 
       Library (QGPL):
 
3304
    2. On the System i machine, create a save file that will be used
 
3305
       to receive the downloaded installation save file. The file
 
3306
       should be located within the General Purpose Library (QGPL):
3511
3307
CRTSAVF FILE(QGPL/MYSQLINST)
3512
3308
 
3513
3309
    3. Download the MySQL installation save file in 32-bit
3515
3311
       (mysql-5.0.42-i5os-power-64bit.savf) from MySQL Downloads
3516
3312
       (http://dev.mysql.com/downloads).
3517
3313
 
3518
 
    4. You need to FTP the downloaded .savf file directly into
3519
 
       the QGPL/MYSQLINST file on the System i server. You can
3520
 
       do this through FTP using the following steps after
3521
 
       logging in to the System i machine:
 
3314
    4. You need to FTP the downloaded .savf file directly into the
 
3315
       QGPL/MYSQLINST file on the System i server. You can do this
 
3316
       through FTP using the following steps after logging in to the
 
3317
       System i machine:
3522
3318
ftp> bin
3523
3319
ftp> cd qgpl
3524
3320
ftp> put mysql-5.0.42-i5os-power.savf mysqlinst
3526
3322
    5. Log into the System i server using a user in the *SECOFR
3527
3323
       class, such as the QSECOFR user ID.
3528
3324
 
3529
 
    6. You need to restore the installation library stored in
3530
 
       the .savf save file:
 
3325
    6. You need to restore the installation library stored in the
 
3326
       .savf save file:
3531
3327
RSTLIB MYSQLINST DEV(*SAVF) SAVF(QGPL/MYSQLINST)
3532
3328
 
3533
3329
    7. You need to execute the installation command,
3534
 
       MYSQLINST/INSMYSQL. You can specify three parameter
3535
 
       settings during installation:
3536
 
 
3537
 
          + DIR('/opt/mysql') sets the installation location for
3538
 
            the MySQL files. The directory will be created if it
3539
 
            does not already exist.
3540
 
 
3541
 
          + DATADIR('/QOpenSys/mysal/data') sets the location of
3542
 
            the directory that will be used to store the
3543
 
            database files and binary logs. The default setting
3544
 
            is /QOpenSys/mysql/data. Note that if the installer
3545
 
            detects an existing installation (due to the
3546
 
            existence of /etc/my.cnf), then this parameter will
3547
 
            be ignored.
3548
 
 
3549
 
          + USRPRF(MYSQL) sets the user profile that will own
3550
 
            the files that are installed. The profile will be
3551
 
            created if it does not already exist.
 
3330
       MYSQLINST/INSMYSQL. You can specify three parameter settings
 
3331
       during installation:
 
3332
 
 
3333
          + DIR('/opt/mysql') sets the installation location for the
 
3334
            MySQL files. The directory will be created if it does not
 
3335
            already exist.
 
3336
 
 
3337
          + DATADIR('/QOpenSys/mysal/data') sets the location of the
 
3338
            directory that will be used to store the database files
 
3339
            and binary logs. The default setting is
 
3340
            /QOpenSys/mysql/data. Note that if the installer detects
 
3341
            an existing installation (due to the existence of
 
3342
            /etc/my.cnf), then this parameter will be ignored.
 
3343
 
 
3344
          + USRPRF(MYSQL) sets the user profile that will own the
 
3345
            files that are installed. The profile will be created if
 
3346
            it does not already exist.
3552
3347
       MySQL can be installed anywhere, for this example we will
3553
 
       assume MySQL has been installed into /opt/mysql. The
3554
 
       MYSQL user profile that was created earlier in this
3555
 
       sequence should be used for the profile:
3556
 
MYSQLINST/INSMYSQL DIR('/opt/mysql') DATADIR('/opt/mysqldata') USRPRF(
3557
 
MYSQL)
3558
 
       If you are updating an installation over an existing
3559
 
       MySQL installation, you should use the same parameter
3560
 
       values that were used when MySQL was originally
3561
 
       installed.
 
3348
       assume MySQL has been installed into /opt/mysql. The MYSQL
 
3349
       user profile that was created earlier in this sequence should
 
3350
       be used for the profile:
 
3351
MYSQLINST/INSMYSQL DIR('/opt/mysql') DATADIR('/opt/mysqldata') USRPRF
 
3352
(MYSQL)
 
3353
       If you are updating an installation over an existing MySQL
 
3354
       installation, you should use the same parameter values that
 
3355
       were used when MySQL was originally installed.
3562
3356
       The installation copies all the necessary files into a
3563
3357
       directory matching the package version (for example
3564
 
       mysql-5.0.42-i5os-power-32bit), sets the ownership on
3565
 
       those files, sets up the MySQL environment and creates
3566
 
       the MySQL configuration file (in /etc/my.cnf) completing
3567
 
       all the steps in a typical binary installation process
3568
 
       automatically. If this is a new installation of MySQL, or
3569
 
       if the installer detects that this is a new version
3570
 
       (because the /etc/my.cnf file does not exist), then the
3571
 
       initial core MySQL databases will also be created during
3572
 
       installation.
 
3358
       mysql-5.0.42-i5os-power-32bit), sets the ownership on those
 
3359
       files, sets up the MySQL environment and creates the MySQL
 
3360
       configuration file (in /etc/my.cnf) completing all the steps
 
3361
       in a typical binary installation process automatically. If
 
3362
       this is a new installation of MySQL, or if the installer
 
3363
       detects that this is a new version (because the /etc/my.cnf
 
3364
       file does not exist), then the initial core MySQL databases
 
3365
       will also be created during installation.
3573
3366
 
3574
3367
    8. Once the installation has completed, you can delete the
3575
3368
       installation file:
3577
3370
 
3578
3371
   To start MySQL:
3579
3372
 
3580
 
    1. Log into the System i server using a user within the
3581
 
       *SECOFR class, such as the QSECOFR user ID.
 
3373
    1. Log into the System i server using a user within the *SECOFR
 
3374
       class, such as the QSECOFR user ID.
3582
3375
 
3583
3376
Note
3584
 
       You should start mysqld_safe using a user that in the
3585
 
       PASE environment has the id=0 (the equivalent of the
3586
 
       standard Unix root user). If you do not use a user with
3587
 
       this ID then the system will be unable to change the user
3588
 
       when executing mysqld as set using --user option. If this
3589
 
       happens, mysqld may be unable to read the files located
3590
 
       within the MySQL data directory and the execution will
3591
 
       fail.
 
3377
       You should start mysqld_safe using a user that in the PASE
 
3378
       environment has the id=0 (the equivalent of the standard Unix
 
3379
       root user). If you do not use a user with this ID then the
 
3380
       system will be unable to change the user when executing mysqld
 
3381
       as set using --user option. If this happens, mysqld may be
 
3382
       unable to read the files located within the MySQL data
 
3383
       directory and the execution will fail.
3592
3384
 
3593
3385
    2. Enter the PASE environment using call qp2term.
3594
3386
 
3595
3387
    3. Start the MySQL server by changing to the installation
3596
 
       directory and running mysqld_safe, specifying the user
3597
 
       name used to install the server. The installer
3598
 
       conveniently installs a symbolic link to the installation
3599
 
       directory (mysql-5.0.42-i5os-power-32bit) as
3600
 
       /opt/mysql/mysql:
 
3388
       directory and running mysqld_safe, specifying the user name
 
3389
       used to install the server. The installer conveniently
 
3390
       installs a symbolic link to the installation directory
 
3391
       (mysql-5.0.42-i5os-power-32bit) as /opt/mysql/mysql:
3601
3392
> cd /opt/mysql/mysql
3602
3393
> bin/mysqld_safe --user=mysql &
3603
3394
       You should see a message similar to the following:
3604
 
Starting mysqld daemon with databases >>
 
3395
Starting mysqld daemon with databases »
3605
3396
     from /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data
3606
3397
 
3607
3398
   If you are having problems starting MySQL server, see Section
3609
3400
 
3610
3401
   To stop MySQL:
3611
3402
 
3612
 
    1. Log into the System i server using the *SECOFR class,
3613
 
       such as the QSECOFR user ID.
 
3403
    1. Log into the System i server using the *SECOFR class, such as
 
3404
       the QSECOFR user ID.
3614
3405
 
3615
3406
    2. Enter the PASE environment using call qp2term.
3616
3407
 
3617
3408
    3. Stop the MySQL server by changing into the installation
3618
 
       directory and running mysqladmin, specifying the user
3619
 
       name used to install the server:
 
3409
       directory and running mysqladmin, specifying the user name
 
3410
       used to install the server:
3620
3411
> cd /opt/mysql/mysql
3621
3412
> bin/mysqladmin -u root shutdown
3622
3413
       If the session that you started and stopped MySQL are the
3623
3414
       same, you may get the log output from mysqld:
3624
 
   STOPPING server from pid file >>
3625
 
     /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data/I5DBX.RC
3626
 
HLAND.IBM.COM.pid
 
3415
   STOPPING server from pid file »
 
3416
     /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data/I5DBX.R
 
3417
CHLAND.IBM.COM.pid
3627
3418
   070718 10:34:20  mysqld ended
3628
 
       If the sessions used to start and stop MySQL are
3629
 
       different, you will not receive any confirmation of the
3630
 
       shutdown.
 
3419
       If the sessions used to start and stop MySQL are different,
 
3420
       you will not receive any confirmation of the shutdown.
3631
3421
 
3632
3422
   Note and tips
3633
3423
 
3634
 
     * A problem has been identified with the installation
3635
 
       process on DBCS systems. If you are having problems
3636
 
       install MySQL on a DBCS system, you need to change your
3637
 
       job's coded character set identifier (CSSID) to 37
3638
 
       (EBCDIC) before executing the install command, INSMYSQL.
3639
 
       To do this, determine your existing CSSID (using DSPJOB
3640
 
       and selecting option 2), execute CHGJOB CSSID(37), run
3641
 
       INSMYSQL to install MySQL and then execute CHGJOB again
3642
 
       with your original CSSID.
 
3424
     * A problem has been identified with the installation process on
 
3425
       DBCS systems. If you are having problems install MySQL on a
 
3426
       DBCS system, you need to change your job's coded character set
 
3427
       identifier (CSSID) to 37 (EBCDIC) before executing the install
 
3428
       command, INSMYSQL. To do this, determine your existing CSSID
 
3429
       (using DSPJOB and selecting option 2), execute CHGJOB
 
3430
       CSSID(37), run INSMYSQL to install MySQL and then execute
 
3431
       CHGJOB again with your original CSSID.
3643
3432
 
3644
 
     * If you want to use the Perl scripts that are included
3645
 
       with MySQL, you need to download the iSeries Tools for
3646
 
       Developers (5799-PTL). See
 
3433
     * If you want to use the Perl scripts that are included with
 
3434
       MySQL, you need to download the iSeries Tools for Developers
 
3435
       (5799-PTL). See
3647
3436
       http://www-03.ibm.com/servers/enable/site/porting/tools/.
3648
3437
 
3649
3438
2.8. Installing MySQL on NetWare
3650
3439
 
3651
3440
   Porting MySQL to NetWare was an effort spearheaded by Novell.
3652
 
   Novell customers should be pleased to note that NetWare 6.5
3653
 
   ships with bundled MySQL binaries, complete with an automatic
3654
 
   commercial use license for all servers running that version
3655
 
   of NetWare.
 
3441
   Novell customers should be pleased to note that NetWare 6.5 ships
 
3442
   with bundled MySQL binaries, complete with an automatic commercial
 
3443
   use license for all servers running that version of NetWare.
3656
3444
 
3657
 
   MySQL for NetWare is compiled using a combination of
3658
 
   Metrowerks CodeWarrior for NetWare and special
3659
 
   cross-compilation versions of the GNU autotools.
 
3445
   MySQL for NetWare is compiled using a combination of Metrowerks
 
3446
   CodeWarrior for NetWare and special cross-compilation versions of
 
3447
   the GNU autotools.
3660
3448
 
3661
3449
   The latest binary packages for NetWare can be obtained at
3662
 
   http://dev.mysql.com/downloads/. See Section 2.1.3, "How to
3663
 
   Get MySQL."
 
3450
   http://dev.mysql.com/downloads/. See Section 2.1.3, "How to Get
 
3451
   MySQL."
3664
3452
 
3665
 
   To host MySQL, the NetWare server must meet these
3666
 
   requirements:
 
3453
   To host MySQL, the NetWare server must meet these requirements:
3667
3454
 
3668
3455
     * The latest Support Pack of NetWare 6.5
3669
 
       (http://support.novell.com/filefinder/18197/index.html)
3670
 
       must be installed.
3671
 
 
3672
 
     * The system must meet Novell's minimum requirements to run
3673
 
       the respective version of NetWare.
3674
 
 
3675
 
     * MySQL data and the program binaries must be installed on
3676
 
       an NSS volume; traditional volumes are not supported.
 
3456
       (http://support.novell.com/filefinder/18197/index.html) must
 
3457
       be installed.
 
3458
 
 
3459
     * The system must meet Novell's minimum requirements to run the
 
3460
       respective version of NetWare.
 
3461
 
 
3462
     * MySQL data and the program binaries must be installed on an
 
3463
       NSS volume; traditional volumes are not supported.
3677
3464
 
3678
3465
   To install MySQL for NetWare, use the following procedure:
3679
3466
 
3680
 
    1. If you are upgrading from a prior installation, stop the
3681
 
       MySQL server. This is done from the server console, using
3682
 
       the following command:
 
3467
    1. If you are upgrading from a prior installation, stop the MySQL
 
3468
       server. This is done from the server console, using the
 
3469
       following command:
3683
3470
SERVER:  mysqladmin -u root shutdown
3684
3471
 
3685
3472
Note
3686
 
       If the MySQL root user account has a password, you need
3687
 
       to invoke mysqladmin with the -p option and supply the
3688
 
       password when prompted.
3689
 
 
3690
 
    2. Log on to the target server from a client machine with
3691
 
       access to the location where you are installing MySQL.
3692
 
 
3693
 
    3. Extract the binary package Zip file onto the server. Be
3694
 
       sure to allow the paths in the Zip file to be used. It is
3695
 
       safe to simply extract the file to SYS:\.
3696
 
       If you are upgrading from a prior installation, you may
3697
 
       need to copy the data directory (for example,
3698
 
       SYS:MYSQL\DATA), as well as my.cnf, if you have
3699
 
       customized it. You can then delete the old copy of MySQL.
 
3473
       If the MySQL root user account has a password, you need to
 
3474
       invoke mysqladmin with the -p option and supply the password
 
3475
       when prompted.
 
3476
 
 
3477
    2. Log on to the target server from a client machine with access
 
3478
       to the location where you are installing MySQL.
 
3479
 
 
3480
    3. Extract the binary package Zip file onto the server. Be sure
 
3481
       to allow the paths in the Zip file to be used. It is safe to
 
3482
       simply extract the file to SYS:\.
 
3483
       If you are upgrading from a prior installation, you may need
 
3484
       to copy the data directory (for example, SYS:MYSQL\DATA), as
 
3485
       well as my.cnf, if you have customized it. You can then delete
 
3486
       the old copy of MySQL.
3700
3487
 
3701
3488
    4. You might want to rename the directory to something more
3702
 
       consistent and easy to use. The examples in this manual
3703
 
       use SYS:MYSQL to refer to the installation directory.
3704
 
       Note that MySQL installation on NetWare does not detect
3705
 
       if a version of MySQL is already installed outside the
3706
 
       NetWare release. Therefore, if you have installed the
3707
 
       latest MySQL version from the Web (for example, MySQL 4.1
3708
 
       or later) in SYS:\MYSQL, you must rename the folder
3709
 
       before upgrading the NetWare server; otherwise, files in
3710
 
       SYS:\MySQL are overwritten by the MySQL version present
3711
 
       in NetWare Support Pack.
 
3489
       consistent and easy to use. The examples in this manual use
 
3490
       SYS:MYSQL to refer to the installation directory.
 
3491
       Note that MySQL installation on NetWare does not detect if a
 
3492
       version of MySQL is already installed outside the NetWare
 
3493
       release. Therefore, if you have installed the latest MySQL
 
3494
       version from the Web (for example, MySQL 4.1 or later) in
 
3495
       SYS:\MYSQL, you must rename the folder before upgrading the
 
3496
       NetWare server; otherwise, files in SYS:\MySQL are overwritten
 
3497
       by the MySQL version present in NetWare Support Pack.
3712
3498
 
3713
 
    5. At the server console, add a search path for the
3714
 
       directory containing the MySQL NLMs. For example:
 
3499
    5. At the server console, add a search path for the directory
 
3500
       containing the MySQL NLMs. For example:
3715
3501
SERVER:  SEARCH ADD SYS:MYSQL\BIN
3716
3502
 
3717
 
 
3718
3503
    6. Initialize the data directory and the grant tables, if
3719
3504
       necessary, by executing mysql_install_db at the server
3720
3505
       console.
3722
3507
    7. Start the MySQL server using mysqld_safe at the server
3723
3508
       console.
3724
3509
 
3725
 
    8. To finish the installation, you should also add the
3726
 
       following commands to autoexec.ncf. For example, if your
3727
 
       MySQL installation is in SYS:MYSQL and you want MySQL to
3728
 
       start automatically, you could add these lines:
 
3510
    8. To finish the installation, you should also add the following
 
3511
       commands to autoexec.ncf. For example, if your MySQL
 
3512
       installation is in SYS:MYSQL and you want MySQL to start
 
3513
       automatically, you could add these lines:
3729
3514
#Starts the MySQL 5.1.x database server
3730
3515
SEARCH ADD SYS:MYSQL\BIN
3731
3516
MYSQLD_SAFE
3732
 
 
3733
 
       If you are running MySQL on NetWare 6.0, we strongly
3734
 
       suggest that you use the --skip-external-locking option
3735
 
       on the command line:
 
3517
       If you are running MySQL on NetWare 6.0, we strongly suggest
 
3518
       that you use the --skip-external-locking option on the command
 
3519
       line:
3736
3520
#Starts the MySQL 5.1.x database server
3737
3521
SEARCH ADD SYS:MYSQL\BIN
3738
3522
MYSQLD_SAFE --skip-external-locking
3739
 
 
3740
3523
       It is also necessary to use CHECK TABLE and REPAIR TABLE
3741
 
       instead of myisamchk, because myisamchk makes use of
3742
 
       external locking. External locking is known to have
3743
 
       problems on NetWare 6.0; the problem has been eliminated
3744
 
       in NetWare 6.5. Note that the use of MySQL on Netware 6.0
3745
 
       is not officially supported.
3746
 
       mysqld_safe on NetWare provides a screen presence. When
3747
 
       you unload (shut down) the mysqld_safe NLM, the screen
3748
 
       does not go away by default. Instead, it prompts for user
3749
 
       input:
 
3524
       instead of myisamchk, because myisamchk makes use of external
 
3525
       locking. External locking is known to have problems on NetWare
 
3526
       6.0; the problem has been eliminated in NetWare 6.5. Note that
 
3527
       the use of MySQL on Netware 6.0 is not officially supported.
 
3528
       mysqld_safe on NetWare provides a screen presence. When you
 
3529
       unload (shut down) the mysqld_safe NLM, the screen does not go
 
3530
       away by default. Instead, it prompts for user input:
3750
3531
*<NLM has terminated; Press any key to close the screen>*
3751
 
 
3752
 
       If you want NetWare to close the screen automatically
3753
 
       instead, use the --autoclose option to mysqld_safe. For
3754
 
       example:
 
3532
       If you want NetWare to close the screen automatically instead,
 
3533
       use the --autoclose option to mysqld_safe. For example:
3755
3534
#Starts the MySQL 5.1.x database server
3756
3535
SEARCH ADD SYS:MYSQL\BIN
3757
3536
MYSQLD_SAFE --autoclose
3758
 
 
3759
 
       The behavior of mysqld_safe on NetWare is described
3760
 
       further in Section 4.3.2, "mysqld_safe --- MySQL Server
3761
 
       Startup Script."
3762
 
 
3763
 
    9. When installing MySQL, either for the first time or
3764
 
       upgrading from a previous version, download and install
3765
 
       the latest and appropriate Perl module and PHP extensions
3766
 
       for NetWare:
 
3537
       The behavior of mysqld_safe on NetWare is described further in
 
3538
       Section 4.3.2, "mysqld_safe --- MySQL Server Startup Script."
 
3539
 
 
3540
    9. When installing MySQL, either for the first time or upgrading
 
3541
       from a previous version, download and install the latest and
 
3542
       appropriate Perl module and PHP extensions for NetWare:
3767
3543
 
3768
3544
          + Perl:
3769
 
            http://forge.novell.com/modules/xfcontent/downloads.
3770
 
            php/perl/Modules/
 
3545
            http://forge.novell.com/modules/xfcontent/downloads.php/p
 
3546
            erl/Modules/
3771
3547
 
3772
3548
          + PHP:
3773
 
            http://forge.novell.com/modules/xfcontent/downloads.
3774
 
            php/php/Modules/
 
3549
            http://forge.novell.com/modules/xfcontent/downloads.php/p
 
3550
            hp/Modules/
3775
3551
 
3776
3552
   If there was an existing installation of MySQL on the NetWare
3777
 
   server, be sure to check for existing MySQL startup commands
3778
 
   in autoexec.ncf, and edit or delete them as necessary.
 
3553
   server, be sure to check for existing MySQL startup commands in
 
3554
   autoexec.ncf, and edit or delete them as necessary.
3779
3555
 
3780
3556
Note
3781
3557
 
3782
 
   The accounts that are listed in the MySQL grant tables
3783
 
   initially have no passwords. After starting the server, you
3784
 
   should set up passwords for them using the instructions in
3785
 
   Section 2.11, "Post-Installation Setup and Testing."
3786
 
 
3787
 
2.9. Installing MySQL from tar.gz Packages on Other Unix-Like
3788
 
Systems
3789
 
 
3790
 
   This section covers the installation of MySQL binary
3791
 
   distributions that are provided for various platforms in the
3792
 
   form of compressed tar files (files with a .tar.gz
3793
 
   extension). See Section 2.1.2.4, "MySQL Binaries Compiled by
3794
 
   Sun Microsystems, Inc.," for a detailed list.
 
3558
   The accounts that are listed in the MySQL grant tables initially
 
3559
   have no passwords. After starting the server, you should set up
 
3560
   passwords for them using the instructions in Section 2.11,
 
3561
   "Post-Installation Setup and Testing."
 
3562
 
 
3563
2.9. Installing MySQL from tar.gz Packages on Other Unix-Like Systems
 
3564
 
 
3565
   This section covers the installation of MySQL binary distributions
 
3566
   that are provided for various platforms in the form of compressed
 
3567
   tar files (files with a .tar.gz extension). See Section 2.1.2.4,
 
3568
   "MySQL Binaries Compiled by Sun Microsystems, Inc.," for a
 
3569
   detailed list.
3795
3570
 
3796
3571
   To obtain MySQL, see Section 2.1.3, "How to Get MySQL."
3797
3572
 
3798
3573
   MySQL tar file binary distributions have names of the form
3799
 
   mysql-VERSION-OS.tar.gz, where VERSION is a number (for
3800
 
   example, 5.1.31), and OS indicates the type of operating
3801
 
   system for which the distribution is intended (for example,
3802
 
   pc-linux-i686).
 
3574
   mysql-VERSION-OS.tar.gz, where VERSION is a number (for example,
 
3575
   5.1.35), and OS indicates the type of operating system for which
 
3576
   the distribution is intended (for example, pc-linux-i686).
3803
3577
 
3804
 
   In addition to these generic packages, we also offer binaries
3805
 
   in platform-specific package formats for selected platforms.
3806
 
   See Section 2.2, "Standard MySQL Installation Using a Binary
 
3578
   In addition to these generic packages, we also offer binaries in
 
3579
   platform-specific package formats for selected platforms. See
 
3580
   Section 2.2, "Standard MySQL Installation Using a Binary
3807
3581
   Distribution," for more information on how to install these.
3808
3582
 
3809
 
   You need the following tools to install a MySQL tar file
3810
 
   binary distribution:
 
3583
   You need the following tools to install a MySQL tar file binary
 
3584
   distribution:
3811
3585
 
3812
3586
     * GNU gunzip to uncompress the distribution.
3813
3587
 
3814
 
     * A reasonable tar to unpack the distribution. GNU tar is
3815
 
       known to work. Some operating systems come with a
3816
 
       preinstalled version of tar that is known to have
3817
 
       problems. For example, the tar provided with early
3818
 
       versions of Mac OS X, SunOS 4.x and Solaris 8 and earlier
3819
 
       are known to have problems with long filenames. On Mac OS
3820
 
       X, you can use the preinstalled gnutar program. On other
3821
 
       systems with a deficient tar, you should install GNU tar
3822
 
       first.
 
3588
     * A reasonable tar to unpack the distribution. GNU tar is known
 
3589
       to work. Some operating systems come with a preinstalled
 
3590
       version of tar that is known to have problems. For example,
 
3591
       the tar provided with early versions of Mac OS X, SunOS 4.x
 
3592
       and Solaris 8 and earlier are known to have problems with long
 
3593
       file names. On Mac OS X, you can use the preinstalled gnutar
 
3594
       program. On other systems with a deficient tar, you should
 
3595
       install GNU tar first.
3823
3596
 
3824
 
   If you run into problems and need to file a bug report,
3825
 
   please use the instructions in Section 1.6, "How to Report
3826
 
   Bugs or Problems."
 
3597
   If you run into problems and need to file a bug report, please use
 
3598
   the instructions in Section 1.6, "How to Report Bugs or Problems."
3827
3599
 
3828
3600
   The basic commands that you must execute to install and use a
3829
3601
   MySQL binary distribution are:
3842
3614
 
3843
3615
Note
3844
3616
 
3845
 
   This procedure does not set up any passwords for MySQL
3846
 
   accounts. After following the procedure, proceed to Section
3847
 
   2.11, "Post-Installation Setup and Testing."
 
3617
   This procedure does not set up any passwords for MySQL accounts.
 
3618
   After following the procedure, proceed to Section 2.11,
 
3619
   "Post-Installation Setup and Testing."
3848
3620
 
3849
3621
   A more detailed version of the preceding description for
3850
3622
   installing a binary distribution follows:
3852
3624
    1. Add a login user and group for mysqld to run as:
3853
3625
shell> groupadd mysql
3854
3626
shell> useradd -g mysql mysql
3855
 
 
3856
 
       These commands add the mysql group and the mysql user.
3857
 
       The syntax for useradd and groupadd may differ slightly
3858
 
       on different versions of Unix, or they may have different
3859
 
       names such as adduser and addgroup.
 
3627
       These commands add the mysql group and the mysql user. The
 
3628
       syntax for useradd and groupadd may differ slightly on
 
3629
       different versions of Unix, or they may have different names
 
3630
       such as adduser and addgroup.
3860
3631
       You might want to call the user and group something else
3861
 
       instead of mysql. If so, substitute the appropriate name
3862
 
       in the following steps.
 
3632
       instead of mysql. If so, substitute the appropriate name in
 
3633
       the following steps.
3863
3634
 
3864
3635
    2. Pick the directory under which you want to unpack the
3865
 
       distribution and change location into it. In the
3866
 
       following example, we unpack the distribution under
3867
 
       /usr/local. (The instructions, therefore, assume that you
3868
 
       have permission to create files and directories in
3869
 
       /usr/local. If that directory is protected, you must
3870
 
       perform the installation as root.)
 
3636
       distribution and change location into it. In the following
 
3637
       example, we unpack the distribution under /usr/local. (The
 
3638
       instructions, therefore, assume that you have permission to
 
3639
       create files and directories in /usr/local. If that directory
 
3640
       is protected, you must perform the installation as root.)
3871
3641
shell> cd /usr/local
3872
3642
 
3873
 
 
3874
 
    3. Obtain a distribution file using the instructions in
3875
 
       Section 2.1.3, "How to Get MySQL." For a given release,
3876
 
       binary distributions for all platforms are built from the
3877
 
       same MySQL source distribution.
 
3643
    3. Obtain a distribution file using the instructions in Section
 
3644
       2.1.3, "How to Get MySQL." For a given release, binary
 
3645
       distributions for all platforms are built from the same MySQL
 
3646
       source distribution.
3878
3647
 
3879
3648
    4. Unpack the distribution, which creates the installation
3880
3649
       directory. Then create a symbolic link to that directory:
3881
3650
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
3882
3651
shell> ln -s full-path-to-mysql-VERSION-OS mysql
3883
 
 
3884
 
       The tar command creates a directory named
3885
 
       mysql-VERSION-OS. The ln command makes a symbolic link to
3886
 
       that directory. This lets you refer more easily to the
3887
 
       installation directory as /usr/local/mysql.
3888
 
       With GNU tar, no separate invocation of gunzip is
3889
 
       necessary. You can replace the first line with the
3890
 
       following alternative command to uncompress and extract
3891
 
       the distribution:
 
3652
       The tar command creates a directory named mysql-VERSION-OS.
 
3653
       The ln command makes a symbolic link to that directory. This
 
3654
       lets you refer more easily to the installation directory as
 
3655
       /usr/local/mysql.
 
3656
       With GNU tar, no separate invocation of gunzip is necessary.
 
3657
       You can replace the first line with the following alternative
 
3658
       command to uncompress and extract the distribution:
3892
3659
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
3893
3660
 
3894
 
 
3895
3661
    5. Change location into the installation directory:
3896
3662
shell> cd mysql
3897
 
 
3898
 
       You will find several files and subdirectories in the
3899
 
       mysql directory. The most important for installation
3900
 
       purposes are the bin and scripts subdirectories:
 
3663
       You will find several files and subdirectories in the mysql
 
3664
       directory. The most important for installation purposes are
 
3665
       the bin and scripts subdirectories:
3901
3666
 
3902
3667
          + The bin directory contains client programs and the
3903
 
            server. You should add the full pathname of this
3904
 
            directory to your PATH environment variable so that
3905
 
            your shell finds the MySQL programs properly. See
3906
 
            Section 2.15, "Environment Variables."
 
3668
            server. You should add the full path name of this
 
3669
            directory to your PATH environment variable so that your
 
3670
            shell finds the MySQL programs properly. See Section
 
3671
            2.14, "Environment Variables."
3907
3672
 
3908
3673
          + The scripts directory contains the mysql_install_db
3909
 
            script used to initialize the mysql database
3910
 
            containing the grant tables that store the server
3911
 
            access permissions.
 
3674
            script used to initialize the mysql database containing
 
3675
            the grant tables that store the server access
 
3676
            permissions.
3912
3677
 
3913
 
    6. Ensure that the distribution contents are accessible to
3914
 
       mysql. If you unpacked the distribution as mysql, no
3915
 
       further action is required. If you unpacked the
3916
 
       distribution as root, its contents will be owned by root.
3917
 
       Change its ownership to mysql by executing the following
3918
 
       commands as root in the installation directory:
 
3678
    6. Ensure that the distribution contents are accessible to mysql.
 
3679
       If you unpacked the distribution as mysql, no further action
 
3680
       is required. If you unpacked the distribution as root, its
 
3681
       contents will be owned by root. Change its ownership to mysql
 
3682
       by executing the following commands as root in the
 
3683
       installation directory:
3919
3684
shell> chown -R mysql .
3920
3685
shell> chgrp -R mysql .
3921
 
 
3922
 
       The first command changes the owner attribute of the
3923
 
       files to the mysql user. The second changes the group
3924
 
       attribute to the mysql group.
3925
 
 
3926
 
    7. If you have not installed MySQL before, you must create
3927
 
       the MySQL data directory and initialize the grant tables:
 
3686
       The first command changes the owner attribute of the files to
 
3687
       the mysql user. The second changes the group attribute to the
 
3688
       mysql group.
 
3689
 
 
3690
    7. If you have not installed MySQL before, you must create the
 
3691
       MySQL data directory and initialize the grant tables:
3928
3692
shell> scripts/mysql_install_db --user=mysql
3929
 
 
3930
 
       If you run the command as root, include the --user option
3931
 
       as shown. If you run the command while logged in as that
3932
 
       user, you can omit the --user option.
3933
 
       The command should create the data directory and its
3934
 
       contents with mysql as the owner.
 
3693
       If you run the command as root, include the --user option as
 
3694
       shown. If you run the command while logged in as that user,
 
3695
       you can omit the --user option.
 
3696
       The command should create the data directory and its contents
 
3697
       with mysql as the owner.
3935
3698
       After creating or updating the grant tables, you need to
3936
3699
       restart the server manually.
3937
3700
 
3938
 
    8. Most of the MySQL installation can be owned by root if
3939
 
       you like. The exception is that the data directory must
3940
 
       be owned by mysql. To accomplish this, run the following
3941
 
       commands as root in the installation directory:
 
3701
    8. Most of the MySQL installation can be owned by root if you
 
3702
       like. The exception is that the data directory must be owned
 
3703
       by mysql. To accomplish this, run the following commands as
 
3704
       root in the installation directory:
3942
3705
shell> chown -R root .
3943
3706
shell> chown -R mysql data
3944
3707
 
3945
 
 
3946
 
    9. If you want MySQL to start automatically when you boot
3947
 
       your machine, you can copy support-files/mysql.server to
3948
 
       the location where your system has its startup files.
3949
 
       More information can be found in the
3950
 
       support-files/mysql.server script itself and in Section
3951
 
       2.11.2.2, "Starting and Stopping MySQL Automatically."
3952
 
   10. You can set up new accounts using the
3953
 
       bin/mysql_setpermission script if you install the DBI and
3954
 
       DBD::mysql Perl modules. See Section 4.6.14,
3955
 
       "mysql_setpermission --- Interactively Set Permissions in
3956
 
       Grant Tables." For Perl module installation instructions,
3957
 
       see Section 2.16, "Perl Installation Notes."
 
3708
    9. If you want MySQL to start automatically when you boot your
 
3709
       machine, you can copy support-files/mysql.server to the
 
3710
       location where your system has its startup files. More
 
3711
       information can be found in the support-files/mysql.server
 
3712
       script itself and in Section 2.11.2.2, "Starting and Stopping
 
3713
       MySQL Automatically."
 
3714
   10. You can set up new accounts using the bin/mysql_setpermission
 
3715
       script if you install the DBI and DBD::mysql Perl modules. See
 
3716
       Section 4.6.14, "mysql_setpermission --- Interactively Set
 
3717
       Permissions in Grant Tables." For Perl module installation
 
3718
       instructions, see Section 2.15, "Perl Installation Notes."
3958
3719
   11. If you would like to use mysqlaccess and have the MySQL
3959
 
       distribution in some non-standard location, you must
3960
 
       change the location where mysqlaccess expects to find the
3961
 
       mysql client. Edit the bin/mysqlaccess script at
3962
 
       approximately line 18. Search for a line that looks like
3963
 
       this:
 
3720
       distribution in some non-standard location, you must change
 
3721
       the location where mysqlaccess expects to find the mysql
 
3722
       client. Edit the bin/mysqlaccess script at approximately line
 
3723
       18. Search for a line that looks like this:
3964
3724
$MYSQL     = '/usr/local/bin/mysql';    # path to mysql executable
3965
 
 
3966
 
       Change the path to reflect the location where mysql
3967
 
       actually is stored on your system. If you do not do this,
3968
 
       a Broken pipe error will occur when you run mysqlaccess.
3969
 
 
3970
 
   After everything has been unpacked and installed, you should
3971
 
   test your distribution. To start the MySQL server, use the
3972
 
   following command:
 
3725
       Change the path to reflect the location where mysql actually
 
3726
       is stored on your system. If you do not do this, a Broken pipe
 
3727
       error will occur when you run mysqlaccess.
 
3728
 
 
3729
   After everything has been unpacked and installed, you should test
 
3730
   your distribution. To start the MySQL server, use the following
 
3731
   command:
3973
3732
shell> bin/mysqld_safe --user=mysql &
3974
3733
 
3975
 
   If you run the command as root, you must use the --user
3976
 
   option as shown. The value of the option is the name of the
3977
 
   login account that you created in the first step to use for
3978
 
   running the server. If you run the command while logged in as
3979
 
   mysql, you can omit the --user option.
 
3734
   If you run the command as root, you must use the --user option as
 
3735
   shown. The value of the option is the name of the login account
 
3736
   that you created in the first step to use for running the server.
 
3737
   If you run the command while logged in as mysql, you can omit the
 
3738
   --user option.
3980
3739
 
3981
 
   If the command fails immediately and prints mysqld ended, you
3982
 
   can find some information in the host_name.err file in the
3983
 
   data directory.
 
3740
   If the command fails immediately and prints mysqld ended, you can
 
3741
   find some information in the host_name.err file in the data
 
3742
   directory.
3984
3743
 
3985
3744
   More information about mysqld_safe is given in Section 4.3.2,
3986
3745
   "mysqld_safe --- MySQL Server Startup Script."
3987
3746
 
3988
3747
Note
3989
3748
 
3990
 
   The accounts that are listed in the MySQL grant tables
3991
 
   initially have no passwords. After starting the server, you
3992
 
   should set up passwords for them using the instructions in
3993
 
   Section 2.11, "Post-Installation Setup and Testing."
 
3749
   The accounts that are listed in the MySQL grant tables initially
 
3750
   have no passwords. After starting the server, you should set up
 
3751
   passwords for them using the instructions in Section 2.11,
 
3752
   "Post-Installation Setup and Testing."
3994
3753
 
3995
3754
2.10. MySQL Installation Using a Source Distribution
3996
3755
 
3997
 
   Before you proceed with an installation from source, first
3998
 
   check whether our binary is available for your platform and
3999
 
   whether it works for you. We put a great deal of effort into
4000
 
   ensuring that our binaries are built with the best possible
4001
 
   options.
4002
 
 
4003
 
   To obtain a source distribution for MySQL, Section 2.1.3,
4004
 
   "How to Get MySQL." If you want to build MySQL from source on
4005
 
   Windows, see Section 2.10.6, "Installing MySQL from Source on
4006
 
   Windows."
4007
 
 
4008
 
   MySQL source distributions are provided as compressed tar
4009
 
   archives and have names of the form mysql-VERSION.tar.gz,
4010
 
   where VERSION is a number like 5.1.31.
 
3756
   Before you proceed with an installation from source, first check
 
3757
   whether our binary is available for your platform and whether it
 
3758
   works for you. We put a great deal of effort into ensuring that
 
3759
   our binaries are built with the best possible options.
 
3760
 
 
3761
   To obtain a source distribution for MySQL, Section 2.1.3, "How to
 
3762
   Get MySQL." If you want to build MySQL from source on Windows, see
 
3763
   Section 2.10.6, "Installing MySQL from Source on Windows."
 
3764
 
 
3765
   MySQL source distributions are provided as compressed tar archives
 
3766
   and have names of the form mysql-VERSION.tar.gz, where VERSION is
 
3767
   a number like 5.1.35.
4011
3768
 
4012
3769
   You need the following tools to build and install MySQL from
4013
3770
   source:
4014
3771
 
4015
3772
     * GNU gunzip to uncompress the distribution.
4016
3773
 
4017
 
     * A reasonable tar to unpack the distribution. GNU tar is
4018
 
       known to work. Some operating systems come with a
4019
 
       preinstalled version of tar that is known to have
4020
 
       problems. For example, the tar provided with early
4021
 
       versions of Mac OS X, SunOS 4.x and Solaris 8 and earlier
4022
 
       are known to have problems with long filenames. On Mac OS
4023
 
       X, you can use the preinstalled gnutar program. On other
4024
 
       systems with a deficient tar, you should install GNU tar
4025
 
       first.
4026
 
 
4027
 
     * A working ANSI C++ compiler. gcc 2.95.2 or later, SGI
4028
 
       C++, and SunPro C++ are some of the compilers that are
4029
 
       known to work. libg++ is not needed when using gcc. gcc
4030
 
       2.7.x has a bug that makes it impossible to compile some
4031
 
       perfectly legal C++ files, such as sql/sql_base.cc. If
4032
 
       you have only gcc 2.7.x, you must upgrade your gcc to be
4033
 
       able to compile MySQL. gcc 2.8.1 is also known to have
4034
 
       problems on some platforms, so it should be avoided if a
4035
 
       newer compiler exists for the platform. gcc 2.95.2 or
4036
 
       later is recommended.
4037
 
 
4038
 
     * A good make program. GNU make is always recommended and
4039
 
       is sometimes required. (BSD make fails, and
4040
 
       vendor-provided make implementations may fail as well.)
4041
 
       If you have problems, we recommend GNU make 3.75 or
4042
 
       newer.
 
3774
     * A reasonable tar to unpack the distribution. GNU tar is known
 
3775
       to work. Some operating systems come with a preinstalled
 
3776
       version of tar that is known to have problems. For example,
 
3777
       the tar provided with early versions of Mac OS X, SunOS 4.x
 
3778
       and Solaris 8 and earlier are known to have problems with long
 
3779
       file names. On Mac OS X, you can use the preinstalled gnutar
 
3780
       program. On other systems with a deficient tar, you should
 
3781
       install GNU tar first.
 
3782
 
 
3783
     * A working ANSI C++ compiler. gcc 2.95.2 or later, SGI C++, and
 
3784
       SunPro C++ are some of the compilers that are known to work.
 
3785
       libg++ is not needed when using gcc. gcc 2.7.x has a bug that
 
3786
       makes it impossible to compile some perfectly legal C++ files,
 
3787
       such as sql/sql_base.cc. If you have only gcc 2.7.x, you must
 
3788
       upgrade your gcc to be able to compile MySQL. gcc 2.8.1 is
 
3789
       also known to have problems on some platforms, so it should be
 
3790
       avoided if a newer compiler exists for the platform. gcc
 
3791
       2.95.2 or later is recommended.
 
3792
 
 
3793
     * A good make program. GNU make is always recommended and is
 
3794
       sometimes required. (BSD make fails, and vendor-provided make
 
3795
       implementations may fail as well.) If you have problems, we
 
3796
       recommend GNU make 3.75 or newer.
4043
3797
 
4044
3798
     * libtool 1.5.24 or later is also recommended.
4045
3799
 
4046
 
   If you are using a version of gcc recent enough to understand
4047
 
   the -fno-exceptions option, it is very important that you use
4048
 
   this option. Otherwise, you may compile a binary that crashes
4049
 
   randomly. We also recommend that you use -felide-constructors
4050
 
   and -fno-rtti along with -fno-exceptions. When in doubt, do
4051
 
   the following:
 
3800
   If you are using a version of gcc recent enough to understand the
 
3801
   -fno-exceptions option, it is very important that you use this
 
3802
   option. Otherwise, you may compile a binary that crashes randomly.
 
3803
   We also recommend that you use -felide-constructors and -fno-rtti
 
3804
   along with -fno-exceptions. When in doubt, do the following:
4052
3805
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
4053
3806
       -fno-exceptions -fno-rtti" ./configure \
4054
3807
       --prefix=/usr/local/mysql --enable-assembler \
4056
3809
 
4057
3810
   On most systems, this gives you a fast and stable binary.
4058
3811
 
4059
 
   If you run into problems and need to file a bug report,
4060
 
   please use the instructions in Section 1.6, "How to Report
4061
 
   Bugs or Problems."
 
3812
   If you run into problems and need to file a bug report, please use
 
3813
   the instructions in Section 1.6, "How to Report Bugs or Problems."
4062
3814
 
4063
3815
2.10.1. Source Installation Overview
4064
3816
 
4065
 
   The basic commands that you must execute to install a MySQL
4066
 
   source distribution are:
 
3817
   The basic commands that you must execute to install a MySQL source
 
3818
   distribution are:
4067
3819
shell> groupadd mysql
4068
3820
shell> useradd -g mysql mysql
4069
3821
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
4083
3835
   If you start from a source RPM, do the following:
4084
3836
shell> rpmbuild --rebuild --clean MySQL-VERSION.src.rpm
4085
3837
 
4086
 
   This makes a binary RPM that you can install. For older
4087
 
   versions of RPM, you may have to replace the command rpmbuild
4088
 
   with rpm instead.
 
3838
   This makes a binary RPM that you can install. For older versions
 
3839
   of RPM, you may have to replace the command rpmbuild with rpm
 
3840
   instead.
4089
3841
 
4090
3842
Note
4091
3843
 
4092
 
   This procedure does not set up any passwords for MySQL
4093
 
   accounts. After following the procedure, proceed to Section
4094
 
   2.11, "Post-Installation Setup and Testing," for
4095
 
   post-installation setup and testing.
 
3844
   This procedure does not set up any passwords for MySQL accounts.
 
3845
   After following the procedure, proceed to Section 2.11,
 
3846
   "Post-Installation Setup and Testing," for post-installation setup
 
3847
   and testing.
4096
3848
 
4097
3849
   A more detailed version of the preceding description for
4098
3850
   installing MySQL from a source distribution follows:
4100
3852
    1. Add a login user and group for mysqld to run as:
4101
3853
shell> groupadd mysql
4102
3854
shell> useradd -g mysql mysql
4103
 
 
4104
 
       These commands add the mysql group and the mysql user.
4105
 
       The syntax for useradd and groupadd may differ slightly
4106
 
       on different versions of Unix, or they may have different
4107
 
       names such as adduser and addgroup.
 
3855
       These commands add the mysql group and the mysql user. The
 
3856
       syntax for useradd and groupadd may differ slightly on
 
3857
       different versions of Unix, or they may have different names
 
3858
       such as adduser and addgroup.
4108
3859
       You might want to call the user and group something else
4109
 
       instead of mysql. If so, substitute the appropriate name
4110
 
       in the following steps.
 
3860
       instead of mysql. If so, substitute the appropriate name in
 
3861
       the following steps.
4111
3862
 
4112
3863
    2. Perform the following steps as the mysql user, except as
4113
3864
       noted.
4115
3866
    3. Pick the directory under which you want to unpack the
4116
3867
       distribution and change location into it.
4117
3868
 
4118
 
    4. Obtain a distribution file using the instructions in
4119
 
       Section 2.1.3, "How to Get MySQL."
 
3869
    4. Obtain a distribution file using the instructions in Section
 
3870
       2.1.3, "How to Get MySQL."
4120
3871
 
4121
3872
    5. Unpack the distribution into the current directory:
4122
3873
shell> gunzip < /path/to/mysql-VERSION.tar.gz | tar xvf -
4123
 
 
4124
3874
       This command creates a directory named mysql-VERSION.
4125
 
       With GNU tar, no separate invocation of gunzip is
4126
 
       necessary. You can use the following alternative command
4127
 
       to uncompress and extract the distribution:
 
3875
       With GNU tar, no separate invocation of gunzip is necessary.
 
3876
       You can use the following alternative command to uncompress
 
3877
       and extract the distribution:
4128
3878
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
4129
3879
 
4130
 
 
4131
 
    6. Change location into the top-level directory of the
4132
 
       unpacked distribution:
 
3880
    6. Change location into the top-level directory of the unpacked
 
3881
       distribution:
4133
3882
shell> cd mysql-VERSION
4134
 
 
4135
 
       Note that currently you must configure and build MySQL
4136
 
       from this top-level directory. You cannot build it in a
4137
 
       different directory.
 
3883
       Note that currently you must configure and build MySQL from
 
3884
       this top-level directory. You cannot build it in a different
 
3885
       directory.
4138
3886
 
4139
3887
    7. Configure the release and compile everything:
4140
3888
shell> ./configure --prefix=/usr/local/mysql
4141
3889
shell> make
4142
 
 
4143
3890
       When you run configure, you might want to specify other
4144
 
       options. Run ./configure --help for a list of options.
4145
 
       Section 2.10.2, "Typical configure Options," discusses
4146
 
       some of the more useful options.
4147
 
       If configure fails and you are going to send mail to a
4148
 
       MySQL mailing list to ask for assistance, please include
4149
 
       any lines from config.log that you think can help solve
4150
 
       the problem. Also include the last couple of lines of
4151
 
       output from configure. To file a bug report, please use
4152
 
       the instructions in Section 1.6, "How to Report Bugs or
4153
 
       Problems."
 
3891
       options. Run ./configure --help for a list of options. Section
 
3892
       2.10.2, "Typical configure Options," discusses some of the
 
3893
       more useful options.
 
3894
       If configure fails and you are going to send mail to a MySQL
 
3895
       mailing list to ask for assistance, please include any lines
 
3896
       from config.log that you think can help solve the problem.
 
3897
       Also include the last couple of lines of output from
 
3898
       configure. To file a bug report, please use the instructions
 
3899
       in Section 1.6, "How to Report Bugs or Problems."
4154
3900
       If the compile fails, see Section 2.10.4, "Dealing with
4155
3901
       Problems Compiling MySQL," for help.
4156
3902
 
4157
3903
    8. Install the distribution:
4158
3904
shell> make install
4159
 
 
4160
3905
       You might need to run this command as root.
4161
 
       If you want to set up an option file, use one of those
4162
 
       present in the support-files directory as a template. For
4163
 
       example:
 
3906
       If you want to set up an option file, use one of those present
 
3907
       in the support-files directory as a template. For example:
4164
3908
shell> cp support-files/my-medium.cnf /etc/my.cnf
4165
 
 
4166
3909
       You might need to run this command as root.
4167
 
       If you want to configure support for InnoDB tables, you
4168
 
       should edit the /etc/my.cnf file, remove the # character
4169
 
       before the option lines that start with innodb_..., and
4170
 
       modify the option values to be what you want. See Section
4171
 
       4.2.3.2, "Using Option Files," and Section 13.6.2,
4172
 
       "InnoDB Configuration."
 
3910
       If you want to configure support for InnoDB tables, you should
 
3911
       edit the /etc/my.cnf file, remove the # character before the
 
3912
       option lines that start with innodb_..., and modify the option
 
3913
       values to be what you want. See Section 4.2.3.2, "Using Option
 
3914
       Files," and Section 13.6.2, "InnoDB Configuration."
4173
3915
 
4174
3916
    9. Change location into the installation directory:
4175
3917
shell> cd /usr/local/mysql
4176
 
 
4177
 
   10. If you ran the make install command as root, the
4178
 
       installed files will be owned by root. Ensure that the
4179
 
       installation is accessible to mysql by executing the
4180
 
       following commands as root in the installation directory:
 
3918
   10. If you ran the make install command as root, the installed
 
3919
       files will be owned by root. Ensure that the installation is
 
3920
       accessible to mysql by executing the following commands as
 
3921
       root in the installation directory:
4181
3922
shell> chown -R mysql .
4182
3923
shell> chgrp -R mysql .
4183
 
 
4184
 
       The first command changes the owner attribute of the
4185
 
       files to the mysql user. The second changes the group
4186
 
       attribute to the mysql group.
4187
 
   11. If you have not installed MySQL before, you must create
4188
 
       the MySQL data directory and initialize the grant tables:
 
3924
       The first command changes the owner attribute of the files to
 
3925
       the mysql user. The second changes the group attribute to the
 
3926
       mysql group.
 
3927
   11. If you have not installed MySQL before, you must create the
 
3928
       MySQL data directory and initialize the grant tables:
4189
3929
shell> bin/mysql_install_db --user=mysql
4190
 
 
4191
 
       If you run the command as root, include the --user option
4192
 
       as shown. If you run the command while logged in as
4193
 
       mysql, you can omit the --user option.
4194
 
       The command should create the data directory and its
4195
 
       contents with mysql as the owner.
4196
 
       After using mysql_install_db to create the grant tables
4197
 
       for MySQL, you must restart the server manually. The
4198
 
       mysqld_safe command to do this is shown in a later step.
4199
 
   12. Most of the MySQL installation can be owned by root if
4200
 
       you like. The exception is that the data directory must
4201
 
       be owned by mysql. To accomplish this, run the following
4202
 
       commands as root in the installation directory:
 
3930
       If you run the command as root, include the --user option as
 
3931
       shown. If you run the command while logged in as mysql, you
 
3932
       can omit the --user option.
 
3933
       The command should create the data directory and its contents
 
3934
       with mysql as the owner.
 
3935
       After using mysql_install_db to create the grant tables for
 
3936
       MySQL, you must restart the server manually. The mysqld_safe
 
3937
       command to do this is shown in a later step.
 
3938
   12. Most of the MySQL installation can be owned by root if you
 
3939
       like. The exception is that the data directory must be owned
 
3940
       by mysql. To accomplish this, run the following commands as
 
3941
       root in the installation directory:
4203
3942
shell> chown -R root .
4204
3943
shell> chown -R mysql var
4205
 
 
4206
 
   13. If you want MySQL to start automatically when you boot
4207
 
       your machine, you can copy support-files/mysql.server to
4208
 
       the location where your system has its startup files.
4209
 
       More information can be found in the
4210
 
       support-files/mysql.server script itself; see also
4211
 
       Section 2.11.2.2, "Starting and Stopping MySQL
4212
 
       Automatically."
4213
 
   14. You can set up new accounts using the
4214
 
       bin/mysql_setpermission script if you install the DBI and
4215
 
       DBD::mysql Perl modules. See Section 4.6.14,
4216
 
       "mysql_setpermission --- Interactively Set Permissions in
4217
 
       Grant Tables." For Perl module installation instructions,
4218
 
       see Section 2.16, "Perl Installation Notes."
 
3944
   13. If you want MySQL to start automatically when you boot your
 
3945
       machine, you can copy support-files/mysql.server to the
 
3946
       location where your system has its startup files. More
 
3947
       information can be found in the support-files/mysql.server
 
3948
       script itself; see also Section 2.11.2.2, "Starting and
 
3949
       Stopping MySQL Automatically."
 
3950
   14. You can set up new accounts using the bin/mysql_setpermission
 
3951
       script if you install the DBI and DBD::mysql Perl modules. See
 
3952
       Section 4.6.14, "mysql_setpermission --- Interactively Set
 
3953
       Permissions in Grant Tables." For Perl module installation
 
3954
       instructions, see Section 2.15, "Perl Installation Notes."
4219
3955
 
4220
3956
   After everything has been installed, you should test your
4221
3957
   distribution. To start the MySQL server, use the following
4222
3958
   command:
4223
3959
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
4224
3960
 
4225
 
   If you run the command as root, you should use the --user
4226
 
   option as shown. The value of the option is the name of the
4227
 
   login account that you created in the first step to use for
4228
 
   running the server. If you run the command while logged in as
4229
 
   that user, you can omit the --user option.
 
3961
   If you run the command as root, you should use the --user option
 
3962
   as shown. The value of the option is the name of the login account
 
3963
   that you created in the first step to use for running the server.
 
3964
   If you run the command while logged in as that user, you can omit
 
3965
   the --user option.
4230
3966
 
4231
 
   If the command fails immediately and prints mysqld ended, you
4232
 
   can find some information in the host_name.err file in the
4233
 
   data directory.
 
3967
   If the command fails immediately and prints mysqld ended, you can
 
3968
   find some information in the host_name.err file in the data
 
3969
   directory.
4234
3970
 
4235
3971
   More information about mysqld_safe is given in Section 4.3.2,
4236
3972
   "mysqld_safe --- MySQL Server Startup Script."
4237
3973
 
4238
3974
Note
4239
3975
 
4240
 
   The accounts that are listed in the MySQL grant tables
4241
 
   initially have no passwords. After starting the server, you
4242
 
   should set up passwords for them using the instructions in
4243
 
   Section 2.11, "Post-Installation Setup and Testing."
 
3976
   The accounts that are listed in the MySQL grant tables initially
 
3977
   have no passwords. After starting the server, you should set up
 
3978
   passwords for them using the instructions in Section 2.11,
 
3979
   "Post-Installation Setup and Testing."
4244
3980
 
4245
3981
2.10.2. Typical configure Options
4246
3982
 
4247
 
   The configure script gives you a great deal of control over
4248
 
   how you configure a MySQL source distribution. Typically you
4249
 
   do this using options on the configure command line. You can
4250
 
   also affect configure using certain environment variables.
4251
 
   See Section 2.15, "Environment Variables." For a full list of
4252
 
   options supported by configure, run this command:
 
3983
   The configure script gives you a great deal of control over how
 
3984
   you configure a MySQL source distribution. Typically you do this
 
3985
   using options on the configure command line. You can also affect
 
3986
   configure using certain environment variables. See Section 2.14,
 
3987
   "Environment Variables." For a full list of options supported by
 
3988
   configure, run this command:
4253
3989
shell> ./configure --help
4254
3990
 
4255
 
   A list of the available configure options is provided in the
4256
 
   table below.
 
3991
   A list of the available configure options is provided in the table
 
3992
   below.
4257
3993
 
4258
3994
   Table 2.1. Build (configure) Reference
4259
3995
   Formats Description Default Introduced Removed
4262
3998
   --cache-file=FILE Cache test results in FILE disabled
4263
3999
   -C Alias for `--cache-file=config.cache'
4264
4000
   --config-cache
4265
 
   --datadir=DIR Read-only architecture-independent data
4266
 
   PREFIX/share
 
4001
   --datadir=DIR Read-only architecture-independent data PREFIX/share
 
4002
 
4267
4003
   --disable-FEATURE Do not include FEATURE
4268
4004
   --disable-dependency-tracking Disable dependency tracking
4269
 
 
4270
4005
   --disable-grant-options Disable GRANT options
4271
4006
   --disable-largefile Omit support for large files
4272
4007
   --disable-libtool-lock Disable libtool lock
4273
 
   --disable-thread-safe-client Compile the client without
4274
 
   threads   5.1.7
 
4008
   --disable-thread-safe-client Compile the client without threads
 
4009
   5.1.7
4275
4010
   --enable-FEATURE Enable FEATURE
4276
 
   --enable-assembler Use assembler versions of some string
4277
 
   functions if available
 
4011
   --enable-assembler Use assembler versions of some string functions
 
4012
   if available
4278
4013
   --enable-dependency-tracking Do not reject slow dependency
4279
4014
   extractors
4280
4015
   --enable-fast-install Optimize for fast installation yes
4281
4016
   --enable-local-infile Enable LOAD DATA LOCAL INFILE disabled
4282
 
 
4283
4017
   --enable-shared Build shared libraries yes
4284
4018
   --enable-static Build static libraries yes
4285
4019
   --enable-thread-safe-client Compile the client with threads
4286
 
 
4287
4020
   --exec-prefix=EPREFIX Install architecture-dependent files in
4288
4021
   EPREFIX
4289
4022
   -h Display this help and exit
4292
4025
   --help=recursive Display the short help of all the included
4293
4026
   packages
4294
4027
   --host=HOST Cross-compile to build programs to run on HOST
4295
 
 
4296
4028
   --includedir=DIR C header files PREFIX/include
4297
4029
   --infodir=DIR Info documentation PREFIX/info
4298
4030
   --libdir=DIR Object code libraries EPREFIX/lib
4299
4031
   --libexecdir=DIR Program executables EPREFIX/libexec
4300
4032
   --localstatedir=DIR Modifiable single-machine data PREFIX/var
4301
 
 
4302
4033
   --mandir=DIR man documentation PREFIX/man
4303
4034
   -n Do not create output files
4304
4035
   --no-create
4305
4036
   --oldincludedir=DIR C header files for non-gcc /usr/include
4306
 
 
4307
 
   --prefix=PREFIX Install architecture-independent files in
4308
 
   PREFIX
4309
 
   --program-prefix=PREFIX Prepend PREFIX to installed program
4310
 
   names
4311
 
   --program-suffix=SUFFIX Append SUFFIX to installed program
4312
 
   names
 
4037
   --prefix=PREFIX Install architecture-independent files in PREFIX
 
4038
 
 
4039
   --program-prefix=PREFIX Prepend PREFIX to installed program names
 
4040
 
 
4041
   --program-suffix=SUFFIX Append SUFFIX to installed program names
 
4042
 
4313
4043
   --program-transform-name=PROGRAM run sed PROGRAM on installed
4314
4044
   program names
4315
4045
   -q Do not print `checking...' messages
4317
4047
   --sbindir=DIR System admin executables EPREFIX/sbin
4318
4048
   --sharedstatedir=DIR Modifiable architecture-independent data
4319
4049
   PREFIX/com
4320
 
   --srcdir=DIR Find the sources in DIR configure directory or
4321
 
   ..
 
4050
   --srcdir=DIR Find the sources in DIR configure directory or ..
4322
4051
   --sysconfdir=DIR Read-only single-machine data PREFIX/etc
4323
4052
   --target=TARGET Configure for building compilers for TARGET
4324
 
 
4325
4053
   -V Display version information and exit
4326
4054
   --version
4327
4055
   --with-PACKAGE Use PACKAGE
4328
 
   --with-archive-storage-engine Enable the Archive Storage
4329
 
   Engine no
 
4056
   --with-archive-storage-engine Enable the Archive Storage Engine no
 
4057
 
4330
4058
   --with-atomic-ops Implement atomic operations using pthread
4331
 
   rwlocks or atomic CPU instructions for multi-processor
4332
 
   5.1.12
 
4059
   rwlocks or atomic CPU instructions for multi-processor   5.1.12
4333
4060
   --with-berkeley-db Use BerkeleyDB located in DIR no
4334
4061
   --with-berkeley-db-includes Find Berkeley DB headers in DIR
4335
 
 
4336
4062
   --with-berkeley-db-libs Find Berkeley DB libraries in DIR
4337
 
 
4338
 
   --with-big-tables Support tables with more than 4 G rows even
4339
 
   on 32 bit platforms
 
4063
   --with-big-tables Support tables with more than 4 G rows even on
 
4064
   32 bit platforms
4340
4065
   --with-blackhole-storage-engine Enable the Blackhole Storage
4341
4066
   Engine no
4342
4067
   --with-charset Default character set
4343
4068
   --with-client-ldflags Extra linking arguments for clients
4344
 
 
4345
4069
   --with-collation Default collation
4346
4070
   --with-comment Comment about compilation environment
4347
4071
   --with-csv-storage-engine Enable the CSV Storage Engine yes
4348
 
 
4349
4072
   --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS
4350
4073
   X/Darwin
4351
4074
   --with-debug Add debug code   5.1.7
4352
 
   --with-debug=full Add debug code (adds memory checker, very
4353
 
   slow)
 
4075
   --with-debug=full Add debug code (adds memory checker, very slow)
 
4076
 
4354
4077
   --with-embedded-privilege-control Build parts to check user's
4355
4078
   privileges (only affects embedded library)
4356
4079
   --with-embedded-server Build the embedded server
4357
4080
   --with-error-inject Enable error injection in MySQL Server
4358
4081
   5.1.11
4359
 
   --with-example-storage-engine Enable the Example Storage
4360
 
   Engine no
 
4082
   --with-example-storage-engine Enable the Example Storage Engine no
 
4083
 
4361
4084
   --with-extra-charsets Use charsets in addition to default
4362
 
 
4363
4085
   --with-fast-mutexes Compile with fast mutexes enabled 5.1.5
4364
 
   --with-federated-storage-engine Enable federated storage
4365
 
   engine no 5.1.3 5.1.9
 
4086
   --with-federated-storage-engine Enable federated storage engine no
 
4087
   5.1.3 5.1.9
4366
4088
   --with-gnu-ld Assume the C compiler uses GNU ld no
4367
4089
   --with-innodb Enable innobase storage engine no 5.1.3 5.1.9
4368
4090
   --with-lib-ccflags Extra CC options for libraries
4369
4091
   --with-libwrap=DIR Compile in libwrap (tcp_wrappers) support
4370
 
 
4371
4092
   --with-low-memory Try to use less memory to compile to avoid
4372
4093
   memory limitations
4373
4094
   --with-machine-type Set the machine type, like "powerpc"
4374
 
 
4375
 
   --with-max-indexes=N Sets the maximum number of indexes per
4376
 
   table 64
 
4095
   --with-max-indexes=N Sets the maximum number of indexes per table
 
4096
   64
4377
4097
   --with-mysqld-ldflags Extra linking arguments for mysqld
4378
 
 
4379
4098
   --with-mysqld-libs Extra libraries to link with for mysqld
 
4099
   --with-mysqld-user What user the mysqld daemon shall be run as
4380
4100
 
4381
 
   --with-mysqld-user What user the mysqld daemon shall be run
4382
 
   as
4383
 
   --with-mysqlmanager Build the mysqlmanager binary Build if
4384
 
   server is built
 
4101
   --with-mysqlmanager Build the mysqlmanager binary Build if server
 
4102
   is built
4385
4103
   --with-named-curses-libs Use specified curses libraries
4386
4104
   --with-named-thread-libs Use specified thread libraries
4387
4105
   --with-ndb-ccflags Extra CC options for ndb compile
4389
4107
   documentation
4390
4108
   --with-ndb-port Port for NDB Cluster management server
4391
4109
   --with-ndb-port-base Port for NDB Cluster management server
4392
 
 
4393
 
   --with-ndb-sci=DIR Provide MySQL with a custom location of
4394
 
   sci library
 
4110
   --with-ndb-sci=DIR Provide MySQL with a custom location of sci
 
4111
   library
4395
4112
   --with-ndb-test Include the NDB Cluster ndbapi test programs
4396
 
 
4397
4113
   --with-ndbcluster Include the NDB Cluster table handler no
4398
 
 
4399
4114
   --with-openssl=DIR Include the OpenSSL support
4400
4115
   --with-openssl-includes Find OpenSSL headers in DIR
4401
4116
   --with-openssl-libs Find OpenSSL libraries in DIR
4402
4117
   --with-other-libc=DIR Link against libc and other standard
4403
4118
   libraries installed in the specified non-standard location
4404
 
 
4405
4119
   --with-pic Try to use only PIC/non-PIC objects Use both
4406
 
   --with-plugin-PLUGIN Forces the named plugin to be linked
4407
 
   into mysqld statically   5.1.11
 
4120
   --with-plugin-PLUGIN Forces the named plugin to be linked into
 
4121
   mysqld statically   5.1.11
4408
4122
   --with-plugins Plugins to include in mysqld none 5.1.11
4409
4123
   --with-pstack Use the pstack backtrace library
4410
4124
   --with-pthread Force use of pthread library
4411
 
   --with-row-based-replication Include row-based replication
4412
 
   5.1.5 5.1.6
 
4125
   --with-row-based-replication Include row-based replication   5.1.5
 
4126
   5.1.6
4413
4127
   --with-server-suffix Append value to the version string
4414
4128
   --with-ssl=DIR Include SSL support   5.1.11
4415
4129
   --with-system-type Set the system type, like "sun-solaris10"
4416
 
 
4417
4130
   --with-tags Include additional configurations automatic
4418
4131
   --with-tcp-port Which port to use for MySQL services 3306
4419
4132
   --with-unix-socket-path Where to put the unix-domain socket
4420
 
 
4421
4133
   --with-yassl Include the yaSSL support
4422
4134
   --with-zlib-dir=no|bundled|DIR Provide MySQL with a custom
4423
4135
   location of compression library
4424
4136
   --without-PACKAGE Do not use PACKAGE
4425
4137
   --without-bench Skip building of the benchmark suite
4426
 
   --without-debug Build a production version without debugging
4427
 
   code
 
4138
   --without-debug Build a production version without debugging code
 
4139
 
4428
4140
   --without-docs Skip building of the documentation
4429
4141
   --without-extra-tools Skip building utilities in the tools
4430
4142
   directory
4431
4143
   --without-geometry Do not build geometry-related parts
4432
4144
   --without-libedit Use system libedit instead of bundled copy
4433
 
 
4434
4145
   --without-man Skip building of the man pages
4435
4146
   --without-ndb-binlog Disable ndb binlog   5.1.6
4436
4147
   --without-ndb-debug Disable special ndb debug features
4437
4148
   --without-plugin-PLUGIN Exclude PLUGIN   5.1.11
4438
4149
   --without-query-cache Do not build query cache
4439
 
   --without-readline Use system readline instead of bundled
4440
 
   copy
 
4150
   --without-readline Use system readline instead of bundled copy
 
4151
 
4441
4152
   --without-row-based-replication Don't include row-based
4442
4153
   replication   5.1.7 5.1.14
4443
4154
   --without-server Only build the client
4444
 
   --without-uca Skip building of the national Unicode
4445
 
   collations
4446
 
 
4447
 
   Some of the configure options available are described here:
4448
 
 
4449
 
     * To compile just the MySQL client libraries and client
4450
 
       programs and not the server, use the --without-server
4451
 
       option:
 
4155
   --without-uca Skip building of the national Unicode collations
 
4156
 
 
4157
   Some of the configure options available are described here. For
 
4158
   options that may be of use if you have difficulties building
 
4159
   MySQL, see Section 2.10.4, "Dealing with Problems Compiling
 
4160
   MySQL."
 
4161
 
 
4162
     * To compile just the MySQL client libraries and client programs
 
4163
       and not the server, use the --without-server option:
4452
4164
shell> ./configure --without-server
4453
 
 
4454
4165
       If you have no C++ compiler, some client programs such as
4455
 
       mysql cannot be compiled because they require C++.. In
4456
 
       this case, you can remove the code in configure that
4457
 
       tests for the C++ compiler and then run ./configure with
4458
 
       the --without-server option. The compile step should
4459
 
       still try to build all clients, but you can ignore any
4460
 
       warnings about files such as mysql.cc. (If make stops,
4461
 
       try make -k to tell it to continue with the rest of the
4462
 
       build even if errors occur.)
 
4166
       mysql cannot be compiled because they require C++.. In this
 
4167
       case, you can remove the code in configure that tests for the
 
4168
       C++ compiler and then run ./configure with the
 
4169
       --without-server option. The compile step should still try to
 
4170
       build all clients, but you can ignore any warnings about files
 
4171
       such as mysql.cc. (If make stops, try make -k to tell it to
 
4172
       continue with the rest of the build even if errors occur.)
4463
4173
 
4464
 
     * If you want to build the embedded MySQL library
4465
 
       (libmysqld.a), use the --with-embedded-server option.
 
4174
     * If you want to build the embedded MySQL library (libmysqld.a),
 
4175
       use the --with-embedded-server option.
4466
4176
 
4467
4177
     * If you don't want your log files and database directories
4468
4178
       located under /usr/local/var, use a configure command
4470
4180
shell> ./configure --prefix=/usr/local/mysql
4471
4181
shell> ./configure --prefix=/usr/local \
4472
4182
           --localstatedir=/usr/local/mysql/data
4473
 
 
4474
4183
       The first command changes the installation prefix so that
4475
 
       everything is installed under /usr/local/mysql rather
4476
 
       than the default of /usr/local. The second command
4477
 
       preserves the default installation prefix, but overrides
4478
 
       the default location for database directories (normally
4479
 
       /usr/local/var) and changes it to /usr/local/mysql/data.
 
4184
       everything is installed under /usr/local/mysql rather than the
 
4185
       default of /usr/local. The second command preserves the
 
4186
       default installation prefix, but overrides the default
 
4187
       location for database directories (normally /usr/local/var)
 
4188
       and changes it to /usr/local/mysql/data.
4480
4189
       You can also specify the installation directory and data
4481
4190
       directory locations at server startup time by using the
4482
 
       --basedir and --datadir options. These can be given on
4483
 
       the command line or in an MySQL option file, although it
4484
 
       is more common to use an option file. See Section
4485
 
       4.2.3.2, "Using Option Files."
 
4191
       --basedir and --datadir options. These can be given on the
 
4192
       command line or in an MySQL option file, although it is more
 
4193
       common to use an option file. See Section 4.2.3.2, "Using
 
4194
       Option Files."
4486
4195
 
4487
4196
     * If you are using Unix and you want the MySQL socket file
4488
4197
       location to be somewhere other than the default location
4489
 
       (normally in the directory /tmp or /var/run), use a
4490
 
       configure command like this:
 
4198
       (normally in the directory /tmp or /var/run), use a configure
 
4199
       command like this:
4491
4200
shell> ./configure \
4492
4201
           --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
4493
 
 
4494
 
       The socket filename must be an absolute pathname. You can
4495
 
       also change the location of mysql.sock at server startup
4496
 
       by using a MySQL option file. See Section B.1.4.5, "How
4497
 
       to Protect or Change the MySQL Unix Socket File."
 
4202
       The socket file name must be an absolute path name. You can
 
4203
       also change the location of mysql.sock at server startup by
 
4204
       using a MySQL option file. See Section B.1.4.5, "How to
 
4205
       Protect or Change the MySQL Unix Socket File."
4498
4206
 
4499
4207
     * If you want to compile statically linked programs (for
4500
4208
       example, to make a binary distribution, to get better
4503
4211
shell> ./configure --with-client-ldflags=-all-static \
4504
4212
           --with-mysqld-ldflags=-all-static
4505
4213
 
4506
 
 
4507
4214
     * If you are using gcc and don't have libg++ or libstdc++
4508
4215
       installed, you can tell configure to use gcc as your C++
4509
4216
       compiler:
4510
4217
shell> CC=gcc CXX=gcc ./configure
4511
 
 
4512
 
       When you use gcc as your C++ compiler, it does not
4513
 
       attempt to link in libg++ or libstdc++. This may be a
4514
 
       good thing to do even if you have those libraries
4515
 
       installed. Some versions of them have caused strange
4516
 
       problems for MySQL users in the past.
4517
 
       The following list indicates some compilers and
4518
 
       environment variable settings that are commonly used with
4519
 
       each one.
 
4218
       When you use gcc as your C++ compiler, it does not attempt to
 
4219
       link in libg++ or libstdc++. This may be a good thing to do
 
4220
       even if you have those libraries installed. Some versions of
 
4221
       them have caused strange problems for MySQL users in the past.
 
4222
       The following list indicates some compilers and environment
 
4223
       variable settings that are commonly used with each one.
4520
4224
 
4521
4225
          + gcc 2.7.2:
4522
4226
CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
4523
4227
 
4524
 
 
4525
4228
          + gcc 2.95.2:
4526
4229
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
4527
4230
-felide-constructors -fno-exceptions -fno-rtti"
4528
4231
 
4529
 
 
4530
4232
          + pgcc 2.90.29 or newer:
4531
4233
CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc \
4532
4234
CXXFLAGS="-O3 -mpentiumpro -mstack-align-double \
4533
4235
-felide-constructors -fno-exceptions -fno-rtti"
4534
 
 
4535
 
       In most cases, you can get a reasonably optimized MySQL
4536
 
       binary by using the options from the preceding list and
4537
 
       adding the following options to the configure line:
 
4236
       In most cases, you can get a reasonably optimized MySQL binary
 
4237
       by using the options from the preceding list and adding the
 
4238
       following options to the configure line:
4538
4239
--prefix=/usr/local/mysql --enable-assembler \
4539
4240
--with-mysqld-ldflags=-all-static
4540
 
 
4541
 
       The full configure line would, in other words, be
4542
 
       something like the following for all recent gcc versions:
 
4241
       The full configure line would, in other words, be something
 
4242
       like the following for all recent gcc versions:
4543
4243
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
4544
4244
-felide-constructors -fno-exceptions -fno-rtti" ./configure \
4545
4245
--prefix=/usr/local/mysql --enable-assembler \
4546
4246
--with-mysqld-ldflags=-all-static
4547
 
 
4548
4247
       The binaries we provide on the MySQL Web site at
4549
 
       http://dev.mysql.com/downloads/ are all compiled with
4550
 
       full optimization and should be perfect for most users.
4551
 
       See Section 2.1.2.4, "MySQL Binaries Compiled by Sun
4552
 
       Microsystems, Inc.." There are some configuration
4553
 
       settings you can tweak to build an even faster binary,
4554
 
       but these are only for advanced users. See Section 7.5.6,
4555
 
       "How Compiling and Linking Affects the Speed of MySQL."
4556
 
       If the build fails and produces errors about your
4557
 
       compiler or linker not being able to create the shared
4558
 
       library libmysqlclient.so.N (where N is a version
4559
 
       number), you can work around this problem by giving the
4560
 
       --disable-shared option to configure. In this case,
4561
 
       configure does not build a shared libmysqlclient.so.N
4562
 
       library.
 
4248
       http://dev.mysql.com/downloads/ are all compiled with full
 
4249
       optimization and should be perfect for most users. See Section
 
4250
       2.1.2.4, "MySQL Binaries Compiled by Sun Microsystems, Inc.."
 
4251
       There are some configuration settings you can tweak to build
 
4252
       an even faster binary, but these are only for advanced users.
 
4253
       See Section 7.5.6, "How Compiling and Linking Affects the
 
4254
       Speed of MySQL."
 
4255
       If the build fails and produces errors about your compiler or
 
4256
       linker not being able to create the shared library
 
4257
       libmysqlclient.so.N (where N is a version number), you can
 
4258
       work around this problem by giving the --disable-shared option
 
4259
       to configure. In this case, configure does not build a shared
 
4260
       libmysqlclient.so.N library.
4563
4261
 
4564
4262
     * By default, MySQL uses the latin1 (cp1252 West European)
4565
4263
       character set. To change the default set, use the
4566
4264
       --with-charset option:
4567
4265
shell> ./configure --with-charset=CHARSET
4568
 
 
4569
 
       CHARSET may be one of binary, armscii8, ascii, big5,
4570
 
       cp1250, cp1251, cp1256, cp1257, cp850, cp852, cp866,
4571
 
       cp932, dec8, eucjpms, euckr, gb2312, gbk, geostd8, greek,
4572
 
       hebrew, hp8, keybcs2, koi8r, koi8u, latin1, latin2,
4573
 
       latin5, latin7, macce, macroman, sjis, swe7, tis620,
4574
 
       ucs2, ujis, utf8. See Section 9.2, "The Character Set
4575
 
       Used for Data and Sorting." (Additional character sets
4576
 
       might be available. Check the output from ./configure
4577
 
       --help for the current list.)
4578
 
       The default collation may also be specified. MySQL uses
4579
 
       the latin1_swedish_ci collation by default. To change
4580
 
       this, use the --with-collation option:
 
4266
       CHARSET may be one of binary, armscii8, ascii, big5, cp1250,
 
4267
       cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8,
 
4268
       eucjpms, euckr, gb2312, gbk, geostd8, greek, hebrew, hp8,
 
4269
       keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce,
 
4270
       macroman, sjis, swe7, tis620, ucs2, ujis, utf8. See Section
 
4271
       9.2, "The Character Set Used for Data and Sorting."
 
4272
       (Additional character sets might be available. Check the
 
4273
       output from ./configure --help for the current list.)
 
4274
       The default collation may also be specified. MySQL uses the
 
4275
       latin1_swedish_ci collation by default. To change this, use
 
4276
       the --with-collation option:
4581
4277
shell> ./configure --with-collation=COLLATION
4582
 
 
4583
 
       To change both the character set and the collation, use
4584
 
       both the --with-charset and --with-collation options. The
4585
 
       collation must be a legal collation for the character
4586
 
       set. (Use the SHOW COLLATION statement to determine which
4587
 
       collations are available for each character set.)
 
4278
       To change both the character set and the collation, use both
 
4279
       the --with-charset and --with-collation options. The collation
 
4280
       must be a legal collation for the character set. (Use the SHOW
 
4281
       COLLATION statement to determine which collations are
 
4282
       available for each character set.)
4588
4283
 
4589
4284
Warning
4590
 
       If you change character sets after having created any
4591
 
       tables, you must run myisamchk -r -q
4592
 
       --set-collation=collation_name on every MyISAM table.
4593
 
       Your indexes may be sorted incorrectly otherwise. This
4594
 
       can happen if you install MySQL, create some tables, and
4595
 
       then reconfigure MySQL to use a different character set
4596
 
       and reinstall it.
4597
 
       With the configure option --with-extra-charsets=LIST, you
4598
 
       can define which additional character sets should be
4599
 
       compiled into the server. LIST is one of the following:
 
4285
       If you change character sets after having created any tables,
 
4286
       you must run myisamchk -r -q --set-collation=collation_name on
 
4287
       every MyISAM table. Your indexes may be sorted incorrectly
 
4288
       otherwise. This can happen if you install MySQL, create some
 
4289
       tables, and then reconfigure MySQL to use a different
 
4290
       character set and reinstall it.
 
4291
       With the configure option --with-extra-charsets=LIST, you can
 
4292
       define which additional character sets should be compiled into
 
4293
       the server. LIST is one of the following:
4600
4294
 
4601
4295
          + A list of character set names separated by spaces
4602
4296
 
4604
4298
            dynamically loaded
4605
4299
 
4606
4300
          + all to include all character sets into the binaries
4607
 
       Clients that want to convert characters between the
4608
 
       server and the client should use the SET NAMES statement.
4609
 
       See Section 5.1.4, "Session System Variables," and
4610
 
       Section 9.1.4, "Connection Character Sets and
4611
 
       Collations."
 
4301
       Clients that want to convert characters between the server and
 
4302
       the client should use the SET NAMES statement. See Section
 
4303
       5.1.4, "Session System Variables," and Section 9.1.4,
 
4304
       "Connection Character Sets and Collations."
4612
4305
 
4613
 
     * To configure MySQL with debugging code, use the
4614
 
       --with-debug option:
 
4306
     * To configure MySQL with debugging code, use the --with-debug
 
4307
       option:
4615
4308
shell> ./configure --with-debug
4616
 
 
4617
 
       This causes a safe memory allocator to be included that
4618
 
       can find some errors and that provides output about what
4619
 
       is happening. See MySQL Internals: Porting
 
4309
       This causes a safe memory allocator to be included that can
 
4310
       find some errors and that provides output about what is
 
4311
       happening. See MySQL Internals: Porting
4620
4312
       (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
4621
 
       As of MySQL 5.1.12, using --with-debug to configure MySQL
4622
 
       with debugging support enables you to use the
4623
 
       --debug="d,parser_debug" option when you start the
4624
 
       server. This causes the Bison parser that is used to
4625
 
       process SQL statements to dump a parser trace to the
4626
 
       server's standard error output. Typically, this output is
4627
 
       written to the error log.
 
4313
       As of MySQL 5.1.12, using --with-debug to configure MySQL with
 
4314
       debugging support enables you to use the
 
4315
       --debug="d,parser_debug" option when you start the server.
 
4316
       This causes the Bison parser that is used to process SQL
 
4317
       statements to dump a parser trace to the server's standard
 
4318
       error output. Typically, this output is written to the error
 
4319
       log.
4628
4320
 
4629
 
     * If your client programs are using threads, you must
4630
 
       compile a thread-safe version of the MySQL client library
4631
 
       with the --enable-thread-safe-client configure option.
4632
 
       This creates a libmysqlclient_r library with which you
4633
 
       should link your threaded applications. See Section
4634
 
       21.9.16, "How to Make a Threaded Client."
 
4321
     * If your client programs are using threads, you must compile a
 
4322
       thread-safe version of the MySQL client library with the
 
4323
       --enable-thread-safe-client configure option. This creates a
 
4324
       libmysqlclient_r library with which you should link your
 
4325
       threaded applications. See Section 21.10.17, "How to Make a
 
4326
       Threaded Client."
4635
4327
 
4636
4328
     * Some features require that the server be built with
4637
4329
       compression library support, such as the COMPRESS() and
4638
 
       UNCOMPRESS() functions, and compression of the
4639
 
       client/server protocol. The
4640
 
       --with-zlib-dir=no|bundled|DIR option provides control
4641
 
       for compression library support. The value no explicitly
4642
 
       disables compression support. bundled causes the zlib
4643
 
       library bundled in the MySQL sources to be used. A DIR
4644
 
       pathname specifies where to find the compression library
 
4330
       UNCOMPRESS() functions, and compression of the client/server
 
4331
       protocol. The --with-zlib-dir=no|bundled|DIR option provides
 
4332
       control for compression library support. The value no
 
4333
       explicitly disables compression support. bundled causes the
 
4334
       zlib library bundled in the MySQL sources to be used. A DIR
 
4335
       path name specifies where to find the compression library
4645
4336
       sources.
4646
4337
 
4647
 
     * It is possible to build MySQL with large table support
4648
 
       using the --with-big-tables option.
4649
 
       This option causes the variables that store table row
4650
 
       counts to be declared as unsigned long long rather than
4651
 
       unsigned long. This enables tables to hold up to
4652
 
       approximately 1.844E+19 ((2^32)^2) rows rather than 2^32
4653
 
       (~4.295E+09) rows. Previously it was necessary to pass
4654
 
       -DBIG_TABLES to the compiler manually in order to enable
4655
 
       this feature.
 
4338
     * It is possible to build MySQL with large table support using
 
4339
       the --with-big-tables option.
 
4340
       This option causes the variables that store table row counts
 
4341
       to be declared as unsigned long long rather than unsigned
 
4342
       long. This enables tables to hold up to approximately
 
4343
       1.844E+19 ((2^32)^2) rows rather than 2^32 (~4.295E+09) rows.
 
4344
       Previously it was necessary to pass -DBIG_TABLES to the
 
4345
       compiler manually in order to enable this feature.
4656
4346
 
4657
 
     * Run configure with the --disable-grant-options option to
4658
 
       cause the --bootstrap, --skip-grant-tables, and
4659
 
       --init-file options for mysqld to be disabled. For
4660
 
       Windows, the configure.js script recognizes the
4661
 
       DISABLE_GRANT_OPTIONS flag, which has the same effect.
4662
 
       The capability is available as of MySQL 5.1.15.
 
4347
     * Run configure with the --disable-grant-options option to cause
 
4348
       the --bootstrap, --skip-grant-tables, and --init-file options
 
4349
       for mysqld to be disabled. For Windows, the configure.js
 
4350
       script recognizes the DISABLE_GRANT_OPTIONS flag, which has
 
4351
       the same effect. The capability is available as of MySQL
 
4352
       5.1.15.
4663
4353
 
4664
4354
     * This option allows MySQL Community Server features to be
4665
 
       enabled. Additional options may be required for
4666
 
       individual features, such as --enable-profiling to enable
4667
 
       statement profiling. This option was added in MySQL
4668
 
       5.1.24. It is enabled by default as of MySQL 5.1.28; to
4669
 
       disable it, use --disable-community-features.
 
4355
       enabled. Additional options may be required for individual
 
4356
       features, such as --enable-profiling to enable statement
 
4357
       profiling. This option was added in MySQL 5.1.24. It is
 
4358
       enabled by default as of MySQL 5.1.28; to disable it, use
 
4359
       --disable-community-features.
4670
4360
 
4671
4361
     * When given with --enable-community-features, the
4672
4362
       --enable-profiling option enables the statement profiling
4673
4363
       capability exposed by the SHOW PROFILE and SHOW PROFILES
4674
 
       statements. (See Section 12.5.5.33, "SHOW PROFILES
4675
 
       Syntax.") This option was added in MySQL 5.1.24. It is
4676
 
       enabled by default as of MySQL 5.1.28; to disable it, use
 
4364
       statements. (See Section 12.5.5.33, "SHOW PROFILES Syntax.")
 
4365
       This option was added in MySQL 5.1.24. It is enabled by
 
4366
       default as of MySQL 5.1.28; to disable it, use
4677
4367
       --disable-profiling.
4678
4368
 
4679
 
     * See Section 2.14, "Operating System-Specific Notes," for
 
4369
     * See Section 2.13, "Operating System-Specific Notes," for
4680
4370
       options that pertain to particular operating systems.
4681
4371
 
4682
 
     * See Section 5.5.7.2, "Using SSL Connections," for options
4683
 
       that pertain to configuring MySQL to support secure
4684
 
       (encrypted) connections.
 
4372
     * See Section 5.5.7.2, "Using SSL Connections," for options that
 
4373
       pertain to configuring MySQL to support secure (encrypted)
 
4374
       connections.
4685
4375
 
4686
4376
     * Several configure options apply to plugin selection and
4687
 
       building. You can build a plugin as static (compiled into
4688
 
       the server) or dynamic (built as a dynamic library that
4689
 
       must be installed using the INSTALL PLUGIN statement
4690
 
       before it can be used). Some plugins might not support
4691
 
       static or dynamic build.
4692
 
       configure --help shows the following information
4693
 
       pertaining to plugins:
4694
 
 
4695
 
          + The plugin-related options
4696
 
 
4697
 
          + The names of all available plugins
4698
 
 
4699
 
          + For each plugin, a description of its purpose, which
4700
 
            build types it supports (static or dynamic), and
4701
 
            which plugin groups it is a part of.
4702
 
       The following configure options are used to select or
4703
 
       disable plugins:
 
4377
       building:
4704
4378
--with-plugins=PLUGIN[,PLUGIN]...
4705
4379
--with-plugins=GROUP
4706
4380
--with-plugin-PLUGIN
4707
4381
--without-plugin-PLUGIN
4708
 
 
4709
 
       PLUGIN is an individual plugin name such as csv or
4710
 
       archive.
4711
 
       As shorthand, GROUP is a configuration group name such as
4712
 
       none (select no plugins) or all (select all plugins).
4713
 
       --with-plugins can take a list of one or more plugin
4714
 
       names separated by commas, or a plugin group name. The
4715
 
       named plugins are configured to be built as static
4716
 
       plugins.
4717
 
       --with-plugin-PLUGIN configures the given plugin to be
4718
 
       built as a static plugin.
4719
 
       --without-plugin-PLUGIN disables the given plugin from
4720
 
       being built.
4721
 
       If a plugin is named both with a --with and --without
4722
 
       option, the result is undefined.
4723
 
       For any plugin that is not explicitly selected or
4724
 
       disabled, it is selected to be built dynamically if it
4725
 
       supports dynamic build, and not built if it does not
4726
 
       support dynamic build. (Thus, in the case that no plugin
4727
 
       options are given, all plugins that support dynamic build
4728
 
       are selected to be built as dynamic plugins. Plugins that
4729
 
       do not support dynamic build are not built.)
 
4382
       PLUGIN is an individual plugin name such as csv or archive.
 
4383
       As shorthand, GROUP is a configuration group name such as none
 
4384
       (select no plugins) or all (select all plugins).
 
4385
       You can build a plugin as static (compiled into the server) or
 
4386
       dynamic (built as a dynamic library that must be installed
 
4387
       using the INSTALL PLUGIN statement before it can be used).
 
4388
       Some plugins might not support static or dynamic build.
 
4389
       configure --help shows the following information pertaining to
 
4390
       plugins:
 
4391
 
 
4392
          + The plugin-related options
 
4393
 
 
4394
          + The names of all available plugins
 
4395
 
 
4396
          + For each plugin, a description of its purpose, which
 
4397
            build types it supports (static or dynamic), and which
 
4398
            plugin groups it is a part of.
 
4399
       --with-plugins can take a list of one or more plugin names
 
4400
       separated by commas, or a plugin group name. The named plugins
 
4401
       are configured to be built as static plugins.
 
4402
       --with-plugin-PLUGIN configures the given plugin to be built
 
4403
       as a static plugin.
 
4404
       --without-plugin-PLUGIN disables the given plugin from being
 
4405
       built.
 
4406
       If a plugin is named both with a --with and --without option,
 
4407
       the result is undefined.
 
4408
       For any plugin that is not explicitly selected or disabled, it
 
4409
       is selected to be built dynamically if it supports dynamic
 
4410
       build, and not built if it does not support dynamic build.
 
4411
       (Thus, in the case that no plugin options are given, all
 
4412
       plugins that support dynamic build are selected to be built as
 
4413
       dynamic plugins. Plugins that do not support dynamic build are
 
4414
       not built.)
4730
4415
 
4731
4416
2.10.3. Installing from the Development Source Tree
4732
4417
 
4733
4418
Caution
4734
4419
 
4735
 
   You should read this section only if you are interested in
4736
 
   helping us test our new code. If you just want to get MySQL
4737
 
   up and running on your system, you should use a standard
4738
 
   release distribution (either a binary or source
4739
 
   distribution).
 
4420
   You should read this section only if you are interested in helping
 
4421
   us test our new code. If you just want to get MySQL up and running
 
4422
   on your system, you should use a standard release distribution
 
4423
   (either a binary or source distribution).
4740
4424
 
4741
 
   To obtain the most recent development source tree, you first
4742
 
   need to download and install Bazaar. You can obtain Bazaar
4743
 
   from the Bazaar VCS Website (http://bazaar-vcs.org). Bazaar
4744
 
   is supported by any platform that supports Python, and is
4745
 
   therefore compatible with any Linux, Unix, Windows or Mac OS
4746
 
   X host. Instructions for downloading and installing Bazaar on
4747
 
   the different platforms are available on the Bazaar website.
 
4425
   To obtain the most recent development source tree, you first need
 
4426
   to download and install Bazaar. You can obtain Bazaar from the
 
4427
   Bazaar VCS Website (http://bazaar-vcs.org). Bazaar is supported by
 
4428
   any platform that supports Python, and is therefore compatible
 
4429
   with any Linux, Unix, Windows or Mac OS X host. Instructions for
 
4430
   downloading and installing Bazaar on the different platforms are
 
4431
   available on the Bazaar website.
4748
4432
 
4749
4433
   All MySQL projects are hosted on Launchpad
4750
 
   (http://launchpad.net/). MySQL projects, including MySQL
4751
 
   server, MySQL Workbench and others are available from the
4752
 
   Sun/MySQL Engineering (http://launchpad.net/~mysql) page. For
4753
 
   the repositories related only to MySQL server, see the MySQL
4754
 
   Server (http://launchpad.net/mysql-server) page.
 
4434
   (http://launchpad.net/). MySQL projects, including MySQL server,
 
4435
   MySQL Workbench and others are available from the Sun/MySQL
 
4436
   Engineering (http://launchpad.net/~mysql) page. For the
 
4437
   repositories related only to MySQL server, see the MySQL Server
 
4438
   (http://launchpad.net/mysql-server) page.
4755
4439
 
4756
4440
   To build under Unix/Linux, you must have the following tools
4757
4441
   installed:
4758
4442
 
4759
 
     * GNU make, available from
4760
 
       http://www.gnu.org/software/make/. Although some
4761
 
       platforms come with their own make implementations, it is
4762
 
       highly recommended that you use GNU make. It may already
4763
 
       be available on your system as gmake.
 
4443
     * GNU make, available from http://www.gnu.org/software/make/.
 
4444
       Although some platforms come with their own make
 
4445
       implementations, it is highly recommended that you use GNU
 
4446
       make. It may already be available on your system as gmake.
4764
4447
 
4765
4448
     * autoconf 2.58 (or newer), available from
4766
4449
       http://www.gnu.org/software/autoconf/.
4773
4456
 
4774
4457
     * m4, available from http://www.gnu.org/software/m4/.
4775
4458
 
4776
 
     * bison, available from http://www.gnu.org/software/bison/.
4777
 
       You should use the latest version of bison where
4778
 
       possible. Version 1.75 and version 2.1 are known to work.
4779
 
       There have been reported problems with bison 1.875. If
4780
 
       you experience problems, upgrade to a later, rather than
4781
 
       earlier, version. Versions of bison older than 1.75 may
4782
 
       report this error:
 
4459
     * bison, available from http://www.gnu.org/software/bison/. You
 
4460
       should use the latest version of bison where possible. Version
 
4461
       1.75 and version 2.1 are known to work. There have been
 
4462
       reported problems with bison 1.875. If you experience
 
4463
       problems, upgrade to a later, rather than earlier, version.
 
4464
       Versions of bison older than 1.75 may report this error:
4783
4465
sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded
4784
 
 
4785
 
       The maximum table size is not actually exceeded; the
4786
 
       error is caused by bugs in older versions of bison.
4787
 
 
4788
 
   To build under Windows you will need a copy of Microsoft
4789
 
   Visual C++ 2005 Express Edition, Visual Studio .Net 2003
4790
 
   (7.1), or Visual Studio 2005 (8.0) compiler system.
4791
 
 
4792
 
   Once you have the necessary tools installed, you first need
4793
 
   to create a local branch of the MySQL source code on your
4794
 
   machine:
4795
 
 
4796
 
    1. To obtain a copy of the MySQL source code, you must
4797
 
       create a new Bazaar branch. If you do not already have a
4798
 
       Bazaar repository directory set up, you need to
4799
 
       initialize a new directory:
 
4466
       The maximum table size is not actually exceeded; the error is
 
4467
       caused by bugs in older versions of bison.
 
4468
 
 
4469
   To build under Windows you will need a copy of Microsoft Visual
 
4470
   C++ 2005 Express Edition, Visual Studio .Net 2003 (7.1), or Visual
 
4471
   Studio 2005 (8.0) compiler system.
 
4472
 
 
4473
   Once you have the necessary tools installed, you first need to
 
4474
   create a local branch of the MySQL source code on your machine:
 
4475
 
 
4476
    1. To obtain a copy of the MySQL source code, you must create a
 
4477
       new Bazaar branch. If you do not already have a Bazaar
 
4478
       repository directory set up, you need to initialize a new
 
4479
       directory:
4800
4480
shell> mkdir mysql-server
4801
4481
shell> bzr init-repo --trees mysql-server
4802
 
       Once you have an initialized directory, you can branch
4803
 
       from the public MySQL server repositories. To create a
4804
 
       branch of a specific version:
 
4482
       Once you have an initialized directory, you can branch from
 
4483
       the public MySQL server repositories. To create a branch of a
 
4484
       specific version:
4805
4485
shell> cd mysql-server
4806
4486
shell> bzr branch lp:mysql-server/5.1 mysql-5.1
4807
4487
       The initial download will take some time to complete,
4808
 
       depending on the speed of your connection. Please be
4809
 
       patient. Once you have downloaded the first tree,
4810
 
       additional trees should take significantly less time to
4811
 
       download.
4812
 
       When building from the Bazaar branch, you may want to
4813
 
       create a copy of your active branch so that you can make
4814
 
       configuration and other changes without affecting the
4815
 
       original branch contents. You can achieve this by
4816
 
       branching from the original branch:
 
4488
       depending on the speed of your connection. Please be patient.
 
4489
       Once you have downloaded the first tree, additional trees
 
4490
       should take significantly less time to download.
 
4491
       When building from the Bazaar branch, you may want to create a
 
4492
       copy of your active branch so that you can make configuration
 
4493
       and other changes without affecting the original branch
 
4494
       contents. You can achieve this by branching from the original
 
4495
       branch:
4817
4496
shell> bzr branch mysql-5.1 mysql-5.1-build
4818
4497
 
4819
4498
   Once you have the local branch, you can start to build MySQL
4820
4499
   server from the source code. On Windows, the build process is
4821
 
   different from Unix/Linux. To continue building MySQL on
4822
 
   Windows, see Section 2.10.6, "Installing MySQL from Source on
4823
 
   Windows."
4824
 
 
4825
 
   On Unix/Linux you need to use the autoconf system to create
4826
 
   the configure script so that you can configure the build
4827
 
   environment before building.
4828
 
 
4829
 
    1. The following example shows the typical commands required
4830
 
       to configure a source tree. The first cd command changes
4831
 
       location into the top-level directory of the tree;
4832
 
       replace mysql-5.1 with the appropriate directory name.
 
4500
   different from Unix/Linux. To continue building MySQL on Windows,
 
4501
   see Section 2.10.6, "Installing MySQL from Source on Windows."
 
4502
 
 
4503
   On Unix/Linux you need to use the autoconf system to create the
 
4504
   configure script so that you can configure the build environment
 
4505
   before building.
 
4506
 
 
4507
    1. The following example shows the typical commands required to
 
4508
       configure a source tree. The first cd command changes location
 
4509
       into the top-level directory of the tree; replace mysql-5.1
 
4510
       with the appropriate directory name.
4833
4511
 
4834
4512
Note
4835
 
       For MySQL 5.1.12 and earlier, you must separately
4836
 
       configure the INNODB storage engine. You can do this by
4837
 
       running the following command from the main source
4838
 
       directory:
 
4513
       For MySQL 5.1.12 and earlier, you must separately configure
 
4514
       the INNODB storage engine. You can do this by running the
 
4515
       following command from the main source directory:
4839
4516
shell> (cd storage/innobase; autoreconf --force --install)
4840
4517
shell> cd mysql-5.1
4841
4518
shell> autoreconf --force --install
4842
4519
shell> ./configure  # Add your favorite options here
4843
4520
shell> make
4844
 
 
4845
4521
       Or you can use BUILD/autorun.sh as a shortcut for the
4846
4522
       following sequence of commands:
4847
4523
shell> aclocal; autoheader
4848
4524
shell> libtoolize --automake --force
4849
4525
shell> automake --force --add-missing; autoconf
4850
 
 
4851
4526
       The command line that changes directory into the
4852
 
       storage/innobase directory is used to configure the
4853
 
       InnoDB storage engine. You can omit this lines if you do
4854
 
       not require InnoDB support.
 
4527
       storage/innobase directory is used to configure the InnoDB
 
4528
       storage engine. You can omit this lines if you do not require
 
4529
       InnoDB support.
4855
4530
 
4856
4531
Note
4857
 
       Beginning with MySQL 5.1, code specific to storage
4858
 
       engines has been moved under a storage directory. For
4859
 
       example, InnoDB code is now found in storage/innobase and
4860
 
       NDBCLUSTER code is in storage/ndb.
4861
 
       If you get some strange errors during this stage, verify
4862
 
       that you have the correct version of the libtool
4863
 
       installed.
4864
 
       A collection of our standard configuration scripts is
4865
 
       located in the BUILD/ subdirectory. For example, you may
4866
 
       find it more convenient to use the
4867
 
       BUILD/compile-pentium-debug script than the preceding set
4868
 
       of shell commands. To compile on a different
4869
 
       architecture, modify the script by removing flags that
4870
 
       are Pentium-specific, or use another script that may be
4871
 
       more appropriate. These scripts are provided on an
4872
 
       "as-is" basis. They are not officially maintained and
4873
 
       their contents may change from release to release.
4874
 
 
4875
 
    2. When the build is done, run make install. Be careful with
4876
 
       this on a production machine; the command may overwrite
4877
 
       your live release installation. If you have another
4878
 
       installation of MySQL, we recommend that you run
4879
 
       ./configure with different values for the --prefix,
4880
 
       --with-tcp-port, and --unix-socket-path options than
4881
 
       those used for your production server.
4882
 
 
4883
 
    3. Play hard with your new installation and try to make the
4884
 
       new features crash. Start by running make test. See
4885
 
       Section 22.1.2, "MySQL Test Suite."
4886
 
 
4887
 
    4. If you have gotten to the make stage, but the
4888
 
       distribution does not compile, please enter the problem
4889
 
       into our bugs database using the instructions given in
4890
 
       Section 1.6, "How to Report Bugs or Problems." If you
4891
 
       have installed the latest versions of the required GNU
4892
 
       tools, and they crash trying to process our configuration
4893
 
       files, please report that also. However, if you execute
4894
 
       aclocal and get a command not found error or a similar
4895
 
       problem, do not report it. Instead, make sure that all
4896
 
       the necessary tools are installed and that your PATH
4897
 
       variable is set correctly so that your shell can find
 
4532
       Beginning with MySQL 5.1, code specific to storage engines has
 
4533
       been moved under a storage directory. For example, InnoDB code
 
4534
       is now found in storage/innobase and NDBCLUSTER code is in
 
4535
       storage/ndb.
 
4536
       If you get some strange errors during this stage, verify that
 
4537
       you have the correct version of the libtool installed.
 
4538
       A collection of our standard configuration scripts is located
 
4539
       in the BUILD/ subdirectory. For example, you may find it more
 
4540
       convenient to use the BUILD/compile-pentium-debug script than
 
4541
       the preceding set of shell commands. To compile on a different
 
4542
       architecture, modify the script by removing flags that are
 
4543
       Pentium-specific, or use another script that may be more
 
4544
       appropriate. These scripts are provided on an "as-is" basis.
 
4545
       They are not officially maintained and their contents may
 
4546
       change from release to release.
 
4547
 
 
4548
    2. When the build is done, run make install. Be careful with this
 
4549
       on a production machine; the command may overwrite your live
 
4550
       release installation. If you have another installation of
 
4551
       MySQL, we recommend that you run ./configure with different
 
4552
       values for the --prefix, --with-tcp-port, and
 
4553
       --with-unix-socket-path options than those used for your
 
4554
       production server.
 
4555
 
 
4556
    3. Play hard with your new installation and try to make the new
 
4557
       features crash. Start by running make test. See Section
 
4558
       22.1.2, "MySQL Test Suite."
 
4559
 
 
4560
    4. If you have gotten to the make stage, but the distribution
 
4561
       does not compile, please enter the problem into our bugs
 
4562
       database using the instructions given in Section 1.6, "How to
 
4563
       Report Bugs or Problems." If you have installed the latest
 
4564
       versions of the required GNU tools, and they crash trying to
 
4565
       process our configuration files, please report that also.
 
4566
       However, if you execute aclocal and get a command not found
 
4567
       error or a similar problem, do not report it. Instead, make
 
4568
       sure that all the necessary tools are installed and that your
 
4569
       PATH variable is set correctly so that your shell can find
4898
4570
       them.
4899
4571
 
4900
 
    5. After initially copying the repository with bzr to obtain
4901
 
       the source tree, you should use pull option to
4902
 
       periodically update your local copy. To do this any time
4903
 
       after you have set up the repository, use this command:
 
4572
    5. After initially copying the repository with bzr to obtain the
 
4573
       source tree, you should use pull option to periodically update
 
4574
       your local copy. To do this any time after you have set up the
 
4575
       repository, use this command:
4904
4576
shell> bzr pull
4905
4577
 
4906
 
 
4907
 
    6. You can examine the changeset comments for the tree by
4908
 
       using the log option to bzr:
 
4578
    6. You can examine the changeset comments for the tree by using
 
4579
       the log option to bzr:
4909
4580
shell> bzr log
4910
4581
       You can also browse changesets, comments, and source code
4911
4582
       online. To browse this information for MySQL 5.1, go to
4912
4583
       http://launchpad.net/mysql-server/.
4913
 
       If you see diffs or code that you have a question about,
4914
 
       do not hesitate to send email to the MySQL internals
4915
 
       mailing list. See Section 1.5.1, "MySQL Mailing Lists."
4916
 
       Also, if you think you have a better idea on how to do
4917
 
       something, send an email message to the list with a
4918
 
       patch.
 
4584
       If you see diffs or code that you have a question about, do
 
4585
       not hesitate to send email to the MySQL internals mailing
 
4586
       list. See Section 1.5.1, "MySQL Mailing Lists." Also, if you
 
4587
       think you have a better idea on how to do something, send an
 
4588
       email message to the list with a patch.
4919
4589
 
4920
4590
2.10.4. Dealing with Problems Compiling MySQL
4921
4591
 
4922
4592
   All MySQL programs compile cleanly for us with no warnings on
4923
 
   Solaris or Linux using gcc. On other systems, warnings may
4924
 
   occur due to differences in system include files. See Section
4925
 
   2.10.5, "MIT-pthreads Notes," for warnings that may occur
4926
 
   when using MIT-pthreads. For other problems, check the
4927
 
   following list.
4928
 
 
4929
 
   The solution to many problems involves reconfiguring. If you
4930
 
   do need to reconfigure, take note of the following:
4931
 
 
4932
 
     * If configure is run after it has previously been run, it
4933
 
       may use information that was gathered during its previous
4934
 
       invocation. This information is stored in config.cache.
4935
 
       When configure starts up, it looks for that file and
4936
 
       reads its contents if it exists, on the assumption that
4937
 
       the information is still correct. That assumption is
4938
 
       invalid when you reconfigure.
 
4593
   Solaris or Linux using gcc. On other systems, warnings may occur
 
4594
   due to differences in system include files. See Section 2.10.5,
 
4595
   "MIT-pthreads Notes," for warnings that may occur when using
 
4596
   MIT-pthreads. For other problems, check the following list.
 
4597
 
 
4598
   The solution to many problems involves reconfiguring. If you do
 
4599
   need to reconfigure, take note of the following:
 
4600
 
 
4601
     * If configure is run after it has previously been run, it may
 
4602
       use information that was gathered during its previous
 
4603
       invocation. This information is stored in config.cache. When
 
4604
       configure starts up, it looks for that file and reads its
 
4605
       contents if it exists, on the assumption that the information
 
4606
       is still correct. That assumption is invalid when you
 
4607
       reconfigure.
4939
4608
 
4940
4609
     * Each time you run configure, you must run make again to
4941
 
       recompile. However, you may want to remove old object
4942
 
       files from previous builds first because they were
4943
 
       compiled using different configuration options.
 
4610
       recompile. However, you may want to remove old object files
 
4611
       from previous builds first because they were compiled using
 
4612
       different configuration options.
4944
4613
 
4945
4614
   To prevent old configuration information or object files from
4946
4615
   being used, run these commands before re-running configure:
4949
4618
 
4950
4619
   Alternatively, you can run make distclean.
4951
4620
 
4952
 
   The following list describes some of the problems when
4953
 
   compiling MySQL that have been found to occur most often:
 
4621
   The following list describes some of the problems when compiling
 
4622
   MySQL that have been found to occur most often:
4954
4623
 
4955
 
     * If you get errors such as the ones shown here when
4956
 
       compiling sql_yacc.cc, you probably have run out of
4957
 
       memory or swap space:
 
4624
     * If you get errors such as the ones shown here when compiling
 
4625
       sql_yacc.cc, you probably have run out of memory or swap
 
4626
       space:
4958
4627
Internal compiler error: program cc1plus got fatal signal 11
4959
4628
Out of virtual memory
4960
4629
Virtual memory exhausted
4961
 
 
4962
 
       The problem is that gcc requires a huge amount of memory
4963
 
       to compile sql_yacc.cc with inline functions. Try running
 
4630
       The problem is that gcc requires a huge amount of memory to
 
4631
       compile sql_yacc.cc with inline functions. Try running
4964
4632
       configure with the --with-low-memory option:
4965
4633
shell> ./configure --with-low-memory
4966
 
 
4967
 
       This option causes -fno-inline to be added to the compile
4968
 
       line if you are using gcc and -O0 if you are using
4969
 
       something else. You should try the --with-low-memory
4970
 
       option even if you have so much memory and swap space
4971
 
       that you think you can't possibly have run out. This
4972
 
       problem has been observed to occur even on systems with
4973
 
       generous hardware configurations, and the
 
4634
       This option causes -fno-inline to be added to the compile line
 
4635
       if you are using gcc and -O0 if you are using something else.
 
4636
       You should try the --with-low-memory option even if you have
 
4637
       so much memory and swap space that you think you can't
 
4638
       possibly have run out. This problem has been observed to occur
 
4639
       even on systems with generous hardware configurations, and the
4974
4640
       --with-low-memory option usually fixes it.
4975
4641
 
4976
 
     * By default, configure picks c++ as the compiler name and
4977
 
       GNU c++ links with -lg++. If you are using gcc, that
4978
 
       behavior can cause problems during configuration such as
4979
 
       this:
 
4642
     * By default, configure picks c++ as the compiler name and GNU
 
4643
       c++ links with -lg++. If you are using gcc, that behavior can
 
4644
       cause problems during configuration such as this:
4980
4645
configure: error: installation or configuration problem:
4981
4646
C++ compiler cannot create executables.
4982
 
 
4983
 
       You might also observe problems during compilation
4984
 
       related to g++, libg++, or libstdc++.
4985
 
       One cause of these problems is that you may not have g++,
4986
 
       or you may have g++ but not libg++, or libstdc++. Take a
4987
 
       look at the config.log file. It should contain the exact
4988
 
       reason why your C++ compiler didn't work. To work around
4989
 
       these problems, you can use gcc as your C++ compiler. Try
4990
 
       setting the environment variable CXX to "gcc -O3". For
4991
 
       example:
 
4647
       You might also observe problems during compilation related to
 
4648
       g++, libg++, or libstdc++.
 
4649
       One cause of these problems is that you may not have g++, or
 
4650
       you may have g++ but not libg++, or libstdc++. Take a look at
 
4651
       the config.log file. It should contain the exact reason why
 
4652
       your C++ compiler didn't work. To work around these problems,
 
4653
       you can use gcc as your C++ compiler. Try setting the
 
4654
       environment variable CXX to "gcc -O3". For example:
4992
4655
shell> CXX="gcc -O3" ./configure
4993
 
 
4994
 
       This works because gcc compiles C++ source files as well
4995
 
       as g++ does, but does not link in libg++ or libstdc++ by
4996
 
       default.
4997
 
       Another way to fix these problems is to install g++,
4998
 
       libg++, and libstdc++. However, we recommend that you not
4999
 
       use libg++ or libstdc++ with MySQL because this only
5000
 
       increases the binary size of mysqld without providing any
5001
 
       benefits. Some versions of these libraries have also
5002
 
       caused strange problems for MySQL users in the past.
 
4656
       This works because gcc compiles C++ source files as well as
 
4657
       g++ does, but does not link in libg++ or libstdc++ by default.
 
4658
       Another way to fix these problems is to install g++, libg++,
 
4659
       and libstdc++. However, we recommend that you not use libg++
 
4660
       or libstdc++ with MySQL because this only increases the binary
 
4661
       size of mysqld without providing any benefits. Some versions
 
4662
       of these libraries have also caused strange problems for MySQL
 
4663
       users in the past.
5003
4664
 
5004
4665
     * If your compile fails with errors such as any of the
5005
 
       following, you must upgrade your version of make to GNU
5006
 
       make:
 
4666
       following, you must upgrade your version of make to GNU make:
5007
4667
making all in mit-pthreads
5008
4668
make: Fatal error in reader: Makefile, line 18:
5009
4669
Badly formed macro assignment
5010
 
 
5011
4670
       Or:
5012
4671
make: file `Makefile' line 18: Must be a separator (:
5013
 
 
5014
4672
       Or:
5015
4673
pthread.h: No such file or directory
5016
 
 
5017
4674
       Solaris and FreeBSD are known to have troublesome make
5018
4675
       programs.
5019
4676
       GNU make 3.75 is known to work.
5027
4684
shell> CXX=gcc
5028
4685
shell> CXXFLAGS=-O3
5029
4686
shell> export CC CFLAGS CXX CXXFLAGS
5030
 
 
5031
4687
       See Section 2.1.2.4, "MySQL Binaries Compiled by Sun
5032
 
       Microsystems, Inc.," for a list of flag definitions that
5033
 
       have been found to be useful on various systems.
 
4688
       Microsystems, Inc.," for a list of flag definitions that have
 
4689
       been found to be useful on various systems.
5034
4690
 
5035
4691
     * If you get errors such as those shown here when compiling
5036
 
       mysqld, configure did not correctly detect the type of
5037
 
       the last argument to accept(), getsockname(), or
5038
 
       getpeername():
 
4692
       mysqld, configure did not correctly detect the type of the
 
4693
       last argument to accept(), getsockname(), or getpeername():
5039
4694
cxx: Error: mysqld.cc, line 645: In this statement, the referenced
5040
4695
     type of the pointer value ''length'' is ''unsigned long'',
5041
4696
     which is not compatible with ''int''.
5042
4697
new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
5043
 
 
5044
 
       To fix this, edit the config.h file (which is generated
5045
 
       by configure). Look for these lines:
 
4698
       To fix this, edit the config.h file (which is generated by
 
4699
       configure). Look for these lines:
5046
4700
/* Define as the base type of the last arg to accept */
5047
4701
#define SOCKET_SIZE_TYPE XXX
5048
 
 
5049
4702
       Change XXX to size_t or int, depending on your operating
5050
 
       system. (You must do this each time you run configure
5051
 
       because configure regenerates config.h.)
 
4703
       system. (You must do this each time you run configure because
 
4704
       configure regenerates config.h.)
5052
4705
 
5053
 
     * The sql_yacc.cc file is generated from sql_yacc.yy.
5054
 
       Normally, the build process does not need to create
5055
 
       sql_yacc.cc because MySQL comes with a pre-generated
5056
 
       copy. However, if you do need to re-create it, you might
5057
 
       encounter this error:
 
4706
     * The sql_yacc.cc file is generated from sql_yacc.yy. Normally,
 
4707
       the build process does not need to create sql_yacc.cc because
 
4708
       MySQL comes with a pre-generated copy. However, if you do need
 
4709
       to re-create it, you might encounter this error:
5058
4710
"sql_yacc.yy", line xxx fatal: default action causes potential...
5059
 
 
5060
 
       This is a sign that your version of yacc is deficient.
5061
 
       You probably need to install bison (the GNU version of
5062
 
       yacc) and use that instead.
5063
 
 
5064
 
     * On Debian Linux 3.0, you need to install gawk instead of
5065
 
       the default mawk.
5066
 
 
5067
 
     * If you need to debug mysqld or a MySQL client, run
5068
 
       configure with the --with-debug option, and then
5069
 
       recompile and link your clients with the new client
5070
 
       library. See MySQL Internals: Porting
5071
 
       (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
5072
 
 
5073
 
     * If you get a compilation error on Linux (for example,
5074
 
       SuSE Linux 8.1 or Red Hat Linux 7.3) similar to the
5075
 
       following one, you probably do not have g++ installed:
 
4711
       This is a sign that your version of yacc is deficient. You
 
4712
       probably need to install bison (the GNU version of yacc) and
 
4713
       use that instead.
 
4714
 
 
4715
     * On Debian Linux 3.0, you need to install gawk instead of the
 
4716
       default mawk.
 
4717
 
 
4718
     * If you need to debug mysqld or a MySQL client, run configure
 
4719
       with the --with-debug option, and then recompile and link your
 
4720
       clients with the new client library. See MySQL Internals:
 
4721
       Porting (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
 
4722
 
 
4723
     * If you get a compilation error on Linux (for example, SuSE
 
4724
       Linux 8.1 or Red Hat Linux 7.3) similar to the following one,
 
4725
       you probably do not have g++ installed:
5076
4726
libmysql.c:1329: warning: passing arg 5 of `gethostbyname_r' from
5077
4727
incompatible pointer type
5078
4728
libmysql.c:1329: too few arguments to function `gethostbyname_r'
5079
4729
libmysql.c:1329: warning: assignment makes pointer from integer
5080
4730
without a cast
5081
4731
make[2]: *** [libmysql.lo] Error 1
5082
 
 
5083
 
       By default, the configure script attempts to determine
5084
 
       the correct number of arguments by using g++ (the GNU C++
5085
 
       compiler). This test yields incorrect results if g++ is
5086
 
       not installed. There are two ways to work around this
5087
 
       problem:
 
4732
       By default, the configure script attempts to determine the
 
4733
       correct number of arguments by using g++ (the GNU C++
 
4734
       compiler). This test yields incorrect results if g++ is not
 
4735
       installed. There are two ways to work around this problem:
5088
4736
 
5089
4737
          + Make sure that the GNU C++ g++ is installed. On some
5090
 
            Linux distributions, the required package is called
5091
 
            gpp; on others, it is named gcc-c++.
 
4738
            Linux distributions, the required package is called gpp;
 
4739
            on others, it is named gcc-c++.
5092
4740
 
5093
4741
          + Use gcc as your C++ compiler by setting the CXX
5094
4742
            environment variable to gcc:
5095
4743
export CXX="gcc"
5096
 
 
5097
4744
       You must run configure again after making either of those
5098
4745
       changes.
5099
4746
 
5103
4750
   MIT-pthreads.
5104
4751
 
5105
4752
   On Linux, you should not use MIT-pthreads. Use the installed
5106
 
   LinuxThreads implementation instead. See Section 2.14.1,
5107
 
   "Linux Notes."
5108
 
 
5109
 
   If your system does not provide native thread support, you
5110
 
   should build MySQL using the MIT-pthreads package. This
5111
 
   includes older FreeBSD systems, SunOS 4.x, Solaris 2.4 and
5112
 
   earlier, and some others. See Section 2.1.1, "Operating
5113
 
   Systems Supported by MySQL Community Server."
5114
 
 
5115
 
   MIT-pthreads is not part of the MySQL 5.1 source
5116
 
   distribution. If you require this package, you need to
5117
 
   download it separately from
5118
 
   http://dev.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-my
5119
 
   sql.tar.gz
5120
 
 
5121
 
   After downloading, extract this source archive into the top
5122
 
   level of the MySQL source directory. It creates a new
5123
 
   subdirectory named mit-pthreads.
 
4753
   LinuxThreads implementation instead. See Section 2.13.1, "Linux
 
4754
   Notes."
 
4755
 
 
4756
   If your system does not provide native thread support, you should
 
4757
   build MySQL using the MIT-pthreads package. This includes older
 
4758
   FreeBSD systems, SunOS 4.x, Solaris 2.4 and earlier, and some
 
4759
   others. See Section 2.1.1, "Operating Systems Supported by MySQL
 
4760
   Community Server."
 
4761
 
 
4762
   MIT-pthreads is not part of the MySQL 5.1 source distribution. If
 
4763
   you require this package, you need to download it separately from
 
4764
   http://dev.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-mysql.t
 
4765
   ar.gz
 
4766
 
 
4767
   After downloading, extract this source archive into the top level
 
4768
   of the MySQL source directory. It creates a new subdirectory named
 
4769
   mit-pthreads.
5124
4770
 
5125
4771
     * On most systems, you can force MIT-pthreads to be used by
5126
4772
       running configure with the --with-mit-threads option:
5127
4773
shell> ./configure --with-mit-threads
5128
 
 
5129
 
       Building in a non-source directory is not supported when
5130
 
       using MIT-pthreads because we want to minimize our
5131
 
       changes to this code.
5132
 
 
5133
 
     * The checks that determine whether to use MIT-pthreads
5134
 
       occur only during the part of the configuration process
5135
 
       that deals with the server code. If you have configured
5136
 
       the distribution using --without-server to build only the
5137
 
       client code, clients do not know whether MIT-pthreads is
5138
 
       being used and use Unix socket file connections by
5139
 
       default. Because Unix socket files do not work under
5140
 
       MIT-pthreads on some platforms, this means you need to
5141
 
       use -h or --host with a value other than localhost when
5142
 
       you run client programs.
5143
 
 
5144
 
     * When MySQL is compiled using MIT-pthreads, system locking
5145
 
       is disabled by default for performance reasons. You can
5146
 
       tell the server to use system locking with the
5147
 
       --external-locking option. This is needed only if you
5148
 
       want to be able to run two MySQL servers against the same
5149
 
       data files, but that is not recommended, anyway.
5150
 
 
5151
 
     * Sometimes the pthread bind() command fails to bind to a
5152
 
       socket without any error message (at least on Solaris).
5153
 
       The result is that all connections to the server fail.
5154
 
       For example:
 
4774
       Building in a non-source directory is not supported when using
 
4775
       MIT-pthreads because we want to minimize our changes to this
 
4776
       code.
 
4777
 
 
4778
     * The checks that determine whether to use MIT-pthreads occur
 
4779
       only during the part of the configuration process that deals
 
4780
       with the server code. If you have configured the distribution
 
4781
       using --without-server to build only the client code, clients
 
4782
       do not know whether MIT-pthreads is being used and use Unix
 
4783
       socket file connections by default. Because Unix socket files
 
4784
       do not work under MIT-pthreads on some platforms, this means
 
4785
       you need to use -h or --host with a value other than localhost
 
4786
       when you run client programs.
 
4787
 
 
4788
     * When MySQL is compiled using MIT-pthreads, system locking is
 
4789
       disabled by default for performance reasons. You can tell the
 
4790
       server to use system locking with the --external-locking
 
4791
       option. This is needed only if you want to be able to run two
 
4792
       MySQL servers against the same data files, but that is not
 
4793
       recommended, anyway.
 
4794
 
 
4795
     * Sometimes the pthread bind() command fails to bind to a socket
 
4796
       without any error message (at least on Solaris). The result is
 
4797
       that all connections to the server fail. For example:
5155
4798
shell> mysqladmin version
5156
4799
mysqladmin: connect to server at '' failed;
5157
4800
error: 'Can't connect to mysql server on localhost (146)'
5158
 
 
5159
 
       The solution to this problem is to kill the mysqld server
5160
 
       and restart it. This has happened to us only when we have
5161
 
       forcibly stopped the server and restarted it immediately.
5162
 
 
5163
 
     * With MIT-pthreads, the sleep() system call isn't
5164
 
       interruptible with SIGINT (break). This is noticeable
5165
 
       only when you run mysqladmin --sleep. You must wait for
5166
 
       the sleep() call to terminate before the interrupt is
5167
 
       served and the process stops.
5168
 
 
5169
 
     * When linking, you might receive warning messages like
5170
 
       these (at least on Solaris); they can be ignored:
 
4801
       The solution to this problem is to kill the mysqld server and
 
4802
       restart it. This has happened to us only when we have forcibly
 
4803
       stopped the server and restarted it immediately.
 
4804
 
 
4805
     * With MIT-pthreads, the sleep() system call isn't interruptible
 
4806
       with SIGINT (break). This is noticeable only when you run
 
4807
       mysqladmin --sleep. You must wait for the sleep() call to
 
4808
       terminate before the interrupt is served and the process
 
4809
       stops.
 
4810
 
 
4811
     * When linking, you might receive warning messages like these
 
4812
       (at least on Solaris); they can be ignored:
5171
4813
ld: warning: symbol `_iob' has differing sizes:
5172
4814
    (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
5173
4815
file /usr/lib/libc.so value=0x140);
5177
4819
file /usr/lib/libc.so value=0x140);
5178
4820
    /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
5179
4821
 
5180
 
 
5181
4822
     * Some other warnings also can be ignored:
5182
4823
implicit declaration of function `int strtoll(...)'
5183
4824
implicit declaration of function `int strtoul(...)'
5184
4825
 
5185
 
 
5186
 
     * We have not been able to make readline work with
5187
 
       MIT-pthreads. (This is not necessary, but may be of
5188
 
       interest to some.)
 
4826
     * We have not been able to make readline work with MIT-pthreads.
 
4827
       (This is not necessary, but may be of interest to some.)
5189
4828
 
5190
4829
2.10.6. Installing MySQL from Source on Windows
5191
4830
 
5192
 
   These instructions describe how to build binaries from source
5193
 
   for MySQL 5.1 on Windows. Instructions are provided for
5194
 
   building binaries from a standard source distribution or from
5195
 
   the Bazaar tree that contains the latest development source.
 
4831
   These instructions describe how to build binaries from source for
 
4832
   MySQL 5.1 on Windows. Instructions are provided for building
 
4833
   binaries from a standard source distribution or from the Bazaar
 
4834
   tree that contains the latest development source.
5196
4835
 
5197
4836
Note
5198
4837
 
5199
4838
   The instructions here are strictly for users who want to test
5200
 
   MySQL on Microsoft Windows from the latest source
5201
 
   distribution or from the Bazaar tree. For production use, we
5202
 
   do not advise using a MySQL server built by yourself from
5203
 
   source. Normally, it is best to use precompiled binary
5204
 
   distributions of MySQL that are built specifically for
5205
 
   optimal performance on Windows by Sun Microsystems, Inc.
5206
 
   Instructions for installing binary distributions are
5207
 
   available in Section 2.3, "Installing MySQL on Windows."
 
4839
   MySQL on Microsoft Windows from the latest source distribution or
 
4840
   from the Bazaar tree. For production use, we do not advise using a
 
4841
   MySQL server built by yourself from source. Normally, it is best
 
4842
   to use precompiled binary distributions of MySQL that are built
 
4843
   specifically for optimal performance on Windows by Sun
 
4844
   Microsystems, Inc. Instructions for installing binary
 
4845
   distributions are available in Section 2.3, "Installing MySQL on
 
4846
   Windows."
5208
4847
 
5209
4848
   To build MySQL on Windows from source, you must satisfy the
5210
4849
   following system, compiler, and resource requirements:
5213
4852
       Windows Vista is supported when using Visual Studio 2005
5214
4853
       provided you have installed the following updates:
5215
4854
 
5216
 
          + Microsoft Visual Studio 2005 Professional Edition -
5217
 
            ENU Service Pack 1 (KB926601)
 
4855
          + Microsoft Visual Studio 2005 Professional Edition - ENU
 
4856
            Service Pack 1 (KB926601)
5218
4857
            (http://support.microsoft.com/?kbid=926601)
5219
4858
 
5220
4859
          + Security Update for Microsoft Visual Studio 2005
5229
4868
       After installing, modify your path to include the cmake
5230
4869
       binary.
5231
4870
 
5232
 
     * Microsoft Visual C++ 2005 Express Edition, Visual Studio
5233
 
       .Net 2003 (7.1), or Visual Studio 2005 (8.0) compiler
5234
 
       system.
5235
 
 
5236
 
     * If you are using Visual C++ 2005 Express Edition, you
5237
 
       must also install an appropriate Platform SDK. More
5238
 
       information and links to downloads for various Windows
5239
 
       platforms is available from
5240
 
       http://msdn.microsoft.com/platformsdk/.
5241
 
 
5242
 
     * If you are compiling from a Bazaar tree or making changes
5243
 
       to the parser, you need bison for Windows, which can be
 
4871
     * Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net
 
4872
       2003 (7.1), or Visual Studio 2005 (8.0) compiler system.
 
4873
 
 
4874
     * If you are using Visual C++ 2005 Express Edition, you must
 
4875
       also install an appropriate Platform SDK. More information and
 
4876
       links to downloads for various Windows platforms is available
 
4877
       from
 
4878
       http://www.microsoft.com/downloads/details.aspx?familyid=0baf2
 
4879
       b35-c656-4969-ace8-e4c0c0716adb.
 
4880
 
 
4881
     * If you are compiling from a Bazaar tree or making changes to
 
4882
       the parser, you need bison for Windows, which can be
5244
4883
       downloaded from
5245
 
       http://gnuwin32.sourceforge.net/packages/bison.htm.
5246
 
       Download the package labeled "Complete package, excluding
5247
 
       sources". After installing the package, modify your path
5248
 
       to include the bison binary and ensure that this binary
5249
 
       is accessible from Visual Studio.
 
4884
       http://gnuwin32.sourceforge.net/packages/bison.htm. Download
 
4885
       the package labeled "Complete package, excluding sources".
 
4886
       After installing the package, modify your path to include the
 
4887
       bison binary and ensure that this binary is accessible from
 
4888
       Visual Studio.
5250
4889
 
5251
 
     * Cygwin might be necessary if you want to run the test
5252
 
       script or package the compiled binaries and support files
5253
 
       into a Zip archive. (Cygwin is needed only to test or
5254
 
       package the distribution, not to build it.) Cygwin is
5255
 
       available from http://cygwin.com.
 
4890
     * Cygwin might be necessary if you want to run the test script
 
4891
       or package the compiled binaries and support files into a Zip
 
4892
       archive. (Cygwin is needed only to test or package the
 
4893
       distribution, not to build it.) Cygwin is available from
 
4894
       http://cygwin.com.
5256
4895
 
5257
4896
     * 3GB to 5GB of disk space.
5258
4897
 
5259
4898
   The exact system requirements can be found here:
5260
 
   http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/defau
5261
 
   lt.aspx and
5262
 
   http://msdn.microsoft.com/vstudio/products/sysreqs/default.as
5263
 
   px
5264
 
 
5265
 
   You also need a MySQL source distribution for Windows, which
5266
 
   can be obtained two ways:
5267
 
 
5268
 
     * Obtain a source distribution packaged by Sun
5269
 
       Microsystems, Inc. These are available from
5270
 
       http://dev.mysql.com/downloads/.
5271
 
 
5272
 
     * Package a source distribution yourself from the latest
5273
 
       Bazaar developer source tree. For instructions on pulling
5274
 
       the latest source files, see Section 2.10.3, "Installing
5275
 
       from the Development Source Tree."
 
4899
   http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as
 
4900
   px and
 
4901
   http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx
 
4902
 
 
4903
   You also need a MySQL source distribution for Windows, which can
 
4904
   be obtained two ways:
 
4905
 
 
4906
     * Obtain a source distribution packaged by Sun Microsystems,
 
4907
       Inc. These are available from http://dev.mysql.com/downloads/.
 
4908
 
 
4909
     * Package a source distribution yourself from the latest Bazaar
 
4910
       developer source tree. For instructions on pulling the latest
 
4911
       source files, see Section 2.10.3, "Installing from the
 
4912
       Development Source Tree."
5276
4913
 
5277
4914
   If you find something not working as expected, or you have
5278
 
   suggestions about ways to improve the current build process
5279
 
   on Windows, please send a message to the win32 mailing list.
5280
 
   See Section 1.5.1, "MySQL Mailing Lists."
 
4915
   suggestions about ways to improve the current build process on
 
4916
   Windows, please send a message to the win32 mailing list. See
 
4917
   Section 1.5.1, "MySQL Mailing Lists."
5281
4918
 
5282
4919
2.10.6.1. Building MySQL from Source Using CMake and Visual Studio
5283
4920
 
5284
 
   You can build MySQL on Windows by using a combination of
5285
 
   cmake and Microsoft Visual Studio .NET 2003 (7.1), Microsoft
5286
 
   Visual Studio 2005 (8.0) or Microsoft Visual C++ 2005 Express
5287
 
   Edition. You must have the appropriate Microsoft Platform SDK
5288
 
   installed.
 
4921
   You can build MySQL on Windows by using a combination of cmake and
 
4922
   Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio
 
4923
   2005 (8.0) or Microsoft Visual C++ 2005 Express Edition. You must
 
4924
   have the appropriate Microsoft Platform SDK installed.
5289
4925
 
5290
4926
Note
5291
4927
 
5292
4928
   To compile from the source code on Windows you must use the
5293
 
   standard source distribution (for example,
5294
 
   mysql-5.0.45.tar.gz). You build from the same distribution as
5295
 
   used to build MySQL on Unix, Linux and other platforms. Do
5296
 
   not use the Windows Source distributions as they do not
5297
 
   contain the necessary configuration script and other files.
 
4929
   standard source distribution (for example, mysql-5.0.45.tar.gz).
 
4930
   You build from the same distribution as used to build MySQL on
 
4931
   Unix, Linux and other platforms. Do not use the Windows Source
 
4932
   distributions as they do not contain the necessary configuration
 
4933
   script and other files.
5298
4934
 
5299
4935
   Follow this procedure to build MySQL:
5300
4936
 
5301
 
    1. If you are installing from a packaged source
5302
 
       distribution, create a work directory (for example,
5303
 
       C:\workdir), and unpack the source distribution there
5304
 
       using WinZip or another Windows tool that can read .zip
5305
 
       files. This directory is the work directory in the
5306
 
       following instructions.
5307
 
 
5308
 
    2. If you are installing from a Bazaar tree, the root
5309
 
       directory of that tree is the work directory in the
5310
 
       following instructions.
5311
 
 
5312
 
    3. Using a command shell, navigate to the work directory and
5313
 
       run the following command:
5314
 
C:\workdir>win\configure options
5315
 
 
5316
 
       These options are available:
5317
 
 
5318
 
          + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB
5319
 
            storage engine.
 
4937
    1. If you are installing from a packaged source distribution,
 
4938
       create a work directory (for example, C:\workdir), and unpack
 
4939
       the source distribution there using WinZip or another Windows
 
4940
       tool that can read .zip files. This directory is the work
 
4941
       directory in the following instructions.
 
4942
 
 
4943
    2. Using a command shell, navigate to the work directory and run
 
4944
       the following command:
 
4945
C:\workdir>win\configure.js options
 
4946
       If you have associated the .js file extension with an
 
4947
       application such as a text editor, then you may need to use
 
4948
       the following command to force configure.js to be executed as
 
4949
       a script:
 
4950
C:\workdir>cscript win\configure.js options
 
4951
       These options are available for configure.js:
 
4952
 
 
4953
          + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage
 
4954
            engine.
5320
4955
 
5321
4956
          + WITH_PARTITION_STORAGE_ENGINE: Enable user-defined
5322
4957
            partitioning.
5323
4958
 
5324
 
          + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE
5325
 
            storage engine.
 
4959
          + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage
 
4960
            engine.
5326
4961
 
5327
4962
          + WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE
5328
4963
            storage engine.
5329
4964
 
5330
 
          + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE
5331
 
            storage engine.
 
4965
          + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage
 
4966
            engine.
5332
4967
 
5333
4968
          + WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED
5334
4969
            storage engine.
5335
4970
 
5336
 
          + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default
5337
 
            none.
 
4971
          + WITH_NDBCLUSTER_STORAGE_ENGINE (experimental): Enable the
 
4972
            NDBCLUSTER storage engine in the MySQL server; cause
 
4973
            binaries for the MySQL Cluster management and data node,
 
4974
            management client, and other programs to be built.
 
4975
            This option is supported only in MySQL Cluster NDB 7.0
 
4976
            (NDBCLUSTER storage engine versions 6.4.0 and later)
 
4977
            using the MySQL Cluster sources. It cannot be used to
 
4978
            enable clustering support in other MySQL source trees or
 
4979
            distributions.
 
4980
 
 
4981
          + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none.
5338
4982
 
5339
4983
          + COMPILATION_COMMENT=comment: Server comment, default
5340
4984
            "Source distribution".
5342
4986
          + MYSQL_TCP_PORT=port: Server port, default 3306.
5343
4987
 
5344
4988
          + DISABLE_GRANT_OPTIONS: Disables the --bootstrap,
5345
 
            --skip-grant-tables, and --init-file options for
5346
 
            mysqld. This option is available as of MySQL 5.1.15.
 
4989
            --skip-grant-tables, and --init-file options for mysqld.
 
4990
            This option is available as of MySQL 5.1.15.
5347
4991
       For example (type the command on one line):
5348
 
C:\workdir>win\configure WITH_INNOBASE_STORAGE_ENGINE
 
4992
C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE
5349
4993
             WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
5350
4994
 
5351
 
 
5352
 
    4. From the work directory, execute the win\build-vs8.bat or
5353
 
       win\build-vs71.bat file, depending on the version of
5354
 
       Visual Studio you have installed. The script invokes
5355
 
       CMake, which generates the mysql.sln solution file.
5356
 
       You can also use win\build-vs8_x64.bat to build the
5357
 
       64-bit version of MySQL. However, you cannot build the
5358
 
       64-bit version with Visual Studio Express Edition. You
5359
 
       must use Visual Studio 2005 (8.0) or higher.
5360
 
 
5361
 
    5. From the work directory, open the generated mysql.sln
5362
 
       file with Visual Studio and select the proper
5363
 
       configuration using the Configuration menu. The menu
5364
 
       provides Debug, Release, RelwithDebInfo, MinRelInfo
5365
 
       options. Then select Solution > Build to build the
5366
 
       solution.
5367
 
       Remember the configuration that you use in this step. It
5368
 
       is important later when you run the test script because
5369
 
       that script needs to know which configuration you used.
5370
 
 
5371
 
    6. Test the server. The server built using the preceding
5372
 
       instructions expects that the MySQL base directory and
5373
 
       data directory are C:\mysql and C:\mysql\data by default.
5374
 
       If you want to test your server using the source tree
5375
 
       root directory and its data directory as the base
5376
 
       directory and data directory, you need to tell the server
5377
 
       their pathnames. You can either do this on the command
5378
 
       line with the --basedir and --datadir options, or by
5379
 
       placing appropriate options in an option file. (See
5380
 
       Section 4.2.3.2, "Using Option Files.") If you have an
5381
 
       existing data directory elsewhere that you want to use,
5382
 
       you can specify its pathname instead.
 
4995
    3. From the work directory, execute the win\build-vs8.bat or
 
4996
       win\build-vs71.bat file, depending on the version of Visual
 
4997
       Studio you have installed. The script invokes CMake, which
 
4998
       generates the mysql.sln solution file.
 
4999
       You can also use win\build-vs8_x64.bat to build the 64-bit
 
5000
       version of MySQL. However, you cannot build the 64-bit version
 
5001
       with Visual Studio Express Edition. You must use Visual Studio
 
5002
       2005 (8.0) or higher.
 
5003
 
 
5004
    4. From the work directory, open the generated mysql.sln file
 
5005
       with Visual Studio and select the proper configuration using
 
5006
       the Configuration menu. The menu provides Debug, Release,
 
5007
       RelwithDebInfo, MinRelInfo options. Then select Solution >
 
5008
       Build to build the solution.
 
5009
       Remember the configuration that you use in this step. It is
 
5010
       important later when you run the test script because that
 
5011
       script needs to know which configuration you used.
 
5012
 
 
5013
    5. Test the server. The server built using the preceding
 
5014
       instructions expects that the MySQL base directory and data
 
5015
       directory are C:\mysql and C:\mysql\data by default. If you
 
5016
       want to test your server using the source tree root directory
 
5017
       and its data directory as the base directory and data
 
5018
       directory, you need to tell the server their path names. You
 
5019
       can either do this on the command line with the --basedir and
 
5020
       --datadir options, or by placing appropriate options in an
 
5021
       option file. (See Section 4.2.3.2, "Using Option Files.") If
 
5022
       you have an existing data directory elsewhere that you want to
 
5023
       use, you can specify its path name instead.
5383
5024
       When the server is running in standalone fashion or as a
5384
 
       service based on your configuration, try to connect to it
5385
 
       from the mysql interactive command-line utility.
5386
 
       You can also run the standard test script,
5387
 
       mysql-test-run.pl. This script is written in Perl, so
5388
 
       you'll need either Cygwin or ActiveState Perl to run it.
5389
 
       You may also need to install the modules required by the
5390
 
       script. To run the test script, change location into the
5391
 
       mysql-test directory under the work directory, set the
5392
 
       MTR_VS_CONFIG environment variable to the configuration
5393
 
       you selected earlier (or use the --vs-config option), and
5394
 
       invoke mysql-test-run.pl. For example (using Cygwin and
5395
 
       the bash shell):
 
5025
       service based on your configuration, try to connect to it from
 
5026
       the mysql interactive command-line utility.
 
5027
       You can also run the standard test script, mysql-test-run.pl.
 
5028
       This script is written in Perl, so you'll need either Cygwin
 
5029
       or ActiveState Perl to run it. You may also need to install
 
5030
       the modules required by the script. To run the test script,
 
5031
       change location into the mysql-test directory under the work
 
5032
       directory, set the MTR_VS_CONFIG environment variable to the
 
5033
       configuration you selected earlier (or use the --vs-config
 
5034
       option), and invoke mysql-test-run.pl. For example (using
 
5035
       Cygwin and the bash shell):
5396
5036
shell> cd mysql-test
5397
5037
shell> export MTS_VS_CONFIG=debug
5398
5038
shell> ./mysql-test-run.pl --force --timer
5400
5040
 
5401
5041
   When you are satisfied that the programs you have built are
5402
5042
   working correctly, stop the server. Now you can install the
5403
 
   distribution. One way to do this is to use the
5404
 
   make_win_bin_dist script in the scripts directory of the
5405
 
   MySQL source distribution (see Section 4.4.2,
5406
 
   "make_win_bin_dist --- Package MySQL Distribution as ZIP
5407
 
   Archive"). This is a shell script, so you must have Cygwin
5408
 
   installed if you want to use it. It creates a Zip archive of
5409
 
   the built executables and support files that you can unpack
5410
 
   in the location at which you want to install MySQL.
5411
 
 
5412
 
   It is also possible to install MySQL by copying directories
5413
 
   and files directly:
5414
 
 
5415
 
    1. Create the directories where you want to install MySQL.
5416
 
       For example, to install into C:\mysql, use these
5417
 
       commands:
 
5043
   distribution. One way to do this is to use the make_win_bin_dist
 
5044
   script in the scripts directory of the MySQL source distribution
 
5045
   (see Section 4.4.2, "make_win_bin_dist --- Package MySQL
 
5046
   Distribution as ZIP Archive"). This is a shell script, so you must
 
5047
   have Cygwin installed if you want to use it. It creates a Zip
 
5048
   archive of the built executables and support files that you can
 
5049
   unpack in the location at which you want to install MySQL.
 
5050
 
 
5051
   It is also possible to install MySQL by copying directories and
 
5052
   files directly:
 
5053
 
 
5054
    1. Create the directories where you want to install MySQL. For
 
5055
       example, to install into C:\mysql, use these commands:
5418
5056
C:\> mkdir C:\mysql
5419
5057
C:\> mkdir C:\mysql\bin
5420
5058
C:\> mkdir C:\mysql\data
5421
5059
C:\> mkdir C:\mysql\share
5422
5060
C:\> mkdir C:\mysql\scripts
5423
 
 
5424
 
       If you want to compile other clients and link them to
5425
 
       MySQL, you should also create several additional
5426
 
       directories:
 
5061
       If you want to compile other clients and link them to MySQL,
 
5062
       you should also create several additional directories:
5427
5063
C:\> mkdir C:\mysql\include
5428
5064
C:\> mkdir C:\mysql\lib
5429
5065
C:\> mkdir C:\mysql\lib\debug
5430
5066
C:\> mkdir C:\mysql\lib\opt
5431
 
 
5432
5067
       If you want to benchmark MySQL, create this directory:
5433
5068
C:\> mkdir C:\mysql\sql-bench
5434
 
 
5435
 
       Benchmarking requires Perl support. See Section 2.16,
5436
 
       "Perl Installation Notes."
5437
 
 
5438
 
    2. From the work directory, copy into the C:\mysql directory
5439
 
       the following directories:
 
5069
       Benchmarking requires Perl support. See Section 2.15, "Perl
 
5070
       Installation Notes."
 
5071
 
 
5072
    2. From the work directory, copy into the C:\mysql directory the
 
5073
       following directories:
5440
5074
C:\> cd \workdir
5441
5075
C:\workdir> copy client_release\*.exe C:\mysql\bin
5442
 
C:\workdir> copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.exe
 
5076
C:\workdir> copy client_debug\mysqld.exe C:\mysql\bin\mysqld-debug.ex
 
5077
e
5443
5078
C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E
5444
5079
C:\workdir> xcopy share\*.* C:\mysql\share /E
5445
 
 
5446
 
       If you want to compile other clients and link them to
5447
 
       MySQL, you should also copy several libraries and header
5448
 
       files:
 
5080
       If you want to compile other clients and link them to MySQL,
 
5081
       you should also copy several libraries and header files:
5449
5082
C:\workdir> copy lib_debug\mysqlclient.lib C:\mysql\lib\debug
5450
5083
C:\workdir> copy lib_debug\libmysql.* C:\mysql\lib\debug
5451
5084
C:\workdir> copy lib_debug\zlib.* C:\mysql\lib\debug
5454
5087
C:\workdir> copy lib_release\zlib.* C:\mysql\lib\opt
5455
5088
C:\workdir> copy include\*.h C:\mysql\include
5456
5089
C:\workdir> copy libmysql\libmysql.def C:\mysql\include
5457
 
 
5458
5090
       If you want to benchmark MySQL, you should also do this:
5459
5091
C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E
5460
5092
 
5461
 
   After installation, set up and start the server in the same
5462
 
   way as for binary Windows distributions. See Section 2.3,
5463
 
   "Installing MySQL on Windows."
 
5093
   After installation, set up and start the server in the same way as
 
5094
   for binary Windows distributions. See Section 2.3, "Installing
 
5095
   MySQL on Windows."
5464
5096
 
5465
5097
2.10.7. Compiling MySQL Clients on Windows
5466
5098
 
5470
5102
#include <mysql.h>
5471
5103
 
5472
5104
   my_global.h includes any other files needed for Windows
5473
 
   compatibility (such as windows.h) if you compile your program
5474
 
   on Windows.
 
5105
   compatibility (such as windows.h) if you compile your program on
 
5106
   Windows.
5475
5107
 
5476
5108
   You can either link your code with the dynamic libmysql.lib
5477
5109
   library, which is just a wrapper to load in libmysql.dll on
5478
5110
   demand, or link with the static mysqlclient.lib library.
5479
5111
 
5480
 
   The MySQL client libraries are compiled as threaded
5481
 
   libraries, so you should also compile your code to be
5482
 
   multi-threaded.
 
5112
   The MySQL client libraries are compiled as threaded libraries, so
 
5113
   you should also compile your code to be multi-threaded.
5483
5114
 
5484
5115
2.11. Post-Installation Setup and Testing
5485
5116
 
5486
5117
   After installing MySQL, there are some issues that you should
5487
5118
   address. For example, on Unix, you should initialize the data
5488
 
   directory and create the MySQL grant tables. On all
5489
 
   platforms, an important security concern is that the initial
5490
 
   accounts in the grant tables have no passwords. You should
5491
 
   assign passwords to prevent unauthorized access to the MySQL
5492
 
   server. Optionally, you can create time zone tables to enable
5493
 
   recognition of named time zones.
5494
 
 
5495
 
   The following sections include post-installation procedures
5496
 
   that are specific to Windows systems and to Unix systems.
5497
 
   Another section, Section 2.11.2.3, "Starting and
5498
 
   Troubleshooting the MySQL Server," applies to all platforms;
5499
 
   it describes what to do if you have trouble getting the
5500
 
   server to start. Section 2.11.3, "Securing the Initial MySQL
5501
 
   Accounts," also applies to all platforms. You should follow
5502
 
   its instructions to make sure that you have properly
5503
 
   protected your MySQL accounts by assigning passwords to them.
5504
 
 
5505
 
   When you are ready to create additional user accounts, you
5506
 
   can find information on the MySQL access control system and
5507
 
   account management in Section 5.4, "The MySQL Access
5508
 
   Privilege System," and Section 5.5, "MySQL User Account
5509
 
   Management."
 
5119
   directory and create the MySQL grant tables. On all platforms, an
 
5120
   important security concern is that the initial accounts in the
 
5121
   grant tables have no passwords. You should assign passwords to
 
5122
   prevent unauthorized access to the MySQL server. Optionally, you
 
5123
   can create time zone tables to enable recognition of named time
 
5124
   zones.
 
5125
 
 
5126
   The following sections include post-installation procedures that
 
5127
   are specific to Windows systems and to Unix systems. Another
 
5128
   section, Section 2.11.2.3, "Starting and Troubleshooting the MySQL
 
5129
   Server," applies to all platforms; it describes what to do if you
 
5130
   have trouble getting the server to start. Section 2.11.3,
 
5131
   "Securing the Initial MySQL Accounts," also applies to all
 
5132
   platforms. You should follow its instructions to make sure that
 
5133
   you have properly protected your MySQL accounts by assigning
 
5134
   passwords to them.
 
5135
 
 
5136
   When you are ready to create additional user accounts, you can
 
5137
   find information on the MySQL access control system and account
 
5138
   management in Section 5.4, "The MySQL Access Privilege System,"
 
5139
   and Section 5.5, "MySQL User Account Management."
5510
5140
 
5511
5141
2.11.1. Windows Post-Installation Procedures
5512
5142
 
5513
 
   On Windows, the data directory and the grant tables do not
5514
 
   have to be created. MySQL Windows distributions include the
5515
 
   grant tables with a set of preinitialized accounts in the
5516
 
   mysql database under the data directory. It is unnecessary to
5517
 
   run the mysql_install_db script that is used on Unix.
5518
 
   Regarding passwords, if you installed MySQL using the Windows
5519
 
   Installation Wizard, you may have already assigned passwords
5520
 
   to the accounts. (See Section 2.3.3, "Using the MySQL
5521
 
   Installation Wizard.") Otherwise, use the password-assignment
5522
 
   procedure given in Section 2.11.3, "Securing the Initial
5523
 
   MySQL Accounts."
 
5143
   On Windows, the data directory and the grant tables do not have to
 
5144
   be created. MySQL Windows distributions include the grant tables
 
5145
   with a set of preinitialized accounts in the mysql database under
 
5146
   the data directory. It is unnecessary to run the mysql_install_db
 
5147
   script that is used on Unix. Regarding passwords, if you installed
 
5148
   MySQL using the Windows Installation Wizard, you may have already
 
5149
   assigned passwords to the accounts. (See Section 2.3.3, "Using the
 
5150
   MySQL Installation Wizard.") Otherwise, use the
 
5151
   password-assignment procedure given in Section 2.11.3, "Securing
 
5152
   the Initial MySQL Accounts."
5524
5153
 
5525
 
   Before setting up passwords, you might want to try running
5526
 
   some client programs to make sure that you can connect to the
5527
 
   server and that it is operating properly. Make sure that the
5528
 
   server is running (see Section 2.3.9, "Starting the Server
5529
 
   for the First Time"), and then issue the following commands
5530
 
   to verify that you can retrieve information from the server.
5531
 
   The output should be similar to what is shown here:
 
5154
   Before setting up passwords, you might want to try running some
 
5155
   client programs to make sure that you can connect to the server
 
5156
   and that it is operating properly. Make sure that the server is
 
5157
   running (see Section 2.3.9, "Starting the Server for the First
 
5158
   Time"), and then issue the following commands to verify that you
 
5159
   can retrieve information from the server. The output should be
 
5160
   similar to what is shown here:
5532
5161
C:\> C:\mysql\bin\mysqlshow
5533
5162
+--------------------+
5534
5163
|     Databases      |
5575
5204
| %    | test% |      |
5576
5205
+------+-------+------+
5577
5206
 
5578
 
   You may need to specify a different directory from the one
5579
 
   shown; if you used the Windows Installation Wizard, then the
5580
 
   default directory is C:\Program Files\MySQL\MySQL Server 5.1,
5581
 
   and the mysql and mysqlshow client programs are in C:\Program
5582
 
   Files\MySQL\MySQL Server 5.1\bin. See Section 2.3.3, "Using
5583
 
   the MySQL Installation Wizard," for more information.
 
5207
   You may need to specify a different directory from the one shown;
 
5208
   if you used the Windows Installation Wizard, then the default
 
5209
   directory is C:\Program Files\MySQL\MySQL Server 5.1, and the
 
5210
   mysql and mysqlshow client programs are in C:\Program
 
5211
   Files\MySQL\MySQL Server 5.1\bin. See Section 2.3.3, "Using the
 
5212
   MySQL Installation Wizard," for more information.
5584
5213
 
5585
 
   If you have already secured the initial MySQL accounts, you
5586
 
   may need to use the -u and -p options to supply a user name
5587
 
   and password to the mysqlshow and mysql client programs;
5588
 
   otherwise the programs may fail with an error, or you may not
5589
 
   be able to view all databases. For example, if you have
5590
 
   assigned the password "secretpass" to the MySQL root account,
5591
 
   then you can invoke mysqlshow and mysql as shown here:
 
5214
   If you have already secured the initial MySQL accounts, you may
 
5215
   need to use the -u and -p options to supply a user name and
 
5216
   password to the mysqlshow and mysql client programs; otherwise the
 
5217
   programs may fail with an error, or you may not be able to view
 
5218
   all databases. For example, if you have assigned the password
 
5219
   "secretpass" to the MySQL root account, then you can invoke
 
5220
   mysqlshow and mysql as shown here:
5592
5221
C:\> C:\mysql\bin\mysqlshow -uroot -psecretpass
5593
5222
+--------------------+
5594
5223
|     Databases      |
5628
5257
+---------------------------+
5629
5258
 
5630
5259
 
5631
 
C:\> C:\mysql\bin\mysql -uroot -psecretpass -e "SELECT Host,Db,User FR
5632
 
OM db" mysql
 
5260
C:\> C:\mysql\bin\mysql -uroot -psecretpass -e "SELECT Host,Db,User F
 
5261
ROM db" mysql
5633
5262
+------+-------+------+
5634
5263
| host | db    | user |
5635
5264
+------+-------+------+
5637
5266
+------+-------+------+
5638
5267
 
5639
5268
   For more information about these programs, see Section 4.5.6,
5640
 
   "mysqlshow --- Display Database, Table, and Column
5641
 
   Information," and Section 4.5.1, "mysql --- The MySQL
5642
 
   Command-Line Tool."
 
5269
   "mysqlshow --- Display Database, Table, and Column Information,"
 
5270
   and Section 4.5.1, "mysql --- The MySQL Command-Line Tool."
5643
5271
 
5644
 
   If you are running a version of Windows that supports
5645
 
   services and you want the MySQL server to run automatically
5646
 
   when Windows starts, see Section 2.3.11, "Starting MySQL as a
5647
 
   Windows Service."
 
5272
   If you are running a version of Windows that supports services and
 
5273
   you want the MySQL server to run automatically when Windows
 
5274
   starts, see Section 2.3.11, "Starting MySQL as a Windows Service."
5648
5275
 
5649
5276
2.11.2. Unix Post-Installation Procedures
5650
5277
 
5651
 
   After installing MySQL on Unix, you need to initialize the
5652
 
   grant tables, start the server, and make sure that the server
5653
 
   works satisfactorily. You may also wish to arrange for the
5654
 
   server to be started and stopped automatically when your
5655
 
   system starts and stops. You should also assign passwords to
5656
 
   the accounts in the grant tables.
 
5278
   After installing MySQL on Unix, you need to initialize the grant
 
5279
   tables, start the server, and make sure that the server works
 
5280
   satisfactorily. You may also wish to arrange for the server to be
 
5281
   started and stopped automatically when your system starts and
 
5282
   stops. You should also assign passwords to the accounts in the
 
5283
   grant tables.
5657
5284
 
5658
5285
   On Unix, the grant tables are set up by the mysql_install_db
5659
 
   program. For some installation methods, this program is run
5660
 
   for you automatically:
5661
 
 
5662
 
     * If you install MySQL on Linux using RPM distributions,
5663
 
       the server RPM runs mysql_install_db.
5664
 
 
5665
 
     * If you install MySQL on Mac OS X using a PKG
5666
 
       distribution, the installer runs mysql_install_db.
 
5286
   program. For some installation methods, this program is run for
 
5287
   you automatically:
 
5288
 
 
5289
     * If you install MySQL on Linux using RPM distributions, the
 
5290
       server RPM runs mysql_install_db.
 
5291
 
 
5292
     * If you install MySQL on Mac OS X using a PKG distribution, the
 
5293
       installer runs mysql_install_db.
5667
5294
 
5668
5295
   Otherwise, you'll need to run mysql_install_db yourself.
5669
5296
 
5670
5297
   The following procedure describes how to initialize the grant
5671
 
   tables (if that has not previously been done) and then start
5672
 
   the server. It also suggests some commands that you can use
5673
 
   to test whether the server is accessible and working
5674
 
   properly. For information about starting and stopping the
5675
 
   server automatically, see Section 2.11.2.2, "Starting and
5676
 
   Stopping MySQL Automatically."
5677
 
 
5678
 
   After you complete the procedure and have the server running,
5679
 
   you should assign passwords to the accounts created by
5680
 
   mysql_install_db. Instructions for doing so are given in
5681
 
   Section 2.11.3, "Securing the Initial MySQL Accounts."
5682
 
 
5683
 
   In the examples shown here, the server runs under the user ID
5684
 
   of the mysql login account. This assumes that such an account
5685
 
   exists. Either create the account if it does not exist, or
5686
 
   substitute the name of a different existing login account
5687
 
   that you plan to use for running the server.
5688
 
 
5689
 
    1. Change location into the top-level directory of your
5690
 
       MySQL installation, represented here by BASEDIR:
 
5298
   tables (if that has not previously been done) and then start the
 
5299
   server. It also suggests some commands that you can use to test
 
5300
   whether the server is accessible and working properly. For
 
5301
   information about starting and stopping the server automatically,
 
5302
   see Section 2.11.2.2, "Starting and Stopping MySQL Automatically."
 
5303
 
 
5304
   After you complete the procedure and have the server running, you
 
5305
   should assign passwords to the accounts created by
 
5306
   mysql_install_db. Instructions for doing so are given in Section
 
5307
   2.11.3, "Securing the Initial MySQL Accounts."
 
5308
 
 
5309
   In the examples shown here, the server runs under the user ID of
 
5310
   the mysql login account. This assumes that such an account exists.
 
5311
   Either create the account if it does not exist, or substitute the
 
5312
   name of a different existing login account that you plan to use
 
5313
   for running the server.
 
5314
 
 
5315
    1. Change location into the top-level directory of your MySQL
 
5316
       installation, represented here by BASEDIR:
5691
5317
shell> cd BASEDIR
5692
 
 
5693
 
       BASEDIR is likely to be something like /usr/local/mysql
5694
 
       or /usr/local. The following steps assume that you are
5695
 
       located in this directory.
5696
 
 
5697
 
    2. If necessary, run the mysql_install_db program to set up
5698
 
       the initial MySQL grant tables containing the privileges
5699
 
       that determine how users are allowed to connect to the
5700
 
       server. You'll need to do this if you used a distribution
5701
 
       type for which the installation procedure doesn't run the
5702
 
       program for you.
5703
 
       Typically, mysql_install_db needs to be run only the
5704
 
       first time you install MySQL, so you can skip this step
5705
 
       if you are upgrading an existing installation, However,
5706
 
       mysql_install_db does not overwrite any existing
5707
 
       privilege tables, so it should be safe to run in any
5708
 
       circumstances.
 
5318
       BASEDIR is likely to be something like /usr/local/mysql or
 
5319
       /usr/local. The following steps assume that you are located in
 
5320
       this directory.
 
5321
 
 
5322
    2. If necessary, run the mysql_install_db program to set up the
 
5323
       initial MySQL grant tables containing the privileges that
 
5324
       determine how users are allowed to connect to the server.
 
5325
       You'll need to do this if you used a distribution type for
 
5326
       which the installation procedure doesn't run the program for
 
5327
       you.
 
5328
       Typically, mysql_install_db needs to be run only the first
 
5329
       time you install MySQL, so you can skip this step if you are
 
5330
       upgrading an existing installation, However, mysql_install_db
 
5331
       does not overwrite any existing privilege tables, so it should
 
5332
       be safe to run in any circumstances.
5709
5333
       To initialize the grant tables, use one of the following
5710
 
       commands, depending on whether mysql_install_db is
5711
 
       located in the bin or scripts directory:
 
5334
       commands, depending on whether mysql_install_db is located in
 
5335
       the bin or scripts directory:
5712
5336
shell> bin/mysql_install_db --user=mysql
5713
5337
shell> scripts/mysql_install_db --user=mysql
5714
 
 
 
5338
       It might be necessary to specify other options such as
 
5339
       --basedir or --datadir if mysql_install_db does not use the
 
5340
       correct locations for the installation directory or data
 
5341
       directory. For example:
 
5342
shell> bin/mysql_install_db --user=mysql \
 
5343
         --basedir=/opt/mysql/mysql \
 
5344
         --datadir=/opt/mysql/mysql/data
5715
5345
       The mysql_install_db script creates the server's data
5716
 
       directory. Under the data directory, it creates
5717
 
       directories for the mysql database that holds all
5718
 
       database privileges and the test database that you can
5719
 
       use to test MySQL. The script also creates privilege
5720
 
       table entries for root and anonymous-user accounts. The
5721
 
       accounts have no passwords initially. A description of
5722
 
       their initial privileges is given in Section 2.11.3,
5723
 
       "Securing the Initial MySQL Accounts." Briefly, these
5724
 
       privileges allow the MySQL root user to do anything, and
5725
 
       allow anybody to create or use databases with a name of
5726
 
       test or starting with test_.
5727
 
       It is important to make sure that the database
5728
 
       directories and files are owned by the mysql login
5729
 
       account so that the server has read and write access to
5730
 
       them when you run it later. To ensure this, the --user
5731
 
       option should be used as shown if you run
5732
 
       mysql_install_db as root. Otherwise, you should execute
5733
 
       the script while logged in as mysql, in which case you
5734
 
       can omit the --user option from the command.
5735
 
       mysql_install_db creates several tables in the mysql
5736
 
       database, including user, db, host, tables_priv,
5737
 
       columns_priv, func, and others. See Section 5.4, "The
5738
 
       MySQL Access Privilege System," for a complete listing
5739
 
       and description of these tables.
5740
 
       If you don't want to have the test database, you can
5741
 
       remove it with mysqladmin -u root drop test after
5742
 
       starting the server.
5743
 
       If you have trouble with mysql_install_db at this point,
5744
 
       see Section 2.11.2.1, "Problems Running
5745
 
       mysql_install_db."
 
5346
       directory. Under the data directory, it creates directories
 
5347
       for the mysql database that holds all database privileges and
 
5348
       the test database that you can use to test MySQL. The script
 
5349
       also creates privilege table entries for root and
 
5350
       anonymous-user accounts. The accounts have no passwords
 
5351
       initially. A description of their initial privileges is given
 
5352
       in Section 2.11.3, "Securing the Initial MySQL Accounts."
 
5353
       Briefly, these privileges allow the MySQL root user to do
 
5354
       anything, and allow anybody to create or use databases with a
 
5355
       name of test or starting with test_.
 
5356
       It is important to make sure that the database directories and
 
5357
       files are owned by the mysql login account so that the server
 
5358
       has read and write access to them when you run it later. To
 
5359
       ensure this, the --user option should be used as shown if you
 
5360
       run mysql_install_db as root. Otherwise, you should execute
 
5361
       the script while logged in as mysql, in which case you can
 
5362
       omit the --user option from the command.
 
5363
       mysql_install_db creates several tables in the mysql database,
 
5364
       including user, db, host, tables_priv, columns_priv, func, and
 
5365
       others. See Section 5.4, "The MySQL Access Privilege System,"
 
5366
       for a complete listing and description of these tables.
 
5367
       If you don't want to have the test database, you can remove it
 
5368
       with mysqladmin -u root drop test after starting the server.
 
5369
       If you have trouble with mysql_install_db at this point, see
 
5370
       Section 2.11.2.1, "Problems Running mysql_install_db."
5746
5371
 
5747
5372
    3. Start the MySQL server:
5748
5373
shell> bin/mysqld_safe --user=mysql &
5749
 
 
5750
5374
       It is important that the MySQL server be run using an
5751
 
       unprivileged (non-root) login account. To ensure this,
5752
 
       the --user option should be used as shown if you run
5753
 
       mysqld_safe as system root. Otherwise, you should execute
5754
 
       the script while logged in to the system as mysql, in
5755
 
       which case you can omit the --user option from the
5756
 
       command.
5757
 
       Further instructions for running MySQL as an unprivileged
5758
 
       user are given in Section 5.3.5, "How to Run MySQL as a
5759
 
       Normal User."
5760
 
       If you neglected to create the grant tables before
5761
 
       proceeding to this step, the following message appears in
5762
 
       the error log file when you start the server:
 
5375
       unprivileged (non-root) login account. To ensure this, the
 
5376
       --user option should be used as shown if you run mysqld_safe
 
5377
       as system root. Otherwise, you should execute the script while
 
5378
       logged in to the system as mysql, in which case you can omit
 
5379
       the --user option from the command.
 
5380
       Further instructions for running MySQL as an unprivileged user
 
5381
       are given in Section 5.3.5, "How to Run MySQL as a Normal
 
5382
       User."
 
5383
       If you neglected to create the grant tables before proceeding
 
5384
       to this step, the following message appears in the error log
 
5385
       file when you start the server:
5763
5386
mysqld: Can't find file: 'host.frm'
5764
 
 
5765
 
       If you have other problems starting the server, see
5766
 
       Section 2.11.2.3, "Starting and Troubleshooting the MySQL
5767
 
       Server."
 
5387
       If you have other problems starting the server, see Section
 
5388
       2.11.2.3, "Starting and Troubleshooting the MySQL Server."
5768
5389
 
5769
5390
    4. Use mysqladmin to verify that the server is running. The
5770
 
       following commands provide simple tests to check whether
5771
 
       the server is up and responding to connections:
 
5391
       following commands provide simple tests to check whether the
 
5392
       server is up and responding to connections:
5772
5393
shell> bin/mysqladmin version
5773
5394
shell> bin/mysqladmin variables
5774
 
 
5775
 
       The output from mysqladmin version varies slightly
5776
 
       depending on your platform and version of MySQL, but
5777
 
       should be similar to that shown here:
 
5395
       The output from mysqladmin version varies slightly depending
 
5396
       on your platform and version of MySQL, but should be similar
 
5397
       to that shown here:
5778
5398
shell> bin/mysqladmin version
5779
 
mysqladmin  Ver 14.12 Distrib 5.1.31, for pc-linux-gnu on i686
 
5399
mysqladmin  Ver 14.12 Distrib 5.1.35, for pc-linux-gnu on i686
5780
5400
...
5781
5401
 
5782
 
Server version          5.1.31
 
5402
Server version          5.1.35
5783
5403
Protocol version        10
5784
5404
Connection              Localhost via UNIX socket
5785
5405
UNIX socket             /var/lib/mysql/mysql.sock
5788
5408
Threads: 1  Questions: 366  Slow queries: 0
5789
5409
Opens: 0  Flush tables: 1  Open tables: 19
5790
5410
Queries per second avg: 0.000
5791
 
 
5792
 
       To see what else you can do with mysqladmin, invoke it
5793
 
       with the --help option.
 
5411
       To see what else you can do with mysqladmin, invoke it with
 
5412
       the --help option.
5794
5413
 
5795
5414
    5. Verify that you can shut down the server:
5796
5415
shell> bin/mysqladmin -u root shutdown
5797
5416
 
5798
 
 
5799
 
    6. Verify that you can start the server again. Do this by
5800
 
       using mysqld_safe or by invoking mysqld directly. For
5801
 
       example:
 
5417
    6. Verify that you can start the server again. Do this by using
 
5418
       mysqld_safe or by invoking mysqld directly. For example:
5802
5419
shell> bin/mysqld_safe --user=mysql --log &
5803
 
 
5804
5420
       If mysqld_safe fails, see Section 2.11.2.3, "Starting and
5805
5421
       Troubleshooting the MySQL Server."
5806
5422
 
5807
5423
    7. Run some simple tests to verify that you can retrieve
5808
 
       information from the server. The output should be similar
5809
 
       to what is shown here:
 
5424
       information from the server. The output should be similar to
 
5425
       what is shown here:
5810
5426
shell> bin/mysqlshow
5811
5427
+-----------+
5812
5428
| Databases |
5847
5463
| %    | test_% |      |
5848
5464
+------+--------+------+
5849
5465
 
5850
 
 
5851
 
    8. There is a benchmark suite in the sql-bench directory
5852
 
       (under the MySQL installation directory) that you can use
5853
 
       to compare how MySQL performs on different platforms. The
5854
 
       benchmark suite is written in Perl. It requires the Perl
5855
 
       DBI module that provides a database-independent interface
5856
 
       to the various databases, and some other additional Perl
5857
 
       modules:
 
5466
    8. There is a benchmark suite in the sql-bench directory (under
 
5467
       the MySQL installation directory) that you can use to compare
 
5468
       how MySQL performs on different platforms. The benchmark suite
 
5469
       is written in Perl. It requires the Perl DBI module that
 
5470
       provides a database-independent interface to the various
 
5471
       databases, and some other additional Perl modules:
5858
5472
DBI
5859
5473
DBD::mysql
5860
5474
Data::Dumper
5861
5475
Data::ShowTable
5862
 
 
5863
5476
       These modules can be obtained from CPAN
5864
 
       (http://www.cpan.org/). See also Section 2.16.1,
5865
 
       "Installing Perl on Unix."
5866
 
       The sql-bench/Results directory contains the results from
5867
 
       many runs against different databases and platforms. To
5868
 
       run all tests, execute these commands:
 
5477
       (http://www.cpan.org/). See also Section 2.15.1, "Installing
 
5478
       Perl on Unix."
 
5479
       The sql-bench/Results directory contains the results from many
 
5480
       runs against different databases and platforms. To run all
 
5481
       tests, execute these commands:
5869
5482
shell> cd sql-bench
5870
5483
shell> perl run-all-tests
5871
 
 
5872
5484
       If you don't have the sql-bench directory, you probably
5873
 
       installed MySQL using RPM files other than the source
5874
 
       RPM. (The source RPM includes the sql-bench benchmark
5875
 
       directory.) In this case, you must first install the
5876
 
       benchmark suite before you can use it. There are separate
5877
 
       benchmark RPM files named mysql-bench-VERSION.i386.rpm
5878
 
       that contain benchmark code and data.
5879
 
       If you have a source distribution, there are also tests
5880
 
       in its tests subdirectory that you can run. For example,
5881
 
       to run auto_increment.tst, execute this command from the
5882
 
       top-level directory of your source distribution:
 
5485
       installed MySQL using RPM files other than the source RPM.
 
5486
       (The source RPM includes the sql-bench benchmark directory.)
 
5487
       In this case, you must first install the benchmark suite
 
5488
       before you can use it. There are separate benchmark RPM files
 
5489
       named mysql-bench-VERSION.i386.rpm that contain benchmark code
 
5490
       and data.
 
5491
       If you have a source distribution, there are also tests in its
 
5492
       tests subdirectory that you can run. For example, to run
 
5493
       auto_increment.tst, execute this command from the top-level
 
5494
       directory of your source distribution:
5883
5495
shell> mysql -vvf test < ./tests/auto_increment.tst
5884
 
 
5885
5496
       The expected result of the test can be found in the
5886
5497
       ./tests/auto_increment.res file.
5887
5498
 
5888
 
    9. At this point, you should have the server running.
5889
 
       However, none of the initial MySQL accounts have a
5890
 
       password, so you should assign passwords using the
5891
 
       instructions found in Section 2.11.3, "Securing the
5892
 
       Initial MySQL Accounts."
 
5499
    9. At this point, you should have the server running. However,
 
5500
       none of the initial MySQL accounts have a password, so you
 
5501
       should assign passwords using the instructions found in
 
5502
       Section 2.11.3, "Securing the Initial MySQL Accounts."
5893
5503
 
5894
 
   The MySQL 5.1 installation procedure creates time zone tables
5895
 
   in the mysql database. However, you must populate the tables
5896
 
   manually using the instructions in Section 9.7, "MySQL Server
5897
 
   Time Zone Support."
 
5504
   The MySQL 5.1 installation procedure creates time zone tables in
 
5505
   the mysql database. However, you must populate the tables manually
 
5506
   using the instructions in Section 9.7, "MySQL Server Time Zone
 
5507
   Support."
5898
5508
 
5899
5509
2.11.2.1. Problems Running mysql_install_db
5900
5510
 
5902
5512
   MySQL privilege tables. It does not overwrite existing MySQL
5903
5513
   privilege tables, and it does not affect any other data.
5904
5514
 
5905
 
   If you want to re-create your privilege tables, first stop
5906
 
   the mysqld server if it's running. Then rename the mysql
5907
 
   directory under the data directory to save it, and then run
5908
 
   mysql_install_db. Suppose that your current directory is the
5909
 
   MySQL installation directory and that mysql_install_db is
5910
 
   located in the bin directory and the data directory is named
5911
 
   data. To rename the mysql database and re-run
5912
 
   mysql_install_db, use these commands.
 
5515
   If you want to re-create your privilege tables, first stop the
 
5516
   mysqld server if it is running. Then rename the mysql directory
 
5517
   under the data directory to save it, and then run
 
5518
   mysql_install_db. Suppose that your current directory is the MySQL
 
5519
   installation directory and that mysql_install_db is located in the
 
5520
   bin directory and the data directory is named data. To rename the
 
5521
   mysql database and re-run mysql_install_db, use these commands.
5913
5522
shell> mv data/mysql data/mysql.old
5914
5523
shell> bin/mysql_install_db --user=mysql
5915
5524
 
5916
 
   When you run mysql_install_db, you might encounter the
5917
 
   following problems:
 
5525
   When you run mysql_install_db, you might encounter the following
 
5526
   problems:
5918
5527
 
5919
5528
     * mysql_install_db fails to install the grant tables
5920
 
       You may find that mysql_install_db fails to install the
5921
 
       grant tables and terminates after displaying the
5922
 
       following messages:
 
5529
       You may find that mysql_install_db fails to install the grant
 
5530
       tables and terminates after displaying the following messages:
5923
5531
Starting mysqld daemon with databases from XXXXXX
5924
5532
mysqld ended
5925
 
 
5926
5533
       In this case, you should examine the error log file very
5927
 
       carefully. The log should be located in the directory
5928
 
       XXXXXX named by the error message and should indicate why
5929
 
       mysqld didn't start. If you do not understand what
5930
 
       happened, include the log when you post a bug report. See
5931
 
       Section 1.6, "How to Report Bugs or Problems."
 
5534
       carefully. The log should be located in the directory XXXXXX
 
5535
       named by the error message and should indicate why mysqld
 
5536
       didn't start. If you do not understand what happened, include
 
5537
       the log when you post a bug report. See Section 1.6, "How to
 
5538
       Report Bugs or Problems."
5932
5539
 
5933
5540
     * There is a mysqld process running
5934
 
       This indicates that the server is running, in which case
5935
 
       the grant tables have probably been created already. If
5936
 
       so, there is no need to run mysql_install_db at all
5937
 
       because it needs to be run only once (when you install
5938
 
       MySQL the first time).
 
5541
       This indicates that the server is running, in which case the
 
5542
       grant tables have probably been created already. If so, there
 
5543
       is no need to run mysql_install_db at all because it needs to
 
5544
       be run only once (when you install MySQL the first time).
5939
5545
 
5940
5546
     * Installing a second mysqld server does not work when one
5941
5547
       server is running
5942
 
       This can happen when you have an existing MySQL
5943
 
       installation, but want to put a new installation in a
5944
 
       different location. For example, you might have a
5945
 
       production installation, but you want to create a second
5946
 
       installation for testing purposes. Generally the problem
5947
 
       that occurs when you try to run a second server is that
5948
 
       it tries to use a network interface that is in use by the
5949
 
       first server. In this case, you should see one of the
5950
 
       following error messages:
 
5548
       This can happen when you have an existing MySQL installation,
 
5549
       but want to put a new installation in a different location.
 
5550
       For example, you might have a production installation, but you
 
5551
       want to create a second installation for testing purposes.
 
5552
       Generally the problem that occurs when you try to run a second
 
5553
       server is that it tries to use a network interface that is in
 
5554
       use by the first server. In this case, you should see one of
 
5555
       the following error messages:
5951
5556
Can't start server: Bind on TCP/IP port:
5952
5557
Address already in use
5953
5558
Can't start server: Bind on unix socket...
5954
 
 
5955
 
       For instructions on setting up multiple servers, see
5956
 
       Section 5.6, "Running Multiple MySQL Servers on the Same
5957
 
       Machine."
 
5559
       For instructions on setting up multiple servers, see Section
 
5560
       5.6, "Running Multiple MySQL Servers on the Same Machine."
5958
5561
 
5959
5562
     * You do not have write access to the /tmp directory
5960
 
       If you do not have write access to create temporary files
5961
 
       or a Unix socket file in the default location (the /tmp
5962
 
       directory), an error occurs when you run mysql_install_db
5963
 
       or the mysqld server.
 
5563
       If you do not have write access to create temporary files or a
 
5564
       Unix socket file in the default location (the /tmp directory),
 
5565
       an error occurs when you run mysql_install_db or the mysqld
 
5566
       server.
5964
5567
       You can specify different locations for the temporary
5965
 
       directory and Unix socket file by executing these
5966
 
       commands prior to starting mysql_install_db or mysqld,
5967
 
       where some_tmp_dir is the full pathname to some directory
5968
 
       for which you have write permission:
 
5568
       directory and Unix socket file by executing these commands
 
5569
       prior to starting mysql_install_db or mysqld, where
 
5570
       some_tmp_dir is the full path name to some directory for which
 
5571
       you have write permission:
5969
5572
shell> TMPDIR=/some_tmp_dir/
5970
5573
shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysql.sock
5971
5574
shell> export TMPDIR MYSQL_UNIX_PORT
5972
 
 
5973
 
       Then you should be able to run mysql_install_db and start
5974
 
       the server with these commands:
 
5575
       Then you should be able to run mysql_install_db and start the
 
5576
       server with these commands:
5975
5577
shell> bin/mysql_install_db --user=mysql
5976
5578
shell> bin/mysqld_safe --user=mysql &
5977
 
 
5978
5579
       If mysql_install_db is located in the scripts directory,
5979
5580
       modify the first command to scripts/mysql_install_db.
5980
 
       See Section B.1.4.5, "How to Protect or Change the MySQL
5981
 
       Unix Socket File," and Section 2.15, "Environment
5982
 
       Variables."
5983
 
 
5984
 
   There are some alternatives to running the mysql_install_db
5985
 
   script provided in the MySQL distribution:
5986
 
 
5987
 
     * If you want the initial privileges to be different from
5988
 
       the standard defaults, you can modify mysql_install_db
5989
 
       before you run it. However, it is preferable to use GRANT
5990
 
       and REVOKE to change the privileges after the grant
5991
 
       tables have been set up. In other words, you can run
5992
 
       mysql_install_db, and then use mysql -u root mysql to
5993
 
       connect to the server as the MySQL root user so that you
5994
 
       can issue the necessary GRANT and REVOKE statements.
5995
 
       If you want to install MySQL on several machines with the
5996
 
       same privileges, you can put the GRANT and REVOKE
5997
 
       statements in a file and execute the file as a script
5998
 
       using mysql after running mysql_install_db. For example:
 
5581
       See Section B.1.4.5, "How to Protect or Change the MySQL Unix
 
5582
       Socket File," and Section 2.14, "Environment Variables."
 
5583
 
 
5584
   There are some alternatives to running the mysql_install_db script
 
5585
   provided in the MySQL distribution:
 
5586
 
 
5587
     * If you want the initial privileges to be different from the
 
5588
       standard defaults, you can modify mysql_install_db before you
 
5589
       run it. However, it is preferable to use GRANT and REVOKE to
 
5590
       change the privileges after the grant tables have been set up.
 
5591
       In other words, you can run mysql_install_db, and then use
 
5592
       mysql -u root mysql to connect to the server as the MySQL root
 
5593
       user so that you can issue the necessary GRANT and REVOKE
 
5594
       statements.
 
5595
       If you want to install MySQL on several machines with the same
 
5596
       privileges, you can put the GRANT and REVOKE statements in a
 
5597
       file and execute the file as a script using mysql after
 
5598
       running mysql_install_db. For example:
5999
5599
shell> bin/mysql_install_db --user=mysql
6000
5600
shell> bin/mysql -u root < your_script_file
6001
 
 
6002
 
       By doing this, you can avoid having to issue the
6003
 
       statements manually on each machine.
6004
 
 
6005
 
     * It is possible to re-create the grant tables completely
6006
 
       after they have previously been created. You might want
6007
 
       to do this if you're just learning how to use GRANT and
6008
 
       REVOKE and have made so many modifications after running
6009
 
       mysql_install_db that you want to wipe out the tables and
6010
 
       start over.
6011
 
       To re-create the grant tables, remove all the .frm, .MYI,
6012
 
       and .MYD files in the mysql database directory. Then run
6013
 
       the mysql_install_db script again.
6014
 
 
6015
 
     * You can start mysqld manually using the
6016
 
       --skip-grant-tables option and add the privilege
6017
 
       information yourself using mysql:
 
5601
       By doing this, you can avoid having to issue the statements
 
5602
       manually on each machine.
 
5603
 
 
5604
     * It is possible to re-create the grant tables completely after
 
5605
       they have previously been created. You might want to do this
 
5606
       if you're just learning how to use GRANT and REVOKE and have
 
5607
       made so many modifications after running mysql_install_db that
 
5608
       you want to wipe out the tables and start over.
 
5609
       To re-create the grant tables, remove all the .frm, .MYI, and
 
5610
       .MYD files in the mysql database directory. Then run the
 
5611
       mysql_install_db script again.
 
5612
 
 
5613
     * You can start mysqld manually using the --skip-grant-tables
 
5614
       option and add the privilege information yourself using mysql:
6018
5615
shell> bin/mysqld_safe --user=mysql --skip-grant-tables &
6019
5616
shell> bin/mysql mysql
6020
 
 
6021
 
       From mysql, manually execute the SQL commands contained
6022
 
       in mysql_install_db. Make sure that you run mysqladmin
6023
 
       flush-privileges or mysqladmin reload afterward to tell
6024
 
       the server to reload the grant tables.
6025
 
       Note that by not using mysql_install_db, you not only
6026
 
       have to populate the grant tables manually, you also have
6027
 
       to create them first.
 
5617
       From mysql, manually execute the SQL commands contained in
 
5618
       mysql_install_db. Make sure that you run mysqladmin
 
5619
       flush-privileges or mysqladmin reload afterward to tell the
 
5620
       server to reload the grant tables.
 
5621
       Note that by not using mysql_install_db, you not only have to
 
5622
       populate the grant tables manually, you also have to create
 
5623
       them first.
6028
5624
 
6029
5625
2.11.2.2. Starting and Stopping MySQL Automatically
6030
5626
 
6032
5628
 
6033
5629
     * By invoking mysqld directly. This works on any platform.
6034
5630
 
6035
 
     * By running the MySQL server as a Windows service. The
6036
 
       service can be set to start the server automatically when
6037
 
       Windows starts, or as a manual service that you start on
6038
 
       request. For instructions, see Section 2.3.11, "Starting
6039
 
       MySQL as a Windows Service."
6040
 
 
6041
 
     * By invoking mysqld_safe, which tries to determine the
6042
 
       proper options for mysqld and then runs it with those
6043
 
       options. This script is used on Unix and Unix-like
6044
 
       systems. See Section 4.3.2, "mysqld_safe --- MySQL Server
 
5631
     * By running the MySQL server as a Windows service. The service
 
5632
       can be set to start the server automatically when Windows
 
5633
       starts, or as a manual service that you start on request. For
 
5634
       instructions, see Section 2.3.11, "Starting MySQL as a Windows
 
5635
       Service."
 
5636
 
 
5637
     * By invoking mysqld_safe, which tries to determine the proper
 
5638
       options for mysqld and then runs it with those options. This
 
5639
       script is used on Unix and Unix-like systems. See Section
 
5640
       4.3.2, "mysqld_safe --- MySQL Server Startup Script."
 
5641
 
 
5642
     * By invoking mysql.server. This script is used primarily at
 
5643
       system startup and shutdown on systems that use System V-style
 
5644
       run directories, where it usually is installed under the name
 
5645
       mysql. The mysql.server script starts the server by invoking
 
5646
       mysqld_safe. See Section 4.3.3, "mysql.server --- MySQL Server
6045
5647
       Startup Script."
6046
5648
 
6047
 
     * By invoking mysql.server. This script is used primarily
6048
 
       at system startup and shutdown on systems that use System
6049
 
       V-style run directories, where it usually is installed
6050
 
       under the name mysql. The mysql.server script starts the
6051
 
       server by invoking mysqld_safe. See Section 4.3.3,
6052
 
       "mysql.server --- MySQL Server Startup Script."
6053
 
 
6054
 
     * On Mac OS X, you can install a separate MySQL Startup
6055
 
       Item package to enable the automatic startup of MySQL on
6056
 
       system startup. The Startup Item starts the server by
6057
 
       invoking mysql.server. See Section 2.5, "Installing MySQL
6058
 
       on Mac OS X," for details.
6059
 
 
6060
 
   The mysqld_safe and mysql.server scripts and the Mac OS X
6061
 
   Startup Item can be used to start the server manually, or
6062
 
   automatically at system startup time. mysql.server and the
6063
 
   Startup Item also can be used to stop the server.
 
5649
     * On Mac OS X, you can install a separate MySQL Startup Item
 
5650
       package to enable the automatic startup of MySQL on system
 
5651
       startup. The Startup Item starts the server by invoking
 
5652
       mysql.server. See Section 2.5, "Installing MySQL on Mac OS X,"
 
5653
       for details.
 
5654
 
 
5655
   The mysqld_safe and mysql.server scripts and the Mac OS X Startup
 
5656
   Item can be used to start the server manually, or automatically at
 
5657
   system startup time. mysql.server and the Startup Item also can be
 
5658
   used to stop the server.
6064
5659
 
6065
5660
   To start or stop the server manually using the mysql.server
6066
5661
   script, invoke it with start or stop arguments:
6067
5662
shell> mysql.server start
6068
5663
shell> mysql.server stop
6069
5664
 
6070
 
   Before mysql.server starts the server, it changes location to
6071
 
   the MySQL installation directory, and then invokes
6072
 
   mysqld_safe. If you want the server to run as some specific
6073
 
   user, add an appropriate user option to the [mysqld] group of
6074
 
   the /etc/my.cnf option file, as shown later in this section.
6075
 
   (It is possible that you will need to edit mysql.server if
6076
 
   you've installed a binary distribution of MySQL in a
6077
 
   non-standard location. Modify it to cd into the proper
 
5665
   Before mysql.server starts the server, it changes location to the
 
5666
   MySQL installation directory, and then invokes mysqld_safe. If you
 
5667
   want the server to run as some specific user, add an appropriate
 
5668
   user option to the [mysqld] group of the /etc/my.cnf option file,
 
5669
   as shown later in this section. (It is possible that you will need
 
5670
   to edit mysql.server if you've installed a binary distribution of
 
5671
   MySQL in a non-standard location. Modify it to cd into the proper
6078
5672
   directory before it runs mysqld_safe. If you do this, your
6079
 
   modified version of mysql.server may be overwritten if you
6080
 
   upgrade MySQL in the future, so you should make a copy of
6081
 
   your edited version that you can reinstall.)
 
5673
   modified version of mysql.server may be overwritten if you upgrade
 
5674
   MySQL in the future, so you should make a copy of your edited
 
5675
   version that you can reinstall.)
6082
5676
 
6083
 
   mysql.server stop stops the server by sending a signal to it.
6084
 
   You can also stop the server manually by executing mysqladmin
 
5677
   mysql.server stop stops the server by sending a signal to it. You
 
5678
   can also stop the server manually by executing mysqladmin
6085
5679
   shutdown.
6086
5680
 
6087
 
   To start and stop MySQL automatically on your server, you
6088
 
   need to add start and stop commands to the appropriate places
6089
 
   in your /etc/rc* files.
 
5681
   To start and stop MySQL automatically on your server, you need to
 
5682
   add start and stop commands to the appropriate places in your
 
5683
   /etc/rc* files.
6090
5684
 
6091
5685
   If you use the Linux server RPM package
6092
 
   (MySQL-server-VERSION.rpm), the mysql.server script is
6093
 
   installed in the /etc/init.d directory with the name mysql.
6094
 
   You need not install it manually. See Section 2.4,
6095
 
   "Installing MySQL from RPM Packages on Linux," for more
6096
 
   information on the Linux RPM packages.
6097
 
 
6098
 
   Some vendors provide RPM packages that install a startup
6099
 
   script under a different name such as mysqld.
6100
 
 
6101
 
   If you install MySQL from a source distribution or using a
6102
 
   binary distribution format that does not install mysql.server
 
5686
   (MySQL-server-VERSION.rpm), the mysql.server script is installed
 
5687
   in the /etc/init.d directory with the name mysql. You need not
 
5688
   install it manually. See Section 2.4, "Installing MySQL from RPM
 
5689
   Packages on Linux," for more information on the Linux RPM
 
5690
   packages.
 
5691
 
 
5692
   Some vendors provide RPM packages that install a startup script
 
5693
   under a different name such as mysqld.
 
5694
 
 
5695
   If you install MySQL from a source distribution or using a binary
 
5696
   distribution format that does not install mysql.server
6103
5697
   automatically, you can install it manually. The script can be
6104
 
   found in the support-files directory under the MySQL
6105
 
   installation directory or in a MySQL source tree.
 
5698
   found in the support-files directory under the MySQL installation
 
5699
   directory or in a MySQL source tree.
6106
5700
 
6107
5701
   To install mysql.server manually, copy it to the /etc/init.d
6108
 
   directory with the name mysql, and then make it executable.
6109
 
   Do this by changing location into the appropriate directory
6110
 
   where mysql.server is located and executing these commands:
 
5702
   directory with the name mysql, and then make it executable. Do
 
5703
   this by changing location into the appropriate directory where
 
5704
   mysql.server is located and executing these commands:
6111
5705
shell> cp mysql.server /etc/init.d/mysql
6112
5706
shell> chmod +x /etc/init.d/mysql
6113
5707
 
6114
 
   Older Red Hat systems use the /etc/rc.d/init.d directory
6115
 
   rather than /etc/init.d. Adjust the preceding commands
6116
 
   accordingly. Alternatively, first create /etc/init.d as a
6117
 
   symbolic link that points to /etc/rc.d/init.d:
 
5708
   Older Red Hat systems use the /etc/rc.d/init.d directory rather
 
5709
   than /etc/init.d. Adjust the preceding commands accordingly.
 
5710
   Alternatively, first create /etc/init.d as a symbolic link that
 
5711
   points to /etc/rc.d/init.d:
6118
5712
shell> cd /etc
6119
5713
shell> ln -s rc.d/init.d .
6120
5714
 
6121
 
   After installing the script, the commands needed to activate
6122
 
   it to run at system startup depend on your operating system.
6123
 
   On Linux, you can use chkconfig:
 
5715
   After installing the script, the commands needed to activate it to
 
5716
   run at system startup depend on your operating system. On Linux,
 
5717
   you can use chkconfig:
6124
5718
shell> chkconfig --add mysql
6125
5719
 
6126
5720
   On some Linux systems, the following command also seems to be
6128
5722
shell> chkconfig --level 345 mysql on
6129
5723
 
6130
5724
   On FreeBSD, startup scripts generally should go in
6131
 
   /usr/local/etc/rc.d/. The rc(8) manual page states that
6132
 
   scripts in this directory are executed only if their basename
6133
 
   matches the *.sh shell filename pattern. Any other files or
6134
 
   directories present within the directory are silently
6135
 
   ignored. In other words, on FreeBSD, you should install the
6136
 
   mysql.server script as /usr/local/etc/rc.d/mysql.server.sh to
6137
 
   enable automatic startup.
 
5725
   /usr/local/etc/rc.d/. The rc(8) manual page states that scripts in
 
5726
   this directory are executed only if their basename matches the
 
5727
   *.sh shell file name pattern. Any other files or directories
 
5728
   present within the directory are silently ignored. In other words,
 
5729
   on FreeBSD, you should install the mysql.server script as
 
5730
   /usr/local/etc/rc.d/mysql.server.sh to enable automatic startup.
6138
5731
 
6139
 
   As an alternative to the preceding setup, some operating
6140
 
   systems also use /etc/rc.local or /etc/init.d/boot.local to
6141
 
   start additional services on startup. To start up MySQL using
6142
 
   this method, you could append a command like the one
6143
 
   following to the appropriate startup file:
 
5732
   As an alternative to the preceding setup, some operating systems
 
5733
   also use /etc/rc.local or /etc/init.d/boot.local to start
 
5734
   additional services on startup. To start up MySQL using this
 
5735
   method, you could append a command like the one following to the
 
5736
   appropriate startup file:
6144
5737
/bin/sh -c 'cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &'
6145
5738
 
6146
 
   For other systems, consult your operating system
6147
 
   documentation to see how to install startup scripts.
 
5739
   For other systems, consult your operating system documentation to
 
5740
   see how to install startup scripts.
6148
5741
 
6149
 
   You can add options for mysql.server in a global /etc/my.cnf
6150
 
   file. A typical /etc/my.cnf file might look like this:
 
5742
   You can add options for mysql.server in a global /etc/my.cnf file.
 
5743
   A typical /etc/my.cnf file might look like this:
6151
5744
[mysqld]
6152
5745
datadir=/usr/local/mysql/var
6153
5746
socket=/var/tmp/mysql.sock
6158
5751
basedir=/usr/local/mysql
6159
5752
 
6160
5753
   The mysql.server script understands the following options:
6161
 
   basedir, datadir, and pid-file. If specified, they must be
6162
 
   placed in an option file, not on the command line.
6163
 
   mysql.server understands only start and stop as command-line
6164
 
   arguments.
 
5754
   basedir, datadir, and pid-file. If specified, they must be placed
 
5755
   in an option file, not on the command line. mysql.server
 
5756
   understands only start and stop as command-line arguments.
6165
5757
 
6166
 
   The following table shows which option groups the server and
6167
 
   each startup script read from option files:
 
5758
   The following table shows which option groups the server and each
 
5759
   startup script read from option files.
6168
5760
   Script       Option Groups
6169
5761
   mysqld       [mysqld], [server], [mysqld-major_version]
6170
5762
   mysqld_safe  [mysqld], [server], [mysqld_safe]
6171
5763
   mysql.server [mysqld], [mysql.server], [server]
6172
5764
 
6173
5765
   [mysqld-major_version] means that groups with names like
6174
 
   [mysqld-5.0] and [mysqld-5.1] are read by servers having
6175
 
   versions 5.0.x, 5.1.x, and so forth. This feature can be used
6176
 
   to specify options that can be read only by servers within a
6177
 
   given release series.
 
5766
   [mysqld-5.0] and [mysqld-5.1] are read by servers having versions
 
5767
   5.0.x, 5.1.x, and so forth. This feature can be used to specify
 
5768
   options that can be read only by servers within a given release
 
5769
   series.
6178
5770
 
6179
5771
   For backward compatibility, mysql.server also reads the
6180
 
   [mysql_server] group and mysqld_safe also reads the
6181
 
   [safe_mysqld] group. However, you should update your option
6182
 
   files to use the [mysql.server] and [mysqld_safe] groups
6183
 
   instead when using MySQL 5.1.
 
5772
   [mysql_server] group and mysqld_safe also reads the [safe_mysqld]
 
5773
   group. However, you should update your option files to use the
 
5774
   [mysql.server] and [mysqld_safe] groups instead when using MySQL
 
5775
   5.1.
6184
5776
 
6185
5777
   See Section 4.2.3.2, "Using Option Files."
6186
5778
 
6187
5779
2.11.2.3. Starting and Troubleshooting the MySQL Server
6188
5780
 
6189
 
   This section provides troubleshooting suggestions for
6190
 
   problems starting the server on Unix. If you are using
6191
 
   Windows, see Section 2.3.13, "Troubleshooting a MySQL
6192
 
   Installation Under Windows."
 
5781
   This section provides troubleshooting suggestions for problems
 
5782
   starting the server on Unix. If you are using Windows, see Section
 
5783
   2.3.13, "Troubleshooting a MySQL Installation Under Windows."
6193
5784
 
6194
 
   If you have problems starting the server, here are some
6195
 
   things to try:
 
5785
   If you have problems starting the server, here are some things to
 
5786
   try:
6196
5787
 
6197
5788
     * Check the error log to see why the server does not start.
6198
5789
 
6199
 
     * Specify any special options needed by the storage engines
6200
 
       you are using.
 
5790
     * Specify any special options needed by the storage engines you
 
5791
       are using.
6201
5792
 
6202
5793
     * Make sure that the server knows where to find the data
6203
5794
       directory.
6204
5795
 
6205
 
     * Make sure that the server can access the data directory.
6206
 
       The ownership and permissions of the data directory and
6207
 
       its contents must be set such that the server can read
6208
 
       and modify them.
6209
 
 
6210
 
     * Verify that the network interfaces the server wants to
6211
 
       use are available.
6212
 
 
6213
 
   Some storage engines have options that control their
6214
 
   behavior. You can create a my.cnf file and specify startup
6215
 
   options for the engines that you plan to use. If you are
6216
 
   going to use storage engines that support transactional
6217
 
   tables (InnoDB, NDB), be sure that you have them configured
6218
 
   the way you want before starting the server:
6219
 
 
6220
 
   MySQL Enterprise For expert advice on start-up options
6221
 
   appropriate to your circumstances, subscribe to The MySQL
6222
 
   Enterprise Monitor. For more information, see
 
5796
     * Make sure that the server can access the data directory. The
 
5797
       ownership and permissions of the data directory and its
 
5798
       contents must be set such that the server can read and modify
 
5799
       them.
 
5800
 
 
5801
     * Verify that the network interfaces the server wants to use are
 
5802
       available.
 
5803
 
 
5804
   Some storage engines have options that control their behavior. You
 
5805
   can create a my.cnf file and specify startup options for the
 
5806
   engines that you plan to use. If you are going to use storage
 
5807
   engines that support transactional tables (InnoDB, NDB), be sure
 
5808
   that you have them configured the way you want before starting the
 
5809
   server:
 
5810
 
 
5811
   MySQL Enterprise For expert advice on start-up options appropriate
 
5812
   to your circumstances, subscribe to The MySQL Enterprise Monitor.
 
5813
   For more information, see
6223
5814
   http://www.mysql.com/products/enterprise/advisors.html.
6224
5815
 
6225
 
     * If you are using InnoDB tables, see Section 13.6.2,
6226
 
       "InnoDB Configuration."
 
5816
     * If you are using InnoDB tables, see Section 13.6.2, "InnoDB
 
5817
       Configuration."
6227
5818
 
6228
5819
     * If you are using MySQL Cluster, see Section 17.3, "MySQL
6229
5820
       Cluster Configuration."
6230
5821
 
6231
5822
   Storage engines will use default option values if you specify
6232
 
   none, but it is recommended that you review the available
6233
 
   options and specify explicit values for those for which the
6234
 
   defaults are not appropriate for your installation.
6235
 
 
6236
 
   When the mysqld server starts, it changes location to the
6237
 
   data directory. This is where it expects to find databases
6238
 
   and where it expects to write log files. The server also
6239
 
   writes the pid (process ID) file in the data directory.
6240
 
 
6241
 
   The data directory location is hardwired in when the server
6242
 
   is compiled. This is where the server looks for the data
6243
 
   directory by default. If the data directory is located
6244
 
   somewhere else on your system, the server will not work
6245
 
   properly. You can determine what the default path settings
6246
 
   are by invoking mysqld with the --verbose and --help options.
6247
 
 
6248
 
   If the default locations don't match the MySQL installation
6249
 
   layout on your system, you can override them by specifying
6250
 
   options to mysqld or mysqld_safe on the command line or in an
6251
 
   option file.
6252
 
 
6253
 
   To specify the location of the data directory explicitly, use
6254
 
   the --datadir option. However, normally you can tell mysqld
6255
 
   the location of the base directory under which MySQL is
6256
 
   installed and it looks for the data directory there. You can
6257
 
   do this with the --basedir option.
6258
 
 
6259
 
   To check the effect of specifying path options, invoke mysqld
6260
 
   with those options followed by the --verbose and --help
6261
 
   options. For example, if you change location into the
6262
 
   directory where mysqld is installed and then run the
6263
 
   following command, it shows the effect of starting the server
6264
 
   with a base directory of /usr/local:
 
5823
   none, but it is recommended that you review the available options
 
5824
   and specify explicit values for those for which the defaults are
 
5825
   not appropriate for your installation.
 
5826
 
 
5827
   When the mysqld server starts, it changes location to the data
 
5828
   directory. This is where it expects to find databases and where it
 
5829
   expects to write log files. The server also writes the pid
 
5830
   (process ID) file in the data directory.
 
5831
 
 
5832
   The data directory location is hardwired in when the server is
 
5833
   compiled. This is where the server looks for the data directory by
 
5834
   default. If the data directory is located somewhere else on your
 
5835
   system, the server will not work properly. You can determine what
 
5836
   the default path settings are by invoking mysqld with the
 
5837
   --verbose and --help options.
 
5838
 
 
5839
   If the default locations don't match the MySQL installation layout
 
5840
   on your system, you can override them by specifying options to
 
5841
   mysqld or mysqld_safe on the command line or in an option file.
 
5842
 
 
5843
   To specify the location of the data directory explicitly, use the
 
5844
   --datadir option. However, normally you can tell mysqld the
 
5845
   location of the base directory under which MySQL is installed and
 
5846
   it looks for the data directory there. You can do this with the
 
5847
   --basedir option.
 
5848
 
 
5849
   To check the effect of specifying path options, invoke mysqld with
 
5850
   those options followed by the --verbose and --help options. For
 
5851
   example, if you change location into the directory where mysqld is
 
5852
   installed and then run the following command, it shows the effect
 
5853
   of starting the server with a base directory of /usr/local:
6265
5854
shell> ./mysqld --basedir=/usr/local --verbose --help
6266
5855
 
6267
5856
   You can specify other options such as --datadir as well, but
6268
5857
   --verbose and --help must be the last options.
6269
5858
 
6270
 
   Once you determine the path settings you want, start the
6271
 
   server without --verbose and --help.
 
5859
   Once you determine the path settings you want, start the server
 
5860
   without --verbose and --help.
6272
5861
 
6273
5862
   If mysqld is currently running, you can find out what path
6274
5863
   settings it is using by executing this command:
6281
5870
 
6282
5871
   If you get Errcode 13 (which means Permission denied) when
6283
5872
   starting mysqld, this means that the privileges of the data
6284
 
   directory or its contents do not allow the server access. In
6285
 
   this case, you change the permissions for the involved files
6286
 
   and directories so that the server has the right to use them.
6287
 
   You can also start the server as root, but this raises
6288
 
   security issues and should be avoided.
 
5873
   directory or its contents do not allow the server access. In this
 
5874
   case, you change the permissions for the involved files and
 
5875
   directories so that the server has the right to use them. You can
 
5876
   also start the server as root, but this raises security issues and
 
5877
   should be avoided.
6289
5878
 
6290
 
   On Unix, change location into the data directory and check
6291
 
   the ownership of the data directory and its contents to make
6292
 
   sure the server has access. For example, if the data
6293
 
   directory is /usr/local/mysql/var, use this command:
 
5879
   On Unix, change location into the data directory and check the
 
5880
   ownership of the data directory and its contents to make sure the
 
5881
   server has access. For example, if the data directory is
 
5882
   /usr/local/mysql/var, use this command:
6294
5883
shell> ls -la /usr/local/mysql/var
6295
5884
 
6296
 
   If the data directory or its files or subdirectories are not
6297
 
   owned by the login account that you use for running the
6298
 
   server, change their ownership to that account. If the
6299
 
   account is named mysql, use these commands:
 
5885
   If the data directory or its files or subdirectories are not owned
 
5886
   by the login account that you use for running the server, change
 
5887
   their ownership to that account. If the account is named mysql,
 
5888
   use these commands:
6300
5889
shell> chown -R mysql /usr/local/mysql/var
6301
5890
shell> chgrp -R mysql /usr/local/mysql/var
6302
5891
 
6303
 
   If the server fails to start up correctly, check the error
6304
 
   log. Log files are located in the data directory (typically
6305
 
   C:\Program Files\MySQL\MySQL Server 5.1\data on Windows,
 
5892
   If the server fails to start up correctly, check the error log.
 
5893
   Log files are located in the data directory (typically C:\Program
 
5894
   Files\MySQL\MySQL Server 5.1\data on Windows,
6306
5895
   /usr/local/mysql/data for a Unix binary distribution, and
6307
 
   /usr/local/var for a Unix source distribution). Look in the
6308
 
   data directory for files with names of the form host_name.err
6309
 
   and host_name.log, where host_name is the name of your server
6310
 
   host. Then examine the last few lines of these files. On
6311
 
   Unix, you can use tail to display them:
 
5896
   /usr/local/var for a Unix source distribution). Look in the data
 
5897
   directory for files with names of the form host_name.err and
 
5898
   host_name.log, where host_name is the name of your server host.
 
5899
   Then examine the last few lines of these files. On Unix, you can
 
5900
   use tail to display them:
6312
5901
shell> tail host_name.err
6313
5902
shell> tail host_name.log
6314
5903
 
6315
 
   The error log should contain information that indicates why
6316
 
   the server couldn't start.
 
5904
   The error log should contain information that indicates why the
 
5905
   server couldn't start.
6317
5906
 
6318
 
   If either of the following errors occur, it means that some
6319
 
   other program (perhaps another mysqld server) is using the
6320
 
   TCP/IP port or Unix socket file that mysqld is trying to use:
 
5907
   If either of the following errors occur, it means that some other
 
5908
   program (perhaps another mysqld server) is using the TCP/IP port
 
5909
   or Unix socket file that mysqld is trying to use:
6321
5910
Can't start server: Bind on TCP/IP port: Address already in use
6322
5911
Can't start server: Bind on unix socket...
6323
5912
 
6324
5913
   Use ps to determine whether you have another mysqld server
6325
 
   running. If so, shut down the server before starting mysqld
6326
 
   again. (If another server is running, and you really want to
6327
 
   run multiple servers, you can find information about how to
6328
 
   do so in Section 5.6, "Running Multiple MySQL Servers on the
6329
 
   Same Machine.")
6330
 
 
6331
 
   If no other server is running, try to execute the command
6332
 
   telnet your_host_name tcp_ip_port_number. (The default MySQL
6333
 
   port number is 3306.) Then press Enter a couple of times. If
6334
 
   you don't get an error message like telnet: Unable to connect
6335
 
   to remote host: Connection refused, some other program is
6336
 
   using the TCP/IP port that mysqld is trying to use. You'll
6337
 
   need to track down what program this is and disable it, or
6338
 
   else tell mysqld to listen to a different port with the
6339
 
   --port option. In this case, you'll also need to specify the
6340
 
   port number for client programs when connecting to the server
6341
 
   via TCP/IP.
6342
 
 
6343
 
   Another reason the port might be inaccessible is that you
6344
 
   have a firewall running that blocks connections to it. If so,
6345
 
   modify the firewall settings to allow access to the port.
6346
 
 
6347
 
   If the server starts but you can't connect to it, you should
6348
 
   make sure that you have an entry in /etc/hosts that looks
6349
 
   like this:
 
5914
   running. If so, shut down the server before starting mysqld again.
 
5915
   (If another server is running, and you really want to run multiple
 
5916
   servers, you can find information about how to do so in Section
 
5917
   5.6, "Running Multiple MySQL Servers on the Same Machine.")
 
5918
 
 
5919
   If no other server is running, try to execute the command telnet
 
5920
   your_host_name tcp_ip_port_number. (The default MySQL port number
 
5921
   is 3306.) Then press Enter a couple of times. If you don't get an
 
5922
   error message like telnet: Unable to connect to remote host:
 
5923
   Connection refused, some other program is using the TCP/IP port
 
5924
   that mysqld is trying to use. You'll need to track down what
 
5925
   program this is and disable it, or else tell mysqld to listen to a
 
5926
   different port with the --port option. In this case, you'll also
 
5927
   need to specify the port number for client programs when
 
5928
   connecting to the server via TCP/IP.
 
5929
 
 
5930
   Another reason the port might be inaccessible is that you have a
 
5931
   firewall running that blocks connections to it. If so, modify the
 
5932
   firewall settings to allow access to the port.
 
5933
 
 
5934
   If the server starts but you can't connect to it, you should make
 
5935
   sure that you have an entry in /etc/hosts that looks like this:
6350
5936
127.0.0.1       localhost
6351
5937
 
6352
 
   This problem occurs only on systems that do not have a
6353
 
   working thread library and for which MySQL must be configured
6354
 
   to use MIT-pthreads.
 
5938
   This problem occurs only on systems that do not have a working
 
5939
   thread library and for which MySQL must be configured to use
 
5940
   MIT-pthreads.
6355
5941
 
6356
 
   If you cannot get mysqld to start, you can try to make a
6357
 
   trace file to find the problem by using the --debug option.
6358
 
   See MySQL Internals: Porting
 
5942
   If you cannot get mysqld to start, you can try to make a trace
 
5943
   file to find the problem by using the --debug option. See MySQL
 
5944
   Internals: Porting
6359
5945
   (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
6360
5946
 
6361
5947
2.11.3. Securing the Initial MySQL Accounts
6363
5949
   Part of the MySQL installation process is to set up the mysql
6364
5950
   database that contains the grant tables:
6365
5951
 
6366
 
     * Windows distributions contain preinitialized grant tables
6367
 
       that are installed automatically.
 
5952
     * Windows distributions contain preinitialized grant tables that
 
5953
       are installed automatically.
6368
5954
 
6369
5955
     * On Unix, the grant tables are populated by the
6370
 
       mysql_install_db program. Some installation methods run
6371
 
       this program for you. Others require that you execute it
6372
 
       manually. For details, see Section 2.11.2, "Unix
6373
 
       Post-Installation Procedures."
 
5956
       mysql_install_db program. Some installation methods run this
 
5957
       program for you. Others require that you execute it manually.
 
5958
       For details, see Section 2.11.2, "Unix Post-Installation
 
5959
       Procedures."
6374
5960
 
6375
 
   The grant tables define the initial MySQL user accounts and
6376
 
   their access privileges. These accounts are set up as
6377
 
   follows:
 
5961
   The grant tables define the initial MySQL user accounts and their
 
5962
   access privileges. These accounts are set up as follows:
6378
5963
 
6379
5964
     * Accounts with the user name root are created. These are
6380
5965
       superuser accounts that can do anything. The initial root
6381
5966
       account passwords are empty, so anyone can connect to the
6382
 
       MySQL server as root --- without a password --- and be
6383
 
       granted all privileges.
6384
 
 
6385
 
          + On Windows, one root account is created; this
6386
 
            account allows connecting from the local host only.
6387
 
            The Windows installer will optionally create an
6388
 
            account allowing for connections from any host only
6389
 
            if the user selects the Enable root access from
6390
 
            remote machines option during installation.
6391
 
 
6392
 
          + On Unix, both root accounts are for connections from
6393
 
            the local host. Connections must be made from the
6394
 
            local host by specifying a hostname of localhost for
6395
 
            one of the accounts, or the actual hostname or IP
6396
 
            number for the other.
6397
 
 
6398
 
     * Two anonymous-user accounts are created, each with an
6399
 
       empty user name. The anonymous accounts have no password,
6400
 
       so anyone can use them to connect to the MySQL server.
6401
 
 
6402
 
          + On Windows, one anonymous account is for connections
6403
 
            from the local host. It has no global privileges.
6404
 
            (Before MySQL 5.1.16, it has all global privileges,
6405
 
            just like the root accounts.) The other is for
6406
 
            connections from any host and has all privileges for
6407
 
            the test database and for other databases with names
6408
 
            that start with test.
6409
 
 
6410
 
          + On Unix, both anonymous accounts are for connections
6411
 
            from the local host. Connections must be made from
6412
 
            the local host by specifying a hostname of localhost
6413
 
            for one of the accounts, or the actual hostname or
6414
 
            IP number for the other. These accounts have all
6415
 
            privileges for the test database and for other
6416
 
            databases with names that start with test_.
6417
 
 
6418
 
   As noted, none of the initial accounts have passwords. This
6419
 
   means that your MySQL installation is unprotected until you
6420
 
   do something about it:
6421
 
 
6422
 
     * If you want to prevent clients from connecting as
6423
 
       anonymous users without a password, you should either
6424
 
       assign a password to each anonymous account or else
6425
 
       remove the accounts.
 
5967
       MySQL server as root --- without a password --- and be granted
 
5968
       all privileges.
 
5969
 
 
5970
          + On Windows, one root account is created; this account
 
5971
            allows connecting from the local host only. The Windows
 
5972
            installer will optionally create an account allowing for
 
5973
            connections from any host only if the user selects the
 
5974
            Enable root access from remote machines option during
 
5975
            installation.
 
5976
 
 
5977
          + On Unix, both root accounts are for connections from the
 
5978
            local host. Connections must be made from the local host
 
5979
            by specifying a host name of localhost for one of the
 
5980
            accounts, or the actual host name or IP number for the
 
5981
            other.
 
5982
 
 
5983
     * Two anonymous-user accounts are created, each with an empty
 
5984
       user name. The anonymous accounts have no password, so anyone
 
5985
       can use them to connect to the MySQL server.
 
5986
 
 
5987
          + On Windows, one anonymous account is for connections from
 
5988
            the local host. It has no global privileges. (Before
 
5989
            MySQL 5.1.16, it has all global privileges, just like the
 
5990
            root accounts.) The other is for connections from any
 
5991
            host and has all privileges for the test database and for
 
5992
            other databases with names that start with test.
 
5993
 
 
5994
          + On Unix, both anonymous accounts are for connections from
 
5995
            the local host. Connections must be made from the local
 
5996
            host by specifying a host name of localhost for one of
 
5997
            the accounts, or the actual host name or IP number for
 
5998
            the other. These accounts have all privileges for the
 
5999
            test database and for other databases with names that
 
6000
            start with test_.
 
6001
 
 
6002
   As noted, none of the initial accounts have passwords. This means
 
6003
   that your MySQL installation is unprotected until you do something
 
6004
   about it:
 
6005
 
 
6006
     * If you want to prevent clients from connecting as anonymous
 
6007
       users without a password, you should either assign a password
 
6008
       to each anonymous account or else remove the accounts.
6426
6009
 
6427
6010
     * You should assign a password to each MySQL root account.
6428
6011
 
6429
 
   The following instructions describe how to set up passwords
6430
 
   for the initial MySQL accounts, first for the anonymous
6431
 
   accounts and then for the root accounts. Replace "newpwd" in
6432
 
   the examples with the actual password that you want to use.
6433
 
   The instructions also cover how to remove the anonymous
6434
 
   accounts, should you prefer not to allow anonymous access at
6435
 
   all.
 
6012
   The following instructions describe how to set up passwords for
 
6013
   the initial MySQL accounts, first for the anonymous accounts and
 
6014
   then for the root accounts. Replace "newpwd" in the examples with
 
6015
   the actual password that you want to use. The instructions also
 
6016
   cover how to remove the anonymous accounts, should you prefer not
 
6017
   to allow anonymous access at all.
6436
6018
 
6437
 
   You might want to defer setting the passwords until later, so
6438
 
   that you don't need to specify them while you perform
6439
 
   additional setup or testing. However, be sure to set them
6440
 
   before using your installation for production purposes.
 
6019
   You might want to defer setting the passwords until later, so that
 
6020
   you don't need to specify them while you perform additional setup
 
6021
   or testing. However, be sure to set them before using your
 
6022
   installation for production purposes.
6441
6023
 
6442
6024
   Anonymous Account Password Assignment
6443
6025
 
6444
6026
   To assign passwords to the anonymous accounts, connect to the
6445
6027
   server as root and then use either SET PASSWORD or UPDATE. In
6446
 
   either case, be sure to encrypt the password using the
6447
 
   PASSWORD() function.
 
6028
   either case, be sure to encrypt the password using the PASSWORD()
 
6029
   function.
6448
6030
 
6449
6031
   To use SET PASSWORD on Windows, do this:
6450
6032
shell> mysql -u root
6456
6038
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd');
6457
6039
mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('newpwd');
6458
6040
 
6459
 
   In the second SET PASSWORD statement, replace host_name with
6460
 
   the name of the server host. This is the name that is
6461
 
   specified in the Host column of the non-localhost record for
6462
 
   root in the user table. If you don't know what hostname this
6463
 
   is, issue the following statement before using SET PASSWORD:
 
6041
   In the second SET PASSWORD statement, replace host_name with the
 
6042
   name of the server host. This is the name that is specified in the
 
6043
   Host column of the non-localhost record for root in the user
 
6044
   table. If you don't know what host name this is, issue the
 
6045
   following statement before using SET PASSWORD:
6464
6046
mysql> SELECT Host, User FROM mysql.user;
6465
6047
 
6466
 
   Look for the record that has root in the User column and
6467
 
   something other than localhost in the Host column. Then use
6468
 
   that Host value in the second SET PASSWORD statement.
 
6048
   Look for the record that has root in the User column and something
 
6049
   other than localhost in the Host column. Then use that Host value
 
6050
   in the second SET PASSWORD statement.
6469
6051
 
6470
6052
   Anonymous Account Removal
6471
6053
 
6472
 
   If you prefer to remove the anonymous accounts instead, do so
6473
 
   as follows:
 
6054
   If you prefer to remove the anonymous accounts instead, do so as
 
6055
   follows:
6474
6056
shell> mysql -u root
6475
6057
mysql> DROP USER '';
6476
6058
 
6477
6059
   The DROP statement applies both to Windows and to Unix. On
6478
 
   Windows, if you want to remove only the anonymous account
6479
 
   that has the same privileges as root, do this instead:
 
6060
   Windows, if you want to remove only the anonymous account that has
 
6061
   the same privileges as root, do this instead:
6480
6062
shell> mysql -u root
6481
6063
mysql> DROP USER ''@'localhost';
6482
6064
 
6483
 
   That account allows anonymous access but has full privileges,
6484
 
   so removing it improves security.
 
6065
   That account allows anonymous access but has full privileges, so
 
6066
   removing it improves security.
6485
6067
 
6486
6068
   root Account Password Assignment
6487
6069
 
6488
 
   You can assign passwords to the root accounts in several
6489
 
   ways. The following discussion demonstrates three methods:
 
6070
   You can assign passwords to the root accounts in several ways. The
 
6071
   following discussion demonstrates three methods:
6490
6072
 
6491
6073
     * Use the SET PASSWORD statement
6492
6074
 
6494
6076
 
6495
6077
     * Use the UPDATE statement
6496
6078
 
6497
 
   To assign passwords using SET PASSWORD, connect to the server
6498
 
   as root and issue SET PASSWORD statements. Be sure to encrypt
6499
 
   the password using the PASSWORD() function.
 
6079
   To assign passwords using SET PASSWORD, connect to the server as
 
6080
   root and issue SET PASSWORD statements. Be sure to encrypt the
 
6081
   password using the PASSWORD() function.
6500
6082
 
6501
6083
   For Windows, do this:
6502
6084
shell> mysql -u root
6508
6090
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
6509
6091
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
6510
6092
 
6511
 
   In the second SET PASSWORD statement, replace host_name with
6512
 
   the name of the server host. This is the same hostname that
6513
 
   you used when you assigned the anonymous account passwords.
 
6093
   In the second SET PASSWORD statement, replace host_name with the
 
6094
   name of the server host. This is the same host name that you used
 
6095
   when you assigned the anonymous account passwords.
6514
6096
 
6515
 
   If the user table contains an account with User and Host
6516
 
   values of 'root' and '127.0.0.1', use an additional SET
6517
 
   PASSWORD statement to set that account's password:
 
6097
   If the user table contains an account with User and Host values of
 
6098
   'root' and '127.0.0.1', use an additional SET PASSWORD statement
 
6099
   to set that account's password:
6518
6100
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');
6519
6101
 
6520
 
   To assign passwords to the root accounts using mysqladmin,
6521
 
   execute the following commands:
 
6102
   To assign passwords to the root accounts using mysqladmin, execute
 
6103
   the following commands:
6522
6104
shell> mysqladmin -u root password "newpwd"
6523
6105
shell> mysqladmin -u root -h host_name password "newpwd"
6524
6106
 
6525
 
   These commands apply both to Windows and to Unix. In the
6526
 
   second command, replace host_name with the name of the server
6527
 
   host. The double quotes around the password are not always
6528
 
   necessary, but you should use them if the password contains
6529
 
   spaces or other characters that are special to your command
6530
 
   interpreter.
6531
 
 
6532
 
   The mysqladmin method of setting the root account passwords
6533
 
   does not set the password for the 'root'@'127.0.0.1' account.
6534
 
   To do so, use SET PASSWORD as shown earlier.
6535
 
 
6536
 
   You can also use UPDATE to modify the user table directly.
6537
 
   The following UPDATE statement assigns a password to all root
 
6107
   These commands apply both to Windows and to Unix. In the second
 
6108
   command, replace host_name with the name of the server host. The
 
6109
   double quotes around the password are not always necessary, but
 
6110
   you should use them if the password contains spaces or other
 
6111
   characters that are special to your command interpreter.
 
6112
 
 
6113
   The mysqladmin method of setting the root account passwords does
 
6114
   not set the password for the 'root'@'127.0.0.1' account. To do so,
 
6115
   use SET PASSWORD as shown earlier.
 
6116
 
 
6117
   You can also use UPDATE to modify the user table directly. The
 
6118
   following UPDATE statement assigns a password to all root
6538
6119
   accounts:
6539
6120
shell> mysql -u root
6540
6121
mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd')
6543
6124
 
6544
6125
   The UPDATE statement applies both to Windows and to Unix.
6545
6126
 
6546
 
   After the passwords have been set, you must supply the
6547
 
   appropriate password whenever you connect to the server. For
6548
 
   example, if you want to use mysqladmin to shut down the
6549
 
   server, you can do so using this command:
 
6127
   After the passwords have been set, you must supply the appropriate
 
6128
   password whenever you connect to the server. For example, if you
 
6129
   want to use mysqladmin to shut down the server, you can do so
 
6130
   using this command:
6550
6131
shell> mysqladmin -u root -p shutdown
6551
6132
Enter password: (enter root password here)
6552
6133
 
6553
6134
Note
6554
6135
 
6555
6136
   If you forget your root password after setting it up, Section
6556
 
   B.1.4.1, "How to Reset the Root Password," covers the
6557
 
   procedure for resetting it.
6558
 
 
6559
 
   To set up additional accounts, you can use the GRANT
6560
 
   statement. For instructions, see Section 5.5.2, "Adding User
6561
 
   Accounts to MySQL."
6562
 
 
6563
 
2.12. Upgrading MySQL
6564
 
 
6565
 
   As a general rule, we recommend that when you upgrade from
6566
 
   one release series to another, you should go to the next
6567
 
   series rather than skipping a series. If you wish to upgrade
6568
 
   from a release series previous to MySQL 5.0, you should
6569
 
   upgrade to each successive release series in turn until you
6570
 
   have reached MySQL 5.0, and then proceed with the upgrade to
6571
 
   MySQL 5.1. For example, if you currently are running MySQL
6572
 
   4.0 and wish to upgrade to a newer series, upgrade to MySQL
6573
 
   4.1 first before upgrading to 5.0, and so forth. For
6574
 
   information on upgrading to MySQL 5.0, see the MySQL 5.0
6575
 
   Reference Manual; for earlier releases, see the MySQL 3.23,
6576
 
   4.0, 4.1 Reference Manual.
6577
 
 
6578
 
   The following items form a checklist of things that you
6579
 
   should do whenever you perform an upgrade from MySQL 5.0 to
6580
 
   5.1:
 
6137
   B.1.4.1, "How to Reset the Root Password," covers the procedure
 
6138
   for resetting it.
 
6139
 
 
6140
   To set up additional accounts, you can use the GRANT statement.
 
6141
   For instructions, see Section 5.5.2, "Adding User Accounts."
 
6142
 
 
6143
2.12. Upgrading or Downgrading MySQL
 
6144
 
 
6145
2.12.1. Upgrading MySQL
 
6146
 
 
6147
   As a general rule, we recommend that when you upgrade from one
 
6148
   release series to another, you should go to the next series rather
 
6149
   than skipping a series. If you wish to upgrade from a release
 
6150
   series previous to MySQL 5.0, you should upgrade to each
 
6151
   successive release series in turn until you have reached MySQL
 
6152
   5.0, and then proceed with the upgrade to MySQL 5.1. For example,
 
6153
   if you currently are running MySQL 4.0 and wish to upgrade to a
 
6154
   newer series, upgrade to MySQL 4.1 first before upgrading to 5.0,
 
6155
   and so forth. For information on upgrading to MySQL 5.0, see the
 
6156
   MySQL 5.0 Reference Manual; for earlier releases, see the MySQL
 
6157
   3.23, 4.0, 4.1 Reference Manual.
 
6158
 
 
6159
   The following items form a checklist of things that you should do
 
6160
   whenever you perform an upgrade from MySQL 5.0 to 5.1:
6581
6161
 
6582
6162
     * Before any upgrade, back up your databases, including the
6583
6163
       mysql database that contains the grant tables.
6584
6164
 
6585
 
     * Read all the notes in Section 2.12.1, "Upgrading from
6586
 
       MySQL 5.0 to 5.1." These notes will enable you to
6587
 
       identify upgrade issues that apply to your current MySQL
6588
 
       installation. Read Appendix C, "MySQL Change History" as
6589
 
       well, which provides information about features that are
6590
 
       new in MySQL 5.1 or differ from those found in MySQL 5.0.
6591
 
 
6592
 
     * For any incompatibilities that require your attention
6593
 
       before upgrading, deal with them as described in Section
6594
 
       2.12.1, "Upgrading from MySQL 5.0 to 5.1."
6595
 
 
6596
 
     * After you upgrade to a new version of MySQL, you should
6597
 
       run mysql_upgrade (see Section 4.4.8, "mysql_upgrade ---
6598
 
       Check Tables for MySQL Upgrade"). This program will check
6599
 
       your tables, and repair them if necessary. It will also
6600
 
       update your grant tables to make sure that they have the
6601
 
       current structure so that you can take advantage of any
6602
 
       new capabilities. (Some releases of MySQL introduce
6603
 
       changes to the structure of the grant tables to add new
6604
 
       privileges or features.)
 
6165
     * Read all the notes in Section 2.12.1.1, "Upgrading from MySQL
 
6166
       5.0 to 5.1." These notes will enable you to identify upgrade
 
6167
       issues that apply to your current MySQL installation. Read
 
6168
       Appendix C, "MySQL Change History" as well, which provides
 
6169
       information about features that are new in MySQL 5.1 or differ
 
6170
       from those found in MySQL 5.0.
 
6171
 
 
6172
     * For any incompatibilities that require your attention before
 
6173
       upgrading, deal with them as described in Section 2.12.1.1,
 
6174
       "Upgrading from MySQL 5.0 to 5.1."
 
6175
 
 
6176
     * After you upgrade to a new version of MySQL, you should run
 
6177
       mysql_upgrade (see Section 4.4.8, "mysql_upgrade --- Check
 
6178
       Tables for MySQL Upgrade"). This program will check your
 
6179
       tables, and repair them if necessary. It will also update your
 
6180
       grant tables to make sure that they have the current structure
 
6181
       so that you can take advantage of any new capabilities. (Some
 
6182
       releases of MySQL introduce changes to the structure of the
 
6183
       grant tables to add new privileges or features.)
6605
6184
 
6606
6185
     * If you are running MySQL Server on Windows, see Section
6607
6186
       2.3.14, "Upgrading MySQL on Windows."
6608
6187
 
6609
 
     * If you are using replication, see Section 16.3.3,
6610
 
       "Upgrading a Replication Setup," for information on
6611
 
       upgrading your replication setup.
6612
 
 
6613
 
     * If you are upgrading an installation originally produced
6614
 
       by installing multiple RPM packages, it is best to
6615
 
       upgrade all the packages, not just some. For example, if
6616
 
       you previously installed the server and client RPMs, do
6617
 
       not upgrade just the server RPM.
6618
 
 
6619
 
     * As of MySQL 5.1.9, the mysqld-max server is included in
6620
 
       binary distributions. There is no separate MySQL-Max
6621
 
       distribution. As of MySQL 5.1.12, binary distributions
6622
 
       contain a server that includes the features previously
6623
 
       included in mysqld-max.
6624
 
 
6625
 
     * If you have created a user-defined function (UDF) with a
6626
 
       given name and upgrade MySQL to a version that implements
6627
 
       a new built-in function with the same name, the UDF
6628
 
       becomes inaccessible. To correct this, use DROP FUNCTION
6629
 
       to drop the UDF, and then use CREATE FUNCTION to
6630
 
       re-create the UDF with a different non-conflicting name.
6631
 
       The same is true if the new version of MySQL implements a
6632
 
       built-in function with the same name as an existing
6633
 
       stored function. See Section 8.2.4, "Function Name
6634
 
       Parsing and Resolution," for the rules describing how the
6635
 
       server interprets references to different kinds of
6636
 
       functions.
6637
 
 
6638
 
   You can always move the MySQL format files and data files
6639
 
   between different versions on the same architecture as long
6640
 
   as you stay within versions for the same release series of
6641
 
   MySQL.
 
6188
     * If you are using replication, see Section 16.3.3, "Upgrading a
 
6189
       Replication Setup," for information on upgrading your
 
6190
       replication setup.
 
6191
 
 
6192
     * If you are upgrading an installation originally produced by
 
6193
       installing multiple RPM packages, it is best to upgrade all
 
6194
       the packages, not just some. For example, if you previously
 
6195
       installed the server and client RPMs, do not upgrade just the
 
6196
       server RPM.
 
6197
 
 
6198
     * As of MySQL 5.1.9, the mysqld-max server is included in binary
 
6199
       distributions. There is no separate MySQL-Max distribution. As
 
6200
       of MySQL 5.1.12, binary distributions contain a server that
 
6201
       includes the features previously included in mysqld-max.
 
6202
 
 
6203
     * If you have created a user-defined function (UDF) with a given
 
6204
       name and upgrade MySQL to a version that implements a new
 
6205
       built-in function with the same name, the UDF becomes
 
6206
       inaccessible. To correct this, use DROP FUNCTION to drop the
 
6207
       UDF, and then use CREATE FUNCTION to re-create the UDF with a
 
6208
       different non-conflicting name. The same is true if the new
 
6209
       version of MySQL implements a built-in function with the same
 
6210
       name as an existing stored function. See Section 8.2.4,
 
6211
       "Function Name Parsing and Resolution," for the rules
 
6212
       describing how the server interprets references to different
 
6213
       kinds of functions.
 
6214
 
 
6215
   You can always move the MySQL format files and data files between
 
6216
   different versions on the same architecture as long as you stay
 
6217
   within versions for the same release series of MySQL.
6642
6218
 
6643
6219
   If you are cautious about using new versions, you can always
6644
 
   rename your old mysqld before installing a newer one. For
6645
 
   example, if you are using MySQL 5.0.13 and want to upgrade to
6646
 
   5.1.10, rename your current server from mysqld to
6647
 
   mysqld-5.0.13. If your new mysqld then does something
6648
 
   unexpected, you can simply shut it down and restart with your
6649
 
   old mysqld.
 
6220
   rename your old mysqld before installing a newer one. For example,
 
6221
   if you are using MySQL 5.0.13 and want to upgrade to 5.1.10,
 
6222
   rename your current server from mysqld to mysqld-5.0.13. If your
 
6223
   new mysqld then does something unexpected, you can simply shut it
 
6224
   down and restart with your old mysqld.
6650
6225
 
6651
6226
   If, after an upgrade, you experience problems with recompiled
6652
 
   client programs, such as Commands out of sync or unexpected
6653
 
   core dumps, you probably have used old header or library
6654
 
   files when compiling your programs. In this case, you should
6655
 
   check the date for your mysql.h file and libmysqlclient.a
6656
 
   library to verify that they are from the new MySQL
6657
 
   distribution. If not, recompile your programs with the new
6658
 
   headers and libraries.
6659
 
 
6660
 
   If problems occur, such as that the new mysqld server does
6661
 
   not start or that you cannot connect without a password,
6662
 
   verify that you do not have an old my.cnf file from your
6663
 
   previous installation. You can check this with the
6664
 
   --print-defaults option (for example, mysqld
6665
 
   --print-defaults). If this command displays anything other
6666
 
   than the program name, you have an active my.cnf file that
6667
 
   affects server or client operation.
6668
 
 
6669
 
   It is a good idea to rebuild and reinstall the Perl
6670
 
   DBD::mysql module whenever you install a new release of
6671
 
   MySQL. The same applies to other MySQL interfaces as well,
6672
 
   such as the PHP mysql extension and the Python MySQLdb
6673
 
   module.
6674
 
 
6675
 
2.12.1. Upgrading from MySQL 5.0 to 5.1
 
6227
   client programs, such as Commands out of sync or unexpected core
 
6228
   dumps, you probably have used old header or library files when
 
6229
   compiling your programs. In this case, you should check the date
 
6230
   for your mysql.h file and libmysqlclient.a library to verify that
 
6231
   they are from the new MySQL distribution. If not, recompile your
 
6232
   programs with the new headers and libraries.
 
6233
 
 
6234
   If problems occur, such as that the new mysqld server does not
 
6235
   start or that you cannot connect without a password, verify that
 
6236
   you do not have an old my.cnf file from your previous
 
6237
   installation. You can check this with the --print-defaults option
 
6238
   (for example, mysqld --print-defaults). If this command displays
 
6239
   anything other than the program name, you have an active my.cnf
 
6240
   file that affects server or client operation.
 
6241
 
 
6242
   It is a good idea to rebuild and reinstall the Perl DBD::mysql
 
6243
   module whenever you install a new release of MySQL. The same
 
6244
   applies to other MySQL interfaces as well, such as the PHP mysql
 
6245
   extension and the Python MySQLdb module.
 
6246
 
 
6247
2.12.1.1. Upgrading from MySQL 5.0 to 5.1
6676
6248
 
6677
6249
   After upgrading a 5.0 installation to 5.0.10 or above, it is
6678
 
   necessary to upgrade your grant tables. Otherwise, creating
6679
 
   stored procedures and functions might not work. The procedure
6680
 
   for doing this is described in Section 4.4.8, "mysql_upgrade
6681
 
   --- Check Tables for MySQL Upgrade."
 
6250
   necessary to upgrade your grant tables. Otherwise, creating stored
 
6251
   procedures and functions might not work. The procedure for doing
 
6252
   this is described in Section 4.4.8, "mysql_upgrade --- Check
 
6253
   Tables for MySQL Upgrade."
6682
6254
 
6683
6255
Note
6684
6256
 
6685
 
   It is good practice to back up your data before installing
6686
 
   any new version of software. Although MySQL works very hard
6687
 
   to ensure a high level of quality, you should protect your
6688
 
   data by making a backup. MySQL recommends that you dump and
6689
 
   reload your tables from any previous version to upgrade to
6690
 
   5.1.
6691
 
 
6692
 
   In general, you should do the following when upgrading from
6693
 
   MySQL 5.0 to 5.1:
6694
 
 
6695
 
     * Read all the items in the following sections to see
6696
 
       whether any of them might affect your applications:
6697
 
 
6698
 
          + Section 2.12, "Upgrading MySQL," has general update
 
6257
   It is good practice to back up your data before installing any new
 
6258
   version of software. Although MySQL works very hard to ensure a
 
6259
   high level of quality, you should protect your data by making a
 
6260
   backup. MySQL recommends that you dump and reload your tables from
 
6261
   any previous version to upgrade to 5.1.
 
6262
 
 
6263
   In general, you should do the following when upgrading from MySQL
 
6264
   5.0 to 5.1:
 
6265
 
 
6266
     * Read all the items in the following sections to see whether
 
6267
       any of them might affect your applications:
 
6268
 
 
6269
          + Section 2.12.1, "Upgrading MySQL," has general update
6699
6270
            information.
6700
6271
 
6701
 
          + The items in the change lists found later in this
6702
 
            section enable you to identify upgrade issues that
6703
 
            apply to your current MySQL installation.
6704
 
 
6705
 
          + The MySQL 5.1 change history describes significant
6706
 
            new features you can use in 5.1 or that differ from
6707
 
            those found in MySQL 5.0. Some of these changes may
6708
 
            result in incompatibilities. See Section C.1,
6709
 
            "Changes in release 5.1.x (Production)."
6710
 
 
6711
 
     * Note particularly any changes that are marked Known issue
6712
 
       or Incompatible change. These incompatibilities with
6713
 
       earlier versions of MySQL may require your attention
6714
 
       before you upgrade.
6715
 
       Our aim is to avoid these changes, but occasionally they
6716
 
       are necessary to correct problems that would be worse
6717
 
       than an incompatibility between releases. If any upgrade
6718
 
       issue applicable to your installation involves an
6719
 
       incompatibility that requires special handling, follow
6720
 
       the instructions given in the incompatibility
6721
 
       description. Often this will involve a dump and reload,
6722
 
       or use of a statement such as CHECK TABLE or REPAIR
6723
 
       TABLE.
6724
 
       A dump and reload is done like this:
6725
 
 
6726
 
          + Dump the affected tables with mysqldump before
6727
 
            upgrading
6728
 
 
6729
 
          + Reload the dump file (for example, with mysql) to
6730
 
            recreate the tables after upgrading
6731
 
       Any procedure that involves REPAIR TABLE with the USE_FRM
6732
 
       option must be done before upgrading. Use of this
6733
 
       statement with a version of MySQL different from the one
6734
 
       used to create the table (that is, using it after
6735
 
       upgrading) may damage the table. See Section 12.5.2.6,
6736
 
       "REPAIR TABLE Syntax."
6737
 
 
6738
 
     * After you upgrade to a new version of MySQL, run
6739
 
       mysql_upgrade (see Section 4.4.8, "mysql_upgrade ---
6740
 
       Check Tables for MySQL Upgrade"). This program will check
6741
 
       your tables, and repair them if necessary. It will also
6742
 
       update your grant tables to make sure that they have the
6743
 
       current structure so that you can take advantage of any
6744
 
       new capabilities. (Some releases of MySQL introduce
6745
 
       changes to the structure of the grant tables to add new
6746
 
       privileges or features.)
 
6272
          + The items in the change lists found later in this section
 
6273
            enable you to identify upgrade issues that apply to your
 
6274
            current MySQL installation.
 
6275
 
 
6276
          + The MySQL 5.1 change history describes significant new
 
6277
            features you can use in 5.1 or that differ from those
 
6278
            found in MySQL 5.0. Some of these changes may result in
 
6279
            incompatibilities. See Section C.1, "Changes in release
 
6280
            5.1.x (Production)."
 
6281
 
 
6282
     * Note particularly any changes that are marked Known issue or
 
6283
       Incompatible change. These incompatibilities with earlier
 
6284
       versions of MySQL may require your attention before you
 
6285
       upgrade.
 
6286
       Our aim is to avoid these changes, but occasionally they are
 
6287
       necessary to correct problems that would be worse than an
 
6288
       incompatibility between releases. If any upgrade issue
 
6289
       applicable to your installation involves an incompatibility
 
6290
       that requires special handling, follow the instructions given
 
6291
       in the incompatibility description. Often this will involve a
 
6292
       dump and reload, or use of a statement such as CHECK TABLE or
 
6293
       REPAIR TABLE.
 
6294
       For dump and reload instructions, see Section 2.12.4,
 
6295
       "Rebuilding Tables or Table Indexes." Any procedure that
 
6296
       involves REPAIR TABLE with the USE_FRM option must be done
 
6297
       before upgrading. Use of this statement with a version of
 
6298
       MySQL different from the one used to create the table (that
 
6299
       is, using it after upgrading) may damage the table. See
 
6300
       Section 12.5.2.6, "REPAIR TABLE Syntax."
 
6301
 
 
6302
     * After you upgrade to a new version of MySQL, run mysql_upgrade
 
6303
       (see Section 4.4.8, "mysql_upgrade --- Check Tables for MySQL
 
6304
       Upgrade"). This program will check your tables, and repair
 
6305
       them if necessary. It will also update your grant tables to
 
6306
       make sure that they have the current structure so that you can
 
6307
       take advantage of any new capabilities. (Some releases of
 
6308
       MySQL introduce changes to the structure of the grant tables
 
6309
       to add new privileges or features.)
 
6310
 
 
6311
     * Check Section 2.12.3, "Checking Whether Table Indexes Must Be
 
6312
       Rebuilt," to see whether changes to character sets or
 
6313
       collations were made that affect your table indexes. If so,
 
6314
       you will need to rebuild the affected indexes using the
 
6315
       instructions in Section 2.12.4, "Rebuilding Tables or Table
 
6316
       Indexes."
6747
6317
 
6748
6318
     * If you are running MySQL Server on Windows, see Section
6749
6319
       2.3.14, "Upgrading MySQL on Windows."
6750
6320
 
6751
 
     * If you are using replication, see Section 16.3.3,
6752
 
       "Upgrading a Replication Setup," for information on
6753
 
       upgrading your replication setup.
 
6321
     * If you are using replication, see Section 16.3.3, "Upgrading a
 
6322
       Replication Setup," for information on upgrading your
 
6323
       replication setup.
6754
6324
 
6755
 
   The following lists describe changes that may affect
6756
 
   applications and that you should watch out for when upgrading
6757
 
   to MySQL 5.1.
 
6325
   The following lists describe changes that may affect applications
 
6326
   and that you should watch out for when upgrading to MySQL 5.1.
6758
6327
 
6759
6328
   Configuration Changes:
6760
6329
 
6761
6330
     * Before MySQL 5.1.11, to build MySQL from source with SSL
6762
 
       support enabled, you would invoke configure with either
6763
 
       the --with-openssl or --with-yassl option. In MySQL
6764
 
       5.1.11, those options both have been replaced by the
6765
 
       --with-ssl option. By default, --with-ssl causes the
6766
 
       bundled yaSSL library to be used. To select OpenSSL
6767
 
       instead, give the option as --with-ssl=path, where path
6768
 
       is the directory where the OpenSSL header files and
6769
 
       libraries are located.
 
6331
       support enabled, you would invoke configure with either the
 
6332
       --with-openssl or --with-yassl option. In MySQL 5.1.11, those
 
6333
       options both have been replaced by the --with-ssl option. By
 
6334
       default, --with-ssl causes the bundled yaSSL library to be
 
6335
       used. To select OpenSSL instead, give the option as
 
6336
       --with-ssl=path, where path is the directory where the OpenSSL
 
6337
       header files and libraries are located.
6770
6338
 
6771
6339
   Server Changes:
6772
6340
 
6773
6341
     * Known issue: Before MySQL 5.1.30, the CHECK TABLE ... FOR
6774
 
       UPGRADE statement did not check for incompatible
6775
 
       collation changes made in MySQL 5.1.24. (This also
6776
 
       affects mysqlcheck and mysql_upgrade, which cause that
6777
 
       statement to be executed.)
6778
 
       Prior to the fix made in 5.1.30, a binary upgrade
6779
 
       (performed without dumping tables with mysqldump before
6780
 
       the upgrade and reloading the dump file after the
6781
 
       upgrade) would corrupt tables. After the fix, CHECK TABLE
6782
 
       ... FOR UPGRADE properly detects the problem and upgrades
6783
 
       tables.
6784
 
       However, the fix is not backward compatible and can
6785
 
       result in a downgrading problem under these
6786
 
       circumstances:
 
6342
       UPGRADE statement did not check for incompatible collation
 
6343
       changes made in MySQL 5.1.24. (This also affects mysqlcheck
 
6344
       and mysql_upgrade, which cause that statement to be executed.)
 
6345
       Prior to the fix made in 5.1.30, a binary upgrade (performed
 
6346
       without dumping tables with mysqldump before the upgrade and
 
6347
       reloading the dump file after the upgrade) would corrupt
 
6348
       tables. After the fix, CHECK TABLE ... FOR UPGRADE properly
 
6349
       detects the problem and warns about tables that need repair.
 
6350
       However, the fix is not backward compatible and can result in
 
6351
       a downgrading problem under these circumstances:
6787
6352
 
6788
6353
         1. Perform a binary upgrade to a version of MySQL that
6789
6354
            includes the fix.
6791
6356
         2. Run CHECK TABLE ... FOR UPGRADE (or mysqlcheck or
6792
6357
            mysql_upgrade) to upgrade tables.
6793
6358
 
6794
 
         3. Perform a binary downgrade to a version of MySQL
6795
 
            that does not include the fix.
 
6359
         3. Perform a binary downgrade to a version of MySQL that
 
6360
            does not include the fix.
6796
6361
       The solution is to dump tables with mysqldump before the
6797
6362
       downgrade and reload the dump file after the downgrade.
6798
6363
       Alternatively, drop and recreate affected indexes.
6799
6364
 
6800
 
     * Known issue: MySQL introduces encoding for table names
6801
 
       that have non-ASCII characters (see Section 8.2.3,
6802
 
       "Mapping of Identifiers to Filenames"). After a live
6803
 
       upgrade from MySQL 5.0 to 5.1, the server recognizes
6804
 
       names that have non-ASCII characters and adds a #mysql50#
6805
 
       prefix to them. Running mysqlcheck later (or
6806
 
       mysql_upgrade, which runs mysqlcheck) to upgrade these
6807
 
       names encodes them with the new format and removes the
6808
 
       #mysql50# prefix. However, although this is done for
6809
 
       tables, it is not done for views. To work around this
6810
 
       problem, drop each affected view and recreate it.
6811
 
       This problem is fixed as of MySQL 5.1.23.
 
6365
     * Known issue: MySQL introduces encoding for table names that
 
6366
       have non-ASCII characters (see Section 8.2.3, "Mapping of
 
6367
       Identifiers to File Names"). After a live upgrade from MySQL
 
6368
       5.0 to 5.1 or higher, the server recognizes names that have
 
6369
       non-ASCII characters and adds a #mysql50# prefix to them.
 
6370
       Running mysqlcheck --all-databases --check-upgrade
 
6371
       --fix-db-names --fix-table-names later upgrades these names by
 
6372
       encoding them with the new format and removes the #mysql50#
 
6373
       prefix.
 
6374
       However, although this is done for tables, it is not done for
 
6375
       views prior to MySQL 5.1.23. To work around this problem, drop
 
6376
       each affected view and recreate it. This problem is fixed as
 
6377
       of MySQL 5.1.23.
 
6378
       To check and repair tables and to upgrade the system tables,
 
6379
       mysql_upgrade executes the following commands:
 
6380
mysqlcheck --check-upgrade --all-databases --auto-repair
 
6381
mysql_fix_privilege_tables
 
6382
mysqlcheck --all-databases --check-upgrade --fix-db-names --fix-table
 
6383
-names
 
6384
       However, prior to MySQL 5.1.31, mysql_upgrade does not run the
 
6385
       third command, which is necessary to re-encode database or
 
6386
       table names that contain non-alphanumeric characters. (They
 
6387
       still appear after the upgrade with the #mysql50# prefix.) If
 
6388
       you have such database or table names, execute the third
 
6389
       command manually after executing mysql_upgrade. This problem
 
6390
       is fixed as of MySQL 5.1.31.
6812
6391
 
6813
 
     * Known issue: When upgrading from MySQL 5.0 to 5.1,
6814
 
       running mysqlcheck (or mysql_upgrade, which runs
6815
 
       mysqlcheck) to upgrade tables fails for names that must
6816
 
       be written as quoted identifiers. To work around this
6817
 
       problem, rename each affected table to a name that does
6818
 
       not require quoting:
 
6392
     * Known issue: When upgrading from MySQL 5.0 to 5.1, running
 
6393
       mysqlcheck (or mysql_upgrade, which runs mysqlcheck) to
 
6394
       upgrade tables fails for names that must be written as quoted
 
6395
       identifiers. To work around this problem, rename each affected
 
6396
       table to a name that does not require quoting:
6819
6397
RENAME TABLE `tab``le_a` TO table_a;
6820
6398
RENAME TABLE `table b` TO table_b;
6821
 
 
6822
 
       After renaming the tables, run the mysql_upgrade program.
6823
 
       Then rename the tables back to their original names:
 
6399
       After renaming the tables, run the mysql_upgrade program. Then
 
6400
       rename the tables back to their original names:
6824
6401
RENAME TABLE table_a TO `tab``le_a`;
6825
6402
RENAME TABLE table_b TO `table b`;
6826
 
 
6827
6403
       This problem is fixed as of MySQL 5.1.23.
6828
6404
 
6829
6405
     * Known issue: In connection with view creation, the server
6830
6406
       created arc directories inside database directories and
6831
 
       maintained useless copies of .frm files there. Creation
6832
 
       and renaming procedures of those copies as well as
6833
 
       creation of arc directories has been discontinued in
6834
 
       MySQL 5.1.29.
6835
 
       This change does cause a problem when downgrading to
6836
 
       older server versions which manifests itself under these
 
6407
       maintained useless copies of .frm files there. Creation and
 
6408
       renaming procedures of those copies as well as creation of arc
 
6409
       directories has been discontinued in MySQL 5.1.29.
 
6410
       This change does cause a problem when downgrading to older
 
6411
       server versions which manifests itself under these
6837
6412
       circumstances:
6838
6413
 
6839
6414
         1. Create a view v_orig in MySQL 5.1.29 or higher.
6840
6415
 
6841
6416
         2. Rename the view to v_new and then back to v_orig.
6842
6417
 
6843
 
         3. Downgrade to an older 5.1.x server and run
6844
 
            mysql_upgrade.
 
6418
         3. Downgrade to an older 5.1.x server and run mysql_upgrade.
6845
6419
 
6846
6420
         4. Try to rename v_orig to v_new again. This operation
6847
6421
            fails.
6848
 
       As a workaround to avoid this problem, use either of
6849
 
       these approaches:
6850
 
 
6851
 
          + Dump your data using mysqldump before downgrading
6852
 
            and reload the dump file after downgrading.
6853
 
 
6854
 
          + Instead of renaming a view after the downgrade, drop
6855
 
            it and recreate it.
6856
 
 
6857
 
     * Incompatible change: As of MySQL 5.1.29, the default
6858
 
       binary logging mode has been changed from MIXED to
6859
 
       STATEMENT for compatibility with MySQL 5.0.
6860
 
 
6861
 
     * Incompatible change: In MySQL 5.1.25, a change was made
6862
 
       to the way that the server handles prepared statements.
6863
 
       This affects prepared statements processed at the SQL
6864
 
       level (using the PREPARE statement) and those processed
6865
 
       using the binary client-server protocol (using the
6866
 
       mysql_stmt_prepare() C API function).
6867
 
       Previously, changes to metadata of tables or views
6868
 
       referred to in a prepared statement could cause a server
6869
 
       crash when the statement was next executed, or perhaps an
6870
 
       error at execute time with a crash occurring later. For
6871
 
       example, this could happen after dropping a table and
6872
 
       recreating it with a different definition.
 
6422
       As a workaround to avoid this problem, use either of these
 
6423
       approaches:
 
6424
 
 
6425
          + Dump your data using mysqldump before downgrading and
 
6426
            reload the dump file after downgrading.
 
6427
 
 
6428
          + Instead of renaming a view after the downgrade, drop it
 
6429
            and recreate it.
 
6430
 
 
6431
     * Known issue: Dumps performed by using mysqldump to generate a
 
6432
       dump file before the upgrade and reloading the file after
 
6433
       upgrading are subject to the following problem:
 
6434
       Before MySQL 5.0.40, mysqldump displays SPATIAL index
 
6435
       definitions using prefix lengths for the indexed columns.
 
6436
       These prefix lengths are accepted in MySQL 5.0, but not as of
 
6437
       MySQL 5.1. If you use mysqldump from versions of MySQL older
 
6438
       than 5.0.40, any table containing SPATIAL indexes will cause
 
6439
       an error when the dump file is reloaded into MySQL 5.1 or
 
6440
       higher.
 
6441
       For example, a table definition might look like this when
 
6442
       dumped in MySQL 5.0:
 
6443
CREATE TABLE `t` (
 
6444
 `g` geometry NOT NULL,
 
6445
 SPATIAL KEY `g` (`g`(32))
 
6446
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
6447
       The SPATIAL index definition will not be accepted in MySQL
 
6448
       5.1. To work around this, edit the dump file to remove the
 
6449
       prefix:
 
6450
CREATE TABLE `t` (
 
6451
 `g` geometry NOT NULL,
 
6452
 SPATIAL KEY `g` (`g`)
 
6453
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
6454
       Dump files can be large, so it may be preferable to dump table
 
6455
       definitions and data separately to make it easier to edit the
 
6456
       definitions:
 
6457
shell> mysqldump --no-data other_args > definitions.sql
 
6458
shell> mysqldump --no-create-info other_args > data.sql
 
6459
       Then edit definitions.sql before reloading definitions.sql and
 
6460
       data.sql, in that order.
 
6461
 
 
6462
     * Incompatible change: From MySQL 5.1.24 to 5.1.31, the UPDATE
 
6463
       statement was changed such that assigning NULL to a NOT NULL
 
6464
       column caused an error even when strict SQL mode was not
 
6465
       enabled. The original behavior before MySQL 5.1.24 was that
 
6466
       such assignments caused an error only in strict SQL mode, and
 
6467
       otherwise set the column to the the implicit default value for
 
6468
       the column data type and generated a warning. (For information
 
6469
       about implicit default values, see Section 10.1.4, "Data Type
 
6470
       Default Values.")
 
6471
       The change caused compatibility problems for applications that
 
6472
       relied on the original behavior. It also caused replication
 
6473
       problems between servers that had the original behavior and
 
6474
       those that did not, for applications that assigned NULL to NOT
 
6475
       NULL columns in UPDATE statements without strict SQL mode
 
6476
       enabled. The change was reverted in MySQL 5.1.32 so that
 
6477
       UPDATE again had the original behavior. Problems can still
 
6478
       occur if you replicate between servers that have the modified
 
6479
       UPDATE behavior and those that do not.
 
6480
 
 
6481
     * Incompatible change: Character set or collation changes were
 
6482
       made in MySQL 5.1.21, 5.1.23, and 5.1.24 that may require
 
6483
       table indexes to be rebuilt. For details, see Section 2.12.3,
 
6484
       "Checking Whether Table Indexes Must Be Rebuilt."
 
6485
 
 
6486
     * Incompatible change: As of MySQL 5.1.29, the default binary
 
6487
       logging mode has been changed from MIXED to STATEMENT for
 
6488
       compatibility with MySQL 5.0.
 
6489
 
 
6490
     * Incompatible change: In MySQL 5.1.25, a change was made to the
 
6491
       way that the server handles prepared statements. This affects
 
6492
       prepared statements processed at the SQL level (using the
 
6493
       PREPARE statement) and those processed using the binary
 
6494
       client-server protocol (using the mysql_stmt_prepare() C API
 
6495
       function).
 
6496
       Previously, changes to metadata of tables or views referred to
 
6497
       in a prepared statement could cause a server crash when the
 
6498
       statement was next executed, or perhaps an error at execute
 
6499
       time with a crash occurring later. For example, this could
 
6500
       happen after dropping a table and recreating it with a
 
6501
       different definition.
6873
6502
       Now metadata changes to tables or views referred to by
6874
6503
       prepared statements are detected and cause automatic
6875
6504
       repreparation of the statement when it is next executed.
6876
 
       Metadata changes occur for DDL statements such as those
6877
 
       that create, drop, alter, rename, or truncate tables, or
6878
 
       that analyze, optimize, or repair tables. Repreparation
6879
 
       also occurs after referenced tables or views are flushed
6880
 
       from the table definition cache, either implicitly to
6881
 
       make room for new entries in the cache, or explicitly due
6882
 
       to FLUSH TABLES.
6883
 
       Repreparation is automatic, but to the extent that it
6884
 
       occurs, performance of prepared statements is diminished.
6885
 
       Table content changes (for example, with INSERT or
6886
 
       UPDATE) do not cause repreparation, nor do SELECT
6887
 
       statements.
6888
 
       An incompatibility with previous versions of MySQL is
6889
 
       that a prepared statement may now return a different set
6890
 
       of columns or different column types from one execution
6891
 
       to the next. For example, if the prepared statement is
6892
 
       SELECT * FROM t1, altering t1 to contain a different
6893
 
       number of columns causes the next execution to return a
6894
 
       number of columns different from the previous execution.
6895
 
       Older versions of the client library cannot handle this
6896
 
       change in behavior. For applications that use prepared
6897
 
       statements with the new server, an upgrade to the new
6898
 
       client library is strongly recommended.
6899
 
       Along with this change to statement repreparation, the
6900
 
       default value of the table_definition_cache system
6901
 
       variable has been increased from 128 to 256. The purpose
6902
 
       of this increase is to lessen the chance that prepared
6903
 
       statements will need repreparation due to referred-to
6904
 
       tables/views having been flushed from the cache to make
6905
 
       room for new entries.
6906
 
       A new status variable, Com_stmt_reprepare, has been
6907
 
       introduced to track the number of repreparations.
6908
 
 
6909
 
     * Incompatible change: In MySQL 5.1.24, the utf8_general_ci
6910
 
       and ucs2_general_ci collations were fixed to sort the
6911
 
       letter "U+00DF SHARP S" equal to 's'. As a result of this
6912
 
       fix, any indexes on columns that use these collations
6913
 
       (but only columns that use SHARP S) must be rebuilt when
6914
 
       upgrading to 5.1.24 or higher. To do this, use ALTER
6915
 
       TABLE to drop and re-add the indexes, or mysqldump to
6916
 
       dump the affected tables and mysql to reload the dump
6917
 
       file.
 
6505
       Metadata changes occur for DDL statements such as those that
 
6506
       create, drop, alter, rename, or truncate tables, or that
 
6507
       analyze, optimize, or repair tables. Repreparation also occurs
 
6508
       after referenced tables or views are flushed from the table
 
6509
       definition cache, either implicitly to make room for new
 
6510
       entries in the cache, or explicitly due to FLUSH TABLES.
 
6511
       Repreparation is automatic, but to the extent that it occurs,
 
6512
       performance of prepared statements is diminished.
 
6513
       Table content changes (for example, with INSERT or UPDATE) do
 
6514
       not cause repreparation, nor do SELECT statements.
 
6515
       An incompatibility with previous versions of MySQL is that a
 
6516
       prepared statement may now return a different set of columns
 
6517
       or different column types from one execution to the next. For
 
6518
       example, if the prepared statement is SELECT * FROM t1,
 
6519
       altering t1 to contain a different number of columns causes
 
6520
       the next execution to return a number of columns different
 
6521
       from the previous execution.
 
6522
       Older versions of the client library cannot handle this change
 
6523
       in behavior. For applications that use prepared statements
 
6524
       with the new server, an upgrade to the new client library is
 
6525
       strongly recommended.
 
6526
       Along with this change to statement repreparation, the default
 
6527
       value of the table_definition_cache system variable has been
 
6528
       increased from 128 to 256. The purpose of this increase is to
 
6529
       lessen the chance that prepared statements will need
 
6530
       repreparation due to referred-to tables/views having been
 
6531
       flushed from the cache to make room for new entries.
 
6532
       A new status variable, Com_stmt_reprepare, has been introduced
 
6533
       to track the number of repreparations.
6918
6534
 
6919
6535
     * Incompatible change: As of MySQL 5.1.23, within a stored
6920
 
       routine, it is no longer allowable to declare a cursor
6921
 
       for a SHOW or DESCRIBE statement. This happened to work
6922
 
       in some instances, but is no longer supported. In many
6923
 
       cases, a workaround for this change is to use the cursor
6924
 
       with a SELECT query to read from an INFORMATION_SCHEMA
6925
 
       table that provides the same information as the SHOW
6926
 
       statement.
6927
 
 
6928
 
     * Incompatible change: MySQL 5.1 implements support for a
6929
 
       plugin API that allows the loading and unloading of
6930
 
       components at runtime, without restarting the server.
6931
 
       Section 22.2, "The MySQL Plugin Interface." The plugin
6932
 
       API requires the mysql.plugin table. After upgrading from
6933
 
       an older version of MySQL, you should run the
6934
 
       mysql_upgrade command to create this table. See Section
6935
 
       4.4.8, "mysql_upgrade --- Check Tables for MySQL
6936
 
       Upgrade."
6937
 
       Plugins are installed in the directory named by the
6938
 
       plugin_dir system variable. This variable also controls
6939
 
       the location from which the server loads user-defined
6940
 
       functions (UDFs), which is a change from earlier versions
6941
 
       of MySQL. That is, all UDF library files now must be
6942
 
       installed in the plugin directory. When upgrading from an
6943
 
       older version of MySQL, you must migrate your UDF files
6944
 
       to the plugin directory.
6945
 
 
6946
 
     * Incompatible change: The table_cache system variable has
6947
 
       been renamed to table_open_cache. Any scripts that refer
6948
 
       to table_cache should be updated to use the new name.
6949
 
 
6950
 
     * Incompatible change: Several issues were identified for
6951
 
       stored programs (stored functions and procedures,
6952
 
       triggers, and events) and views containing non-ASCII
6953
 
       symbols. These issues involved conversion errors due to
6954
 
       incomplete character set information when translating
6955
 
       these objects to and from stored format.
 
6536
       routine, it is no longer allowable to declare a cursor for a
 
6537
       SHOW or DESCRIBE statement. This happened to work in some
 
6538
       instances, but is no longer supported. In many cases, a
 
6539
       workaround for this change is to use the cursor with a SELECT
 
6540
       query to read from an INFORMATION_SCHEMA table that provides
 
6541
       the same information as the SHOW statement.
 
6542
 
 
6543
     * Incompatible change: MySQL 5.1 implements support for a plugin
 
6544
       API that allows the loading and unloading of components at
 
6545
       runtime, without restarting the server. Section 22.2, "The
 
6546
       MySQL Plugin Interface." The plugin API requires the
 
6547
       mysql.plugin table. After upgrading from an older version of
 
6548
       MySQL, you should run the mysql_upgrade command to create this
 
6549
       table. See Section 4.4.8, "mysql_upgrade --- Check Tables for
 
6550
       MySQL Upgrade."
 
6551
       Plugins are installed in the directory named by the plugin_dir
 
6552
       system variable. This variable also controls the location from
 
6553
       which the server loads user-defined functions (UDFs), which is
 
6554
       a change from earlier versions of MySQL. That is, all UDF
 
6555
       library files now must be installed in the plugin directory.
 
6556
       When upgrading from an older version of MySQL, you must
 
6557
       migrate your UDF files to the plugin directory.
 
6558
 
 
6559
     * Incompatible change: The table_cache system variable has been
 
6560
       renamed to table_open_cache. Any scripts that refer to
 
6561
       table_cache should be updated to use the new name.
 
6562
 
 
6563
     * Incompatible change: Several issues were identified for stored
 
6564
       programs (stored procedures and functions, triggers, and
 
6565
       events) and views containing non-ASCII symbols. These issues
 
6566
       involved conversion errors due to incomplete character set
 
6567
       information when translating these objects to and from stored
 
6568
       format.
6956
6569
       To address these problems, the representation for these
6957
 
       objects was changed in MySQL 5.1.21. However, the fixes
6958
 
       affect all stored programs and views. (For example, you
6959
 
       will see warnings about "no creation context.") To avoid
6960
 
       warnings from the server about the use of old definitions
6961
 
       from any release prior to 5.1.21, you should dump stored
6962
 
       programs and views with mysqldump after upgrading to
6963
 
       5.1.21 or higher, and then reload them to recreate them
6964
 
       with new definitions. Invoke mysqldump with a
6965
 
       --default-character-set option that names the non-ASCII
6966
 
       character set that was used for the definitions when the
6967
 
       objects were originally defined.
 
6570
       objects was changed in MySQL 5.1.21. However, the fixes affect
 
6571
       all stored programs and views. (For example, you will see
 
6572
       warnings about "no creation context.") To avoid warnings from
 
6573
       the server about the use of old definitions from any release
 
6574
       prior to 5.1.21, you should dump stored programs and views
 
6575
       with mysqldump after upgrading to 5.1.21 or higher, and then
 
6576
       reload them to recreate them with new definitions. Invoke
 
6577
       mysqldump with a --default-character-set option that names the
 
6578
       non-ASCII character set that was used for the definitions when
 
6579
       the objects were originally defined.
6968
6580
 
6969
 
     * Incompatible change: As of MySQL 5.1.20, mysqld_safe
6970
 
       supports error logging to syslog on systems that support
6971
 
       the logger command. The new --syslog and --skip-syslog
6972
 
       options can be used instead of the --log-error option to
6973
 
       control logging behavior, as described in Section 4.3.2,
6974
 
       "mysqld_safe --- MySQL Server Startup Script."
 
6581
     * Incompatible change: As of MySQL 5.1.20, mysqld_safe supports
 
6582
       error logging to syslog on systems that support the logger
 
6583
       command. The new --syslog and --skip-syslog options can be
 
6584
       used instead of the --log-error option to control logging
 
6585
       behavior, as described in Section 4.3.2, "mysqld_safe ---
 
6586
       MySQL Server Startup Script."
6975
6587
       In 5.1.21 and up, the default is --skip-syslog, which is
6976
 
       compatible with the default behavior of writing an error
6977
 
       log file for releases prior to 5.1.20.
6978
 
       In 5.1.20 only, the following conditions apply: 1) The
6979
 
       default is to use syslog, which is not compatible with
6980
 
       releases prior to 5.1.20. 2) Logging to syslog may fail
6981
 
       to operate correctly in some cases, so we recommend that
6982
 
       you use --skip-syslog or --log-error. To maintain the
6983
 
       older behavior if you were using no error-logging option,
6984
 
       use --skip-syslog. If you were using --log-error,
6985
 
       continue to use it.
 
6588
       compatible with the default behavior of writing an error log
 
6589
       file for releases prior to 5.1.20.
 
6590
       In 5.1.20 only, the following conditions apply: 1) The default
 
6591
       is to use syslog, which is not compatible with releases prior
 
6592
       to 5.1.20. 2) Logging to syslog may fail to operate correctly
 
6593
       in some cases, so we recommend that you use --skip-syslog or
 
6594
       --log-error. To maintain the older behavior if you were using
 
6595
       no error-logging option, use --skip-syslog. If you were using
 
6596
       --log-error, continue to use it.
6986
6597
 
6987
 
     * Incompatible change: As of MySQL 5.1.15, InnoDB rolls
6988
 
       back only the last statement on a transaction timeout. A
6989
 
       new option, --innodb_rollback_on_timeout, causes InnoDB
6990
 
       to abort and roll back the entire transaction if a
6991
 
       transaction timeout occurs (the same behavior as in MySQL
6992
 
       4.1).
 
6598
     * Incompatible change: As of MySQL 5.1.15, InnoDB rolls back
 
6599
       only the last statement on a transaction timeout. A new
 
6600
       option, --innodb_rollback_on_timeout, causes InnoDB to abort
 
6601
       and roll back the entire transaction if a transaction timeout
 
6602
       occurs (the same behavior as in MySQL 4.1).
6993
6603
 
6994
6604
     * Incompatible change: As of MySQL 5.1.15, the following
6995
 
       conditions apply to enabling the read_only system
6996
 
       variable:
 
6605
       conditions apply to enabling the read_only system variable:
6997
6606
 
6998
 
          + If you attempt to enable read_only while you have
6999
 
            any explicit locks (acquired with LOCK TABLES or
7000
 
            have a pending transaction, an error will occur.
 
6607
          + If you attempt to enable read_only while you have any
 
6608
            explicit locks (acquired with LOCK TABLES or have a
 
6609
            pending transaction, an error will occur.
7001
6610
 
7002
6611
          + If other clients hold explicit table locks or have
7003
 
            pending transactions, the attempt to enable
7004
 
            read_only blocks until the locks are released and
7005
 
            the transactions end. While the attempt to enable
7006
 
            read_only is pending, requests by other clients for
7007
 
            table locks or to begin transactions also block
7008
 
            until read_only has been set.
 
6612
            pending transactions, the attempt to enable read_only
 
6613
            blocks until the locks are released and the transactions
 
6614
            end. While the attempt to enable read_only is pending,
 
6615
            requests by other clients for table locks or to begin
 
6616
            transactions also block until read_only has been set.
7009
6617
 
7010
 
          + read_only can be enabled while you hold a global
7011
 
            read lock (acquired with FLUSH TABLES WITH READ
7012
 
            LOCK) because that does not involve table locks.
 
6618
          + read_only can be enabled while you hold a global read
 
6619
            lock (acquired with FLUSH TABLES WITH READ LOCK) because
 
6620
            that does not involve table locks.
7013
6621
       Previously, the attempt to enable read_only would return
7014
6622
       immediately even if explicit locks or transactions were
7015
6623
       pending, so some data changes could occur for statements
7016
6624
       executing in the server at the same time.
7017
6625
 
7018
 
     * Incompatible change: The number of function names
7019
 
       affected by IGNORE_SPACE was reduced significantly in
7020
 
       MySQL 5.1.13, from about 200 to about 30. (For details
7021
 
       about IGNORE_SPACE, see Section 8.2.4, "Function Name
7022
 
       Parsing and Resolution.") This change improves the
7023
 
       consistency of parser operation. However, it also
7024
 
       introduces the possibility of incompatibility for old SQL
7025
 
       code that relies on the following conditions:
 
6626
     * Incompatible change: The number of function names affected by
 
6627
       IGNORE_SPACE was reduced significantly in MySQL 5.1.13, from
 
6628
       about 200 to about 30. (For details about IGNORE_SPACE, see
 
6629
       Section 8.2.4, "Function Name Parsing and Resolution.") This
 
6630
       change improves the consistency of parser operation. However,
 
6631
       it also introduces the possibility of incompatibility for old
 
6632
       SQL code that relies on the following conditions:
7026
6633
 
7027
6634
          + IGNORE_SPACE is disabled.
7028
6635
 
7029
6636
          + The presence or absence of whitespace following a
7030
 
            function name is used to distinguish between a
7031
 
            built-in function and stored function that have the
7032
 
            same name (for example, PI() versus PI ()).
7033
 
       For functions that are no longer affected by IGNORE_SPACE
7034
 
       as of MySQL 5.1.13, that strategy no longer works. Either
7035
 
       of the following approaches can be used if you have code
7036
 
       that is subject to the preceding incompatibility:
 
6637
            function name is used to distinguish between a built-in
 
6638
            function and stored function that have the same name (for
 
6639
            example, PI() versus PI ()).
 
6640
       For functions that are no longer affected by IGNORE_SPACE as
 
6641
       of MySQL 5.1.13, that strategy no longer works. Either of the
 
6642
       following approaches can be used if you have code that is
 
6643
       subject to the preceding incompatibility:
7037
6644
 
7038
 
          + If a stored function has a name that conflicts with
7039
 
            a built-in function, refer to the stored function
7040
 
            with a schema name qualifier, regardless of whether
7041
 
            whitespace is present. For example, write
7042
 
            schema_name.PI() or schema_name.PI ().
 
6645
          + If a stored function has a name that conflicts with a
 
6646
            built-in function, refer to the stored function with a
 
6647
            schema name qualifier, regardless of whether whitespace
 
6648
            is present. For example, write schema_name.PI() or
 
6649
            schema_name.PI ().
7043
6650
 
7044
6651
          + Alternatively, rename the stored function to use a
7045
6652
            non-conflicting name and change invocations of the
7046
6653
            function to use the new name.
7047
6654
 
7048
 
     * Incompatible change: For utf8 columns, the full-text
7049
 
       parser incorrectly considered several non-word
7050
 
       punctuation and whitespace characters as word characters,
7051
 
       causing some searches to return incorrect results. The
7052
 
       fix involves a change to the full-text parser in MySQL
7053
 
       5.1.12, so as of 5.1.12, any tables that have FULLTEXT
7054
 
       indexes on utf8 columns must be repaired with REPAIR
7055
 
       TABLE:
 
6655
     * Incompatible change: For utf8 columns, the full-text parser
 
6656
       incorrectly considered several non-word punctuation and
 
6657
       whitespace characters as word characters, causing some
 
6658
       searches to return incorrect results. The fix involves a
 
6659
       change to the full-text parser in MySQL 5.1.12, so as of
 
6660
       5.1.12, any tables that have FULLTEXT indexes on utf8 columns
 
6661
       must be repaired with REPAIR TABLE:
7056
6662
REPAIR TABLE tbl_name QUICK;
7057
6663
 
7058
 
 
7059
6664
     * Incompatible change: Storage engines can be pluggable at
7060
6665
       runtime, so the distinction between disabled and invalid
7061
 
       storage engines no longer applies. As of MySQL 5.1.12,
7062
 
       this affects the NO_ENGINE_SUBSTITUTION SQL mode, as
7063
 
       described in Section 5.1.7, "Server SQL Modes."
 
6666
       storage engines no longer applies. As of MySQL 5.1.12, this
 
6667
       affects the NO_ENGINE_SUBSTITUTION SQL mode, as described in
 
6668
       Section 5.1.7, "Server SQL Modes."
7064
6669
 
7065
 
     * Incompatible change: The structure of FULLTEXT indexes
7066
 
       has been changed in MySQL 5.1.6. After upgrading to MySQL
7067
 
       5.1.6 or greater, use the REPAIR TABLE ... QUICK
7068
 
       statement for each table that contains any FULLTEXT
7069
 
       indexes.
 
6670
     * Incompatible change: The structure of FULLTEXT indexes has
 
6671
       been changed in MySQL 5.1.6. After upgrading to MySQL 5.1.6 or
 
6672
       greater, use the REPAIR TABLE ... QUICK statement for each
 
6673
       table that contains any FULLTEXT indexes.
7070
6674
 
7071
6675
     * Incompatible change: In MySQL 5.1.6, when log tables were
7072
 
       implemented, the default log destination for the general
7073
 
       query and slow query log was TABLE. As of MySQL 5.1.21,
7074
 
       this default has been changed to FILE, which is
7075
 
       compatible with MySQL 5.0, but incompatible with earlier
7076
 
       releases of MySQL 5.1 from 5.1.6 to 5.1.20. If you are
7077
 
       upgrading from MySQL 5.0 to this release, no logging
7078
 
       option changes should be necessary. However, if you are
7079
 
       upgrading from 5.1.6 through 5.1.20 to this release and
7080
 
       were using TABLE logging, use the --log-output=TABLE
7081
 
       option explicitly to preserve your server's table-logging
7082
 
       behavior.
 
6676
       implemented, the default log destination for the general query
 
6677
       and slow query log was TABLE. As of MySQL 5.1.21, this default
 
6678
       has been changed to FILE, which is compatible with MySQL 5.0,
 
6679
       but incompatible with earlier releases of MySQL 5.1 from 5.1.6
 
6680
       to 5.1.20. If you are upgrading from MySQL 5.0 to this
 
6681
       release, no logging option changes should be necessary.
 
6682
       However, if you are upgrading from 5.1.6 through 5.1.20 to
 
6683
       this release and were using TABLE logging, use the
 
6684
       --log-output=TABLE option explicitly to preserve your server's
 
6685
       table-logging behavior.
7083
6686
 
7084
 
     * Incompatible change: For ENUM columns that had
7085
 
       enumeration values containing commas, the commas were
7086
 
       mapped to 0xff internally. However, this rendered the
7087
 
       commas indistinguishable from true 0xff characters in the
7088
 
       values. This no longer occurs. However, the fix requires
7089
 
       that you dump and reload any tables that have ENUM
7090
 
       columns containing true 0xff in their values: Dump the
7091
 
       tables using mysqldump with the current server before
7092
 
       upgrading from a version of MySQL 5.1 older than 5.1.15
7093
 
       to version 5.1.15 or newer.
 
6687
     * Incompatible change: For ENUM columns that had enumeration
 
6688
       values containing commas, the commas were mapped to 0xff
 
6689
       internally. However, this rendered the commas
 
6690
       indistinguishable from true 0xff characters in the values.
 
6691
       This no longer occurs. However, the fix requires that you dump
 
6692
       and reload any tables that have ENUM columns containing true
 
6693
       0xff in their values: Dump the tables using mysqldump with the
 
6694
       current server before upgrading from a version of MySQL 5.1
 
6695
       older than 5.1.15 to version 5.1.15 or newer.
7094
6696
 
7095
6697
     * As of MySQL 5.1.12, the lc_time_names system variable
7096
6698
       specifies the locale that controls the language used to
7097
 
       display day and month names and abbreviations. This
7098
 
       variable affects the output from the DATE_FORMAT(),
7099
 
       DAYNAME() and MONTHNAME() functions. See Section 9.8,
7100
 
       "MySQL Server Locale Support."
7101
 
 
7102
 
     * As of MySQL 5.1.6, special characters in database and
7103
 
       table identifiers are encoded when creating the
7104
 
       corresponding directory names and filenames. This relaxes
7105
 
       the restrictions on the characters that can appear in
7106
 
       identifiers. See Section 8.2.3, "Mapping of Identifiers
7107
 
       to Filenames." To cause database and table names to be
7108
 
       updated to the new format should they contain special
7109
 
       characters, re-encode them with mysqlcheck. The following
7110
 
       command updates all names to the new encoding:
7111
 
shell> mysqlcheck --check-upgrade --fix-db-names --fix-table-names --a
7112
 
ll-databases
7113
 
 
7114
 
       mysqlcheck cannot fix names that contain literal
7115
 
       instances of the @ character that is used for encoding
7116
 
       special characters. If you have databases or tables that
7117
 
       contain this character, use mysqldump to dump them before
7118
 
       upgrading to MySQL 5.1.6 or later, and then reload the
7119
 
       dump file after upgrading.
7120
 
 
7121
 
     * As of MySQL 5.1.9, mysqld_safe no longer implicitly
7122
 
       invokes mysqld-max if it exists. Instead, it invokes
7123
 
       mysqld unless a --mysqld or --mysqld-version option is
7124
 
       given to specify another server explicitly. If you
7125
 
       previously relied on the implicit invocation of
7126
 
       mysqld-max, you should use an appropriate option now.
 
6699
       display day and month names and abbreviations. This variable
 
6700
       affects the output from the DATE_FORMAT(), DAYNAME() and
 
6701
       MONTHNAME() functions. See Section 9.8, "MySQL Server Locale
 
6702
       Support."
 
6703
 
 
6704
     * As of MySQL 5.1.6, special characters in database and table
 
6705
       identifiers are encoded when creating the corresponding
 
6706
       directory names and file names. This relaxes the restrictions
 
6707
       on the characters that can appear in identifiers. See Section
 
6708
       8.2.3, "Mapping of Identifiers to File Names." To cause
 
6709
       database and table names to be updated to the new format
 
6710
       should they contain special characters, re-encode them with
 
6711
       mysqlcheck. The following command updates all names to the new
 
6712
       encoding:
 
6713
shell> mysqlcheck --check-upgrade --fix-db-names --fix-table-names --
 
6714
all-databases
 
6715
       mysqlcheck cannot fix names that contain literal instances of
 
6716
       the @ character that is used for encoding special characters.
 
6717
       If you have databases or tables that contain this character,
 
6718
       use mysqldump to dump them before upgrading to MySQL 5.1.6 or
 
6719
       later, and then reload the dump file after upgrading.
 
6720
 
 
6721
     * As of MySQL 5.1.9, mysqld_safe no longer implicitly invokes
 
6722
       mysqld-max if it exists. Instead, it invokes mysqld unless a
 
6723
       --mysqld or --mysqld-version option is given to specify
 
6724
       another server explicitly. If you previously relied on the
 
6725
       implicit invocation of mysqld-max, you should use an
 
6726
       appropriate option now.
7127
6727
 
7128
6728
   SQL Changes:
7129
6729
 
7130
6730
     * Incompatible change: Multiple-table DELETE statements
7131
6731
       containing ambiguous aliases could have unintended side
7132
 
       effects such as deleting rows from the wrong table.
7133
 
       Example:
 
6732
       effects such as deleting rows from the wrong table. Example:
7134
6733
DELETE FROM t1 AS a2 USING t1 AS a1 INNER JOIN t2 AS a2;
7135
 
 
7136
 
       As of MySQL 5.1.23, alias declarations can be declared
7137
 
       only in the table_references part. Elsewhere in the
7138
 
       statement, alias references are allowed but not alias
7139
 
       declarations. Statements containing aliases that are no
7140
 
       longer allowed must be rewritten.
7141
 
 
7142
 
     * Important note: Prior to MySQL 5.1.17, the parser
7143
 
       accepted invalid code in SQL condition handlers, leading
7144
 
       to server crashes or unexpected execution behavior in
7145
 
       stored programs. Specifically, the parser allowed a
7146
 
       condition handler to refer to labels for blocks that
7147
 
       enclose the handler declaration. This was incorrect
7148
 
       because block label scope does not include the code for
7149
 
       handlers declared within the labeled block.
7150
 
       As of 5.1.17, the parser rejects this invalid construct,
7151
 
       but if you upgrade in place (without dumping and
7152
 
       reloading your databases), existing handlers that contain
7153
 
       the construct still are invalid even if they appear to
7154
 
       function as you expect and should be rewritten.
7155
 
       To find affected handlers, use mysqldump to dump all
7156
 
       stored functions and procedures, triggers, and events.
7157
 
       Then attempt to reload them into an upgraded server.
7158
 
       Handlers that contain illegal label references will be
7159
 
       rejected.
7160
 
       For more information about condition handlers and writing
7161
 
       them to avoid invalid jumps, see Section 12.8.4.2,
7162
 
       "DECLARE for Handlers."
 
6734
       As of MySQL 5.1.23, alias declarations can be declared only in
 
6735
       the table_references part. Elsewhere in the statement, alias
 
6736
       references are allowed but not alias declarations. Statements
 
6737
       containing aliases that are no longer allowed must be
 
6738
       rewritten.
 
6739
 
 
6740
     * Important note: Prior to MySQL 5.1.17, the parser accepted
 
6741
       invalid code in SQL condition handlers, leading to server
 
6742
       crashes or unexpected execution behavior in stored programs.
 
6743
       Specifically, the parser allowed a condition handler to refer
 
6744
       to labels for blocks that enclose the handler declaration.
 
6745
       This was incorrect because block label scope does not include
 
6746
       the code for handlers declared within the labeled block.
 
6747
       As of 5.1.17, the parser rejects this invalid construct, but
 
6748
       if you upgrade in place (without dumping and reloading your
 
6749
       databases), existing handlers that contain the construct still
 
6750
       are invalid even if they appear to function as you expect and
 
6751
       should be rewritten.
 
6752
       To find affected handlers, use mysqldump to dump all stored
 
6753
       procedures and functions, triggers, and events. Then attempt
 
6754
       to reload them into an upgraded server. Handlers that contain
 
6755
       illegal label references will be rejected.
 
6756
       For more information about condition handlers and writing them
 
6757
       to avoid invalid jumps, see Section 12.8.4.2, "DECLARE for
 
6758
       Handlers."
7163
6759
 
7164
6760
     * Incompatible change: The parser accepted statements that
7165
 
       contained /* ... */ that were not properly closed with
7166
 
       */, such as SELECT 1 /* + 2. As of MySQL 5.1.23,
7167
 
       statements that contain unclosed /*-comments now are
7168
 
       rejected with a syntax error.
7169
 
       This fix has the potential to cause incompatibilities.
7170
 
       Because of Bug#26302: http://bugs.mysql.com/26302, which
7171
 
       caused the trailing */ to be truncated from comments in
7172
 
       views, stored routines, triggers, and events, it is
7173
 
       possible that objects of those types may have been stored
7174
 
       with definitions that now will be rejected as
7175
 
       syntactically invalid. Such objects should be dropped and
7176
 
       re-created so that their definitions do not contain
7177
 
       truncated comments.
 
6761
       contained /* ... */ that were not properly closed with */,
 
6762
       such as SELECT 1 /* + 2. As of MySQL 5.1.23, statements that
 
6763
       contain unclosed /*-comments now are rejected with a syntax
 
6764
       error.
 
6765
       This fix has the potential to cause incompatibilities. Because
 
6766
       of Bug#26302: http://bugs.mysql.com/26302, which caused the
 
6767
       trailing */ to be truncated from comments in views, stored
 
6768
       routines, triggers, and events, it is possible that objects of
 
6769
       those types may have been stored with definitions that now
 
6770
       will be rejected as syntactically invalid. Such objects should
 
6771
       be dropped and re-created so that their definitions do not
 
6772
       contain truncated comments.
7178
6773
 
7179
 
     * Incompatible change: As of MySQL 5.1.8, TYPE =
7180
 
       engine_name is still accepted as a synonym for the ENGINE
7181
 
       = engine_name table option but generates a warning. You
7182
 
       should note that this option is not available in MySQL
7183
 
       5.1.7, and is removed altogether as of MySQL 5.2.5 and
7184
 
       produces a syntax error.
 
6774
     * Incompatible change: As of MySQL 5.1.8, TYPE = engine_name is
 
6775
       still accepted as a synonym for the ENGINE = engine_name table
 
6776
       option but generates a warning. You should note that this
 
6777
       option is not available in MySQL 5.1.7, and is removed
 
6778
       altogether as of MySQL 5.2.5 and produces a syntax error.
7185
6779
       TYPE has been deprecated since MySQL 4.0.
7186
6780
 
7187
 
     * Incompatible change: The namespace for triggers has
7188
 
       changed in MySQL 5.0.10. Previously, trigger names had to
7189
 
       be unique per table. Now they must be unique within the
7190
 
       schema (database). An implication of this change is that
7191
 
       DROP TRIGGER syntax now uses a schema name instead of a
7192
 
       table name (schema name is optional and, if omitted, the
7193
 
       current schema will be used).
7194
 
       When upgrading from a previous version of MySQL 5 to
7195
 
       MySQL 5.0.10 or newer, you must drop all triggers and
7196
 
       re-create them or DROP TRIGGER will not work after the
7197
 
       upgrade. Here is a suggested procedure for doing this:
7198
 
 
7199
 
         1. Upgrade to MySQL 5.0.10 or later to be able to
7200
 
            access trigger information in the
7201
 
            INFORMATION_SCHEMA.TRIGGERS table. (It should work
7202
 
            even for pre-5.0.10 triggers.)
7203
 
 
7204
 
         2. Dump all trigger definitions using the following
7205
 
            SELECT statement:
7206
 
SELECT CONCAT('CREATE TRIGGER ', t.TRIGGER_SCHEMA, '.', t.TRIGGER_NAME
 
6781
     * Incompatible change: The namespace for triggers has changed in
 
6782
       MySQL 5.0.10. Previously, trigger names had to be unique per
 
6783
       table. Now they must be unique within the schema (database).
 
6784
       An implication of this change is that DROP TRIGGER syntax now
 
6785
       uses a schema name instead of a table name (schema name is
 
6786
       optional and, if omitted, the current schema will be used).
 
6787
       When upgrading from a previous version of MySQL 5 to MySQL
 
6788
       5.0.10 or newer, you must drop all triggers and re-create them
 
6789
       or DROP TRIGGER will not work after the upgrade. Here is a
 
6790
       suggested procedure for doing this:
 
6791
 
 
6792
         1. Upgrade to MySQL 5.0.10 or later to be able to access
 
6793
            trigger information in the INFORMATION_SCHEMA.TRIGGERS
 
6794
            table. (It should work even for pre-5.0.10 triggers.)
 
6795
 
 
6796
         2. Dump all trigger definitions using the following SELECT
 
6797
            statement:
 
6798
SELECT CONCAT('CREATE TRIGGER ', t.TRIGGER_SCHEMA, '.', t.TRIGGER_NAM
 
6799
E,
 
6800
              ' ', t.ACTION_TIMING, ' ', t.EVENT_MANIPULATION, ' ON '
7207
6801
,
7208
 
              ' ', t.ACTION_TIMING, ' ', t.EVENT_MANIPULATION, ' ON ',
7209
6802
              t.EVENT_OBJECT_SCHEMA, '.', t.EVENT_OBJECT_TABLE,
7210
6803
              ' FOR EACH ROW ', t.ACTION_STATEMENT, '//' )
7211
6804
INTO OUTFILE '/tmp/triggers.sql'
7212
6805
FROM INFORMATION_SCHEMA.TRIGGERS AS t;
7213
 
 
7214
 
            The statement uses INTO OUTFILE, so you must have
7215
 
            the FILE privilege. The file will be created on the
7216
 
            server host; use a different filename if you like.
7217
 
            To be 100% safe, inspect the trigger definitions in
7218
 
            the triggers.sql file, and perhaps make a backup of
7219
 
            the file.
7220
 
 
7221
 
         3. Stop the server and drop all triggers by removing
7222
 
            all .TRG files in your database directories. Change
7223
 
            location to your data directory and issue this
7224
 
            command:
 
6806
            The statement uses INTO OUTFILE, so you must have the
 
6807
            FILE privilege. The file will be created on the server
 
6808
            host; use a different file name if you like. To be 100%
 
6809
            safe, inspect the trigger definitions in the triggers.sql
 
6810
            file, and perhaps make a backup of the file.
 
6811
 
 
6812
         3. Stop the server and drop all triggers by removing all
 
6813
            .TRG files in your database directories. Change location
 
6814
            to your data directory and issue this command:
7225
6815
shell> rm */*.TRG
7226
6816
 
7227
 
 
7228
 
         4. Start the server and re-create all triggers using
7229
 
            the triggers.sql file: For example in my case it
7230
 
            was:
 
6817
         4. Start the server and re-create all triggers using the
 
6818
            triggers.sql file: For example in my case it was:
7231
6819
mysql> delimiter // ;
7232
6820
mysql> source /tmp/triggers.sql //
7233
6821
 
7234
 
 
7235
 
         5. Check that all triggers were successfully created
7236
 
            using the SHOW TRIGGERS statement.
 
6822
         5. Check that all triggers were successfully created using
 
6823
            the SHOW TRIGGERS statement.
7237
6824
 
7238
6825
     * Incompatible change: MySQL 5.1.6 introduces the TRIGGER
7239
6826
       privilege. Previously, the SUPER privilege was needed to
7240
6827
       create or drop triggers. Now those operations require the
7241
 
       TRIGGER privilege. This is a security improvement because
7242
 
       you no longer need to grant users the SUPER privilege to
7243
 
       enable them to create triggers. However, the requirement
7244
 
       that the account named in a trigger's DEFINER clause must
7245
 
       have the SUPER privilege has changed to a requirement for
7246
 
       the TRIGGER privilege. When upgrading from a previous
7247
 
       version of MySQL 5.0 or 5.1 to MySQL 5.1.6 or newer, be
7248
 
       sure to update your grant tables as described in Section
7249
 
       4.4.8, "mysql_upgrade --- Check Tables for MySQL
7250
 
       Upgrade." This process assigns the TRIGGER privilege to
7251
 
       all accounts that had the SUPER privilege. If you fail to
7252
 
       update the grant tables, triggers may fail when
7253
 
       activated. (After updating the grant tables, you can
7254
 
       revoke the SUPER privilege from those accounts that no
7255
 
       longer otherwise require it.)
 
6828
       TRIGGER privilege. This is a security improvement because you
 
6829
       no longer need to grant users the SUPER privilege to enable
 
6830
       them to create triggers. However, the requirement that the
 
6831
       account named in a trigger's DEFINER clause must have the
 
6832
       SUPER privilege has changed to a requirement for the TRIGGER
 
6833
       privilege. When upgrading from a previous version of MySQL 5.0
 
6834
       or 5.1 to MySQL 5.1.6 or newer, be sure to update your grant
 
6835
       tables as described in Section 4.4.8, "mysql_upgrade --- Check
 
6836
       Tables for MySQL Upgrade." This process assigns the TRIGGER
 
6837
       privilege to all accounts that had the SUPER privilege. If you
 
6838
       fail to update the grant tables, triggers may fail when
 
6839
       activated. (After updating the grant tables, you can revoke
 
6840
       the SUPER privilege from those accounts that no longer
 
6841
       otherwise require it.)
7256
6842
 
7257
 
     * Some keywords are reserved in MySQL 5.1 that were not
7258
 
       reserved in MySQL 5.0. See Section 8.3, "Reserved Words."
 
6843
     * Some keywords are reserved in MySQL 5.1 that were not reserved
 
6844
       in MySQL 5.0. See Section 8.3, "Reserved Words."
7259
6845
 
7260
6846
     * The LOAD DATA FROM MASTER and LOAD TABLE FROM MASTER
7261
 
       statements are deprecated. See Section 12.6.2.2, "LOAD
7262
 
       DATA FROM MASTER Syntax," for recommended alternatives.
 
6847
       statements are deprecated. See Section 12.6.2.2, "LOAD DATA
 
6848
       FROM MASTER Syntax," for recommended alternatives.
7263
6849
 
7264
 
     * The INSTALL PLUGIN and UNINSTALL PLUGIN statements that
7265
 
       are used for the plugin API are new. So is the WITH
7266
 
       PARSER clause for FULLTEXT index creation that associates
7267
 
       a parser plugin with a full-text index. Section 22.2,
7268
 
       "The MySQL Plugin Interface."
 
6850
     * The INSTALL PLUGIN and UNINSTALL PLUGIN statements that are
 
6851
       used for the plugin API are new. So is the WITH PARSER clause
 
6852
       for FULLTEXT index creation that associates a parser plugin
 
6853
       with a full-text index. Section 22.2, "The MySQL Plugin
 
6854
       Interface."
7269
6855
 
7270
6856
   C API Changes:
7271
6857
 
7272
6858
     * Incompatible change: As of MySQL 5.1.7, the
7273
 
       mysql_stmt_attr_get() C API function returns a boolean
7274
 
       rather than an unsigned int for
7275
 
       STMT_ATTR_UPDATE_MAX_LENGTH.
 
6859
       mysql_stmt_attr_get() C API function returns a boolean rather
 
6860
       than an unsigned int for STMT_ATTR_UPDATE_MAX_LENGTH.
7276
6861
       (Bug#16144: http://bugs.mysql.com/16144)
7277
6862
 
7278
 
2.12.2. Copying MySQL Databases to Another Machine
 
6863
2.12.2. Downgrading MySQL
 
6864
 
 
6865
   This section describes what you should do to downgrade to an older
 
6866
   MySQL version in the unlikely case that the previous version
 
6867
   worked better than the new one.
 
6868
 
 
6869
   If you are downgrading within the same release series (for
 
6870
   example, from 5.0.13 to 5.0.12) the general rule is that you just
 
6871
   have to install the new binaries on top of the old ones. There is
 
6872
   no need to do anything with the databases. As always, however, it
 
6873
   is always a good idea to make a backup.
 
6874
 
 
6875
   The following items form a checklist of things you should do
 
6876
   whenever you perform a downgrade:
 
6877
 
 
6878
     * Read the upgrading section for the release series from which
 
6879
       you are downgrading to be sure that it does not have any
 
6880
       features you really need. See Section 2.12.1, "Upgrading
 
6881
       MySQL."
 
6882
 
 
6883
     * If there is a downgrading section for that version, you should
 
6884
       read that as well.
 
6885
 
 
6886
     * To see which new features were added between the version to
 
6887
       which you are downgrading and your current version, see the
 
6888
       change logs (Appendix C, "MySQL Change History").
 
6889
 
 
6890
     * Check Section 2.12.3, "Checking Whether Table Indexes Must Be
 
6891
       Rebuilt," to see whether changes to character sets or
 
6892
       collations were made between your current version of MySQL and
 
6893
       the version to which you are downgrading. If so and these
 
6894
       changes affect your table indexes, you will need to rebuild
 
6895
       the affected indexes using the instructions in Section 2.12.4,
 
6896
       "Rebuilding Tables or Table Indexes."
 
6897
 
 
6898
   In most cases, you can move the MySQL format files and data files
 
6899
   between different versions on the same architecture as long as you
 
6900
   stay within versions for the same release series of MySQL.
 
6901
 
 
6902
   If you downgrade from one release series to another, there may be
 
6903
   incompatibilities in table storage formats. In this case, use
 
6904
   mysqldump to dump your tables before downgrading. After
 
6905
   downgrading, reload the dump file using mysql or mysqlimport to
 
6906
   re-create your tables. For examples, see Section 2.12.5, "Copying
 
6907
   MySQL Databases to Another Machine."
 
6908
 
 
6909
   A typical symptom of a downward-incompatible table format change
 
6910
   when you downgrade is that you cannot open tables. In that case,
 
6911
   use the following procedure:
 
6912
 
 
6913
    1. Stop the older MySQL server that you are downgrading to.
 
6914
 
 
6915
    2. Restart the newer MySQL server you are downgrading from.
 
6916
 
 
6917
    3. Dump any tables that were inaccessible to the older server by
 
6918
       using mysqldump to create a dump file.
 
6919
 
 
6920
    4. Stop the newer MySQL server and restart the older one.
 
6921
 
 
6922
    5. Reload the dump file into the older server. Your tables should
 
6923
       be accessible.
 
6924
 
 
6925
   It might also be the case that the structure of the system tables
 
6926
   in the mysql database has changed and that downgrading introduces
 
6927
   some loss of functionality or requires some adjustments. Here are
 
6928
   some examples:
 
6929
 
 
6930
     * Trigger creation requires the TRIGGER privilege as of MySQL
 
6931
       5.1. In MySQL 5.0, there is no TRIGGER privilege and SUPER is
 
6932
       required instead. If you downgrade from MySQL 5.1 to 5.0, you
 
6933
       will need to give the SUPER privilege to those accounts that
 
6934
       had the TRIGGER privilege in 5.1.
 
6935
 
 
6936
     * Triggers were added in MySQL 5.0, so if you downgrade from 5.0
 
6937
       to 4.1, you cannot use triggers at all.
 
6938
 
 
6939
2.12.2.1. Downgrading to MySQL 5.0
 
6940
 
 
6941
   When downgrading to MySQL 5.0 from MySQL 5.1 or a later version,
 
6942
   you should keep in mind the following issues relating to features
 
6943
   found in MySQL 5.1 and later, but not in MySQL 5.0:
 
6944
 
 
6945
     * Partitioning.  MySQL 5.0 does not support user-defined
 
6946
       partitioning. If a table was created as a partitioned table in
 
6947
       5.1 (or if an table created in a previous version of MySQL was
 
6948
       altered to include partitions after an upgrade to 5.1), the
 
6949
       table is accessible after downgrade only if you do one of the
 
6950
       following:
 
6951
 
 
6952
          + Export the table using mysqldump and then drop it in
 
6953
            MySQL 5.1; import the table again following the downgrade
 
6954
            to MySQL 5.0.
 
6955
 
 
6956
          + Prior to the downgrade, remove the table's partitioning
 
6957
            using ALTER TABLE table_name REMOVE PARTITIONING.
 
6958
 
 
6959
     * Event Scheduler.  MySQL 5.0 does not support scheduled events.
 
6960
       If your databases contain scheduled event definitions, you
 
6961
       should prevent them from being dumped when you use mysqldump
 
6962
       by using the --skip-events option. (See Section 4.5.4,
 
6963
       "mysqldump --- A Database Backup Program.")
 
6964
 
 
6965
     * Stored routines.  MySQL 5.1.21 added a number of new columns
 
6966
       to the mysql.proc table in which stored routine definitions
 
6967
       are stored. If you are downgrading from MySQL 5.1.21 or later
 
6968
       to MySQL 5.0, you cannot import the MySQL 5.1 routine
 
6969
       definitions into MySQL 5.0.46 or earlier using the dump of
 
6970
       mysql.proc created by mysqldump (such as when using the
 
6971
       --all-databases option). Instead, you should run mysqldump
 
6972
       --routines prior to performing the downgrade and run the
 
6973
       stored routines DDL statements following the downgrade.
 
6974
       See Bug#11986: http://bugs.mysql.com/11986,
 
6975
       Bug#30029: http://bugs.mysql.com/30029, and
 
6976
       Bug#30660: http://bugs.mysql.com/30660, for more information.
 
6977
 
 
6978
     * Triggers.  Trigger creation requires the TRIGGER privilege as
 
6979
       of MySQL 5.1. In MySQL 5.0, there is no TRIGGER privilege and
 
6980
       SUPER is required instead. If you downgrade from MySQL 5.1 to
 
6981
       5.0, you will need to give the SUPER privilege to those
 
6982
       accounts that had the TRIGGER privilege in 5.1.
 
6983
 
 
6984
2.12.3. Checking Whether Table Indexes Must Be Rebuilt
 
6985
 
 
6986
   A binary upgrade or downgrade is one that installs one version of
 
6987
   MySQL "in place" over an existing version, without dumping and
 
6988
   reloading tables:
 
6989
 
 
6990
    1. Stop the server for the existing version if it is running.
 
6991
 
 
6992
    2. Install a different version of MySQL. This is an upgrade if
 
6993
       the new version is higher than the original version, a
 
6994
       downgrade if the version is lower.
 
6995
 
 
6996
    3. Start the server for the new version.
 
6997
 
 
6998
   In many cases, the tables from the previous version of MySQL can
 
6999
   be used without change by the new version. However, sometimes
 
7000
   modifications are made to the handling of character sets or
 
7001
   collations that change the character sort order, which causes the
 
7002
   ordering of entries in any index that uses an affected character
 
7003
   set or collation to be incorrect. Such changes result in several
 
7004
   possible problems:
 
7005
 
 
7006
     * Comparison results that differ from previous results
 
7007
 
 
7008
     * Inability to find some index values due to misordered index
 
7009
       entries
 
7010
 
 
7011
     * Misordered ORDER BY results
 
7012
 
 
7013
     * Tables that CHECK TABLE reports as being in need of repair
 
7014
 
 
7015
   The solution to these problems is to rebuild any indexes that use
 
7016
   an affected character set or collation, either by dropping and
 
7017
   re-creating the indexes, or by dumping and reloading the entire
 
7018
   table. For information about rebuilding indexes, see Section
 
7019
   2.12.4, "Rebuilding Tables or Table Indexes."
 
7020
 
 
7021
   To check whether a table has indexes that must be rebuilt, consult
 
7022
   the following list. It indicates which versions of MySQL
 
7023
   introduced character set or collation changes that require indexes
 
7024
   to be rebuilt. Each entry indicates the version in which the
 
7025
   change occurred and the character sets or collations that the
 
7026
   change affects. If the change is associated with a particular bug
 
7027
   report, the bug number is given.
 
7028
 
 
7029
   The list applies both for binary upgrades and downgrades. For
 
7030
   example, Bug#29461: http://bugs.mysql.com/29461 was fixed in MySQL
 
7031
   5.0.48, so it applies to upgrades from versions older than 5.0.48
 
7032
   to 5.0.48 or newer, and also to downgrades from 5.0.48 or newer to
 
7033
   versions older than 5.0.58.
 
7034
 
 
7035
   If you have tables with indexes that are affected, rebuild the
 
7036
   indexes using the instructions given in Section 2.12.4,
 
7037
   "Rebuilding Tables or Table Indexes."
 
7038
 
 
7039
   In many cases, you can use CHECK TABLE ... FOR UPDATE to identify
 
7040
   tables for which index rebuilding is required. (It will report:
 
7041
   Table upgrade required. Please do "REPAIR TABLE `tbl_name`" to fix
 
7042
   it!) In these cases, you can also use mysqlcheck --check-upgrade
 
7043
   or mysql_upgrade, which execute CHECK TABLE. However, the use of
 
7044
   CHECK TABLE applies only after upgrades, not downgrades. Also,
 
7045
   CHECK TABLE is not applicable to all storage engines. For details
 
7046
   about which storage engines CHECK TABLE supports, see Section
 
7047
   12.5.2.3, "CHECK TABLE Syntax."
 
7048
 
 
7049
   Changes that cause index rebuilding to be necessary:
 
7050
 
 
7051
     * MySQL 5.0.48 (Bug#29461: http://bugs.mysql.com/29461)
 
7052
       Affects indexes for columns that use any of these character
 
7053
       sets: eucjpms, euc_kr, gb2312, latin7, macce, ujis
 
7054
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7055
       as of MySQL 5.1.29, 6.0.8 (see
 
7056
       Bug#39585: http://bugs.mysql.com/39585).
 
7057
 
 
7058
     * MySQL 5.0.48 (Bug#27562: http://bugs.mysql.com/27562)
 
7059
       Affects indexes that use the ascii_general_ci collation for
 
7060
       columns that contain any of these characters: '`' GRAVE
 
7061
       ACCENT, '[' LEFT SQUARE BRACKET, '\' REVERSE SOLIDUS, ']'
 
7062
       RIGHT SQUARE BRACKET, '~' TILDE
 
7063
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7064
       as of MySQL 5.1.29, 6.0.8 (see
 
7065
       Bug#39585: http://bugs.mysql.com/39585).
 
7066
 
 
7067
     * MySQL 5.1.21 (Bug#29461: http://bugs.mysql.com/29461)
 
7068
       Affects indexes for columns that use any of these character
 
7069
       sets: eucjpms, euc_kr, gb2312, latin7, macce, ujis
 
7070
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7071
       as of MySQL 5.1.29, 6.0.8 (see
 
7072
       Bug#39585: http://bugs.mysql.com/39585).
 
7073
 
 
7074
     * MySQL 5.1.23 (Bug#27562: http://bugs.mysql.com/27562)
 
7075
       Affects indexes that use the ascii_general_ci collation for
 
7076
       columns that contain any of these characters: '`' GRAVE
 
7077
       ACCENT, '[' LEFT SQUARE BRACKET, '\' REVERSE SOLIDUS, ']'
 
7078
       RIGHT SQUARE BRACKET, '~' TILDE
 
7079
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7080
       as of MySQL 5.1.29, 6.0.8 (see
 
7081
       Bug#39585: http://bugs.mysql.com/39585).
 
7082
 
 
7083
     * MySQL 5.1.24 (Bug#27877: http://bugs.mysql.com/27877)
 
7084
       Affects indexes that use the utf8_general_ci or
 
7085
       ucs2_general_ci collation for columns that contain 'ß' LATIN
 
7086
       SMALL LETTER SHARP S (German).
 
7087
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7088
       as of MySQL 5.1.30, 6.0.8 (see
 
7089
       Bug#40053: http://bugs.mysql.com/40053).
 
7090
 
 
7091
     * * MySQL 6.0.1 (WL#3664)
 
7092
       Affects indexes that use the latin2_czech_cs collation.
 
7093
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7094
       as of MySQL 6.0.9 (see
 
7095
       Bug#40054: http://bugs.mysql.com/40054).
 
7096
       MySQL 6.0.5 (Bug#33452: http://bugs.mysql.com/33452)
 
7097
       Affects indexes that use the latin2_czech_cs collation.
 
7098
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7099
       as of MySQL 6.0.9 (see
 
7100
       Bug#40054: http://bugs.mysql.com/40054).
 
7101
 
 
7102
     * MySQL 6.0.5 (Bug#27877: http://bugs.mysql.com/27877)
 
7103
       Affects indexes that use the utf8_general_ci or
 
7104
       ucs2_general_ci collation for columns that contain 'ß' LATIN
 
7105
       SMALL LETTER SHARP S (German).
 
7106
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7107
       as of MySQL 6.0.8 (see
 
7108
       Bug#40053: http://bugs.mysql.com/40053).
 
7109
 
 
7110
     * MySQL 6.0.6 (Bug#25420: http://bugs.mysql.com/25420)
 
7111
       Affects indexes for columns that use the following collations,
 
7112
       if the columns contain the indicated characters:
 
7113
       big5_chinese_ci: '~' TILDE or '`' GRAVE ACCENT;
 
7114
       cp866_general_ci: j LATIN SMALL LETTER J; gb2312_chinese_ci:
 
7115
       '~' TILDE; gbk_chinese_ci: '~' TILDE
 
7116
       Affected tables can be detected by CHECK TABLE ... FOR UPDATE
 
7117
       as of MySQL 6.0.9 (see
 
7118
       Bug#40054: http://bugs.mysql.com/40054).
 
7119
 
 
7120
2.12.4. Rebuilding Tables or Table Indexes
 
7121
 
 
7122
   This section describes how to rebuild a table. This can be
 
7123
   necessitated by changes to MySQL such as how data types are
 
7124
   handled or changes to character set handling. For example, an
 
7125
   error in a collation might have been corrected, necessitating a
 
7126
   table rebuild to rebuild the indexes for character columns that
 
7127
   use the collation. Methods for rebuilding a table include dumping
 
7128
   and reloading it, or using ALTER TABLE.
 
7129
 
 
7130
Note
 
7131
 
 
7132
   If you are rebuilding tables because a different version of MySQL
 
7133
   will not handle them after a binary upgrade or downgrade, you must
 
7134
   use the dump-and-reload method. Dump the tables before upgrading
 
7135
   or downgrading (using your original version of MySQL), and reload
 
7136
   the tables after upgrading or downgrading (after installing the
 
7137
   new version).
 
7138
 
 
7139
   If you use the dump-and-reload method of rebuilding tables only
 
7140
   for the purpose of rebuilding indexes, you can perform the dump
 
7141
   either before or after upgrading or downgrading. Reloading still
 
7142
   must be done afterward.
 
7143
 
 
7144
   For the examples in this section, suppose that a table t1 is
 
7145
   defined like this:
 
7146
CREATE TABLE t1 (
 
7147
  c1 VARCHAR(10) CHARACTER SET macce,
 
7148
  c2 TEXT CHARACTER SET ujis,
 
7149
  c3 VARCHAR(20) CHARACTER SET latin1,
 
7150
  PRIMARY KEY (c1),
 
7151
  INDEX (c2(20))
 
7152
);
 
7153
 
 
7154
   To re-create a table by dumping and reloading it, use mysqldump to
 
7155
   create a dump file and mysql to reload the file:
 
7156
shell> mysqldump db_name t1 > dump.sql
 
7157
shell> mysql db_name < dump.sql
 
7158
 
 
7159
   To recreate all the tables in a single database, specify the
 
7160
   database name without any following table name:
 
7161
shell> mysqldump db_name > dump.sql
 
7162
shell> mysql db_name < dump.sql
 
7163
 
 
7164
   To recreate all tables in all databases, use the --all-databases
 
7165
   option:
 
7166
shell> mysqldump --all-databases > dump.sql
 
7167
shell> mysql < dump.sql
 
7168
 
 
7169
   To rebuild a table with ALTER TABLE, use a statement that
 
7170
   "changes" the table to use the storage engine that it already has.
 
7171
   For example, if t1 is a MyISAM table, use this statement:
 
7172
mysql> ALTER TABLE t1 ENGINE = MyISAM;
 
7173
 
 
7174
   If you are not sure which storage engine is used for the table,
 
7175
   use SHOW CREATE TABLE to display the table definition.
 
7176
 
 
7177
2.12.5. Copying MySQL Databases to Another Machine
7279
7178
 
7280
7179
   You can copy the .frm, .MYI, and .MYD files for MyISAM tables
7281
7180
   between different architectures that support the same
7282
7181
   floating-point format. (MySQL takes care of any byte-swapping
7283
7182
   issues.) See Section 13.5, "The MyISAM Storage Engine."
7284
7183
 
7285
 
   In cases where you need to transfer databases between
7286
 
   different architectures, you can use mysqldump to create a
7287
 
   file containing SQL statements. You can then transfer the
7288
 
   file to the other machine and feed it as input to the mysql
7289
 
   client.
 
7184
   In cases where you need to transfer databases between different
 
7185
   architectures, you can use mysqldump to create a file containing
 
7186
   SQL statements. You can then transfer the file to the other
 
7187
   machine and feed it as input to the mysql client.
7290
7188
 
7291
 
   Use mysqldump --help to see what options are available. If
7292
 
   you are moving the data to a newer version of MySQL, you
7293
 
   should use mysqldump --opt to take advantage of any
7294
 
   optimizations that result in a dump file that is smaller and
7295
 
   can be processed more quickly.
 
7189
   Use mysqldump --help to see what options are available.
7296
7190
 
7297
7191
   The easiest (although not the fastest) way to move a database
7298
7192
   between two machines is to run the following commands on the
7299
7193
   machine on which the database is located:
7300
7194
shell> mysqladmin -h 'other_hostname' create db_name
7301
 
shell> mysqldump --opt db_name | mysql -h 'other_hostname' db_name
 
7195
shell> mysqldump db_name | mysql -h 'other_hostname' db_name
7302
7196
 
7303
 
   If you want to copy a database from a remote machine over a
7304
 
   slow network, you can use these commands:
 
7197
   If you want to copy a database from a remote machine over a slow
 
7198
   network, you can use these commands:
7305
7199
shell> mysqladmin create db_name
7306
 
shell> mysqldump -h 'other_hostname' --opt --compress db_name | mysql
7307
 
db_name
 
7200
shell> mysqldump -h 'other_hostname' --compress db_name | mysql db_na
 
7201
me
7308
7202
 
7309
 
   You can also store the dump in a file, transfer the file to
7310
 
   the target machine, and then load the file into the database
7311
 
   there. For example, you can dump a database to a compressed
7312
 
   file on the source machine like this:
 
7203
   You can also store the dump in a file, transfer the file to the
 
7204
   target machine, and then load the file into the database there.
 
7205
   For example, you can dump a database to a compressed file on the
 
7206
   source machine like this:
7313
7207
shell> mysqldump --quick db_name | gzip > db_name.gz
7314
7208
 
7315
 
   Transfer the file containing the database contents to the
7316
 
   target machine and run these commands there:
 
7209
   Transfer the file containing the database contents to the target
 
7210
   machine and run these commands there:
7317
7211
shell> mysqladmin create db_name
7318
7212
shell> gunzip < db_name.gz | mysql db_name
7319
7213
 
7320
7214
   You can also use mysqldump and mysqlimport to transfer the
7321
 
   database. For large tables, this is much faster than simply
7322
 
   using mysqldump. In the following commands, DUMPDIR
7323
 
   represents the full pathname of the directory you use to
7324
 
   store the output from mysqldump.
 
7215
   database. For large tables, this is much faster than simply using
 
7216
   mysqldump. In the following commands, DUMPDIR represents the full
 
7217
   path name of the directory you use to store the output from
 
7218
   mysqldump.
7325
7219
 
7326
7220
   First, create the directory for the output files and dump the
7327
7221
   database:
7329
7223
shell> mysqldump --tab=DUMPDIR db_name
7330
7224
 
7331
7225
   Then transfer the files in the DUMPDIR directory to some
7332
 
   corresponding directory on the target machine and load the
7333
 
   files into MySQL there:
 
7226
   corresponding directory on the target machine and load the files
 
7227
   into MySQL there:
7334
7228
shell> mysqladmin create db_name           # create database
7335
 
shell> cat DUMPDIR/*.sql | mysql db_name   # create tables in database
 
7229
shell> cat DUMPDIR/*.sql | mysql db_name   # create tables in databas
 
7230
e
7336
7231
shell> mysqlimport db_name DUMPDIR/*.txt   # load data into tables
7337
7232
 
7338
 
   Do not forget to copy the mysql database because that is
7339
 
   where the grant tables are stored. You might have to run
7340
 
   commands as the MySQL root user on the new machine until you
7341
 
   have the mysql database in place.
7342
 
 
7343
 
   After you import the mysql database on the new machine,
7344
 
   execute mysqladmin flush-privileges so that the server
7345
 
   reloads the grant table information.
7346
 
 
7347
 
2.13. Downgrading MySQL
7348
 
 
7349
 
   This section describes what you should do to downgrade to an
7350
 
   older MySQL version in the unlikely case that the previous
7351
 
   version worked better than the new one.
7352
 
 
7353
 
   If you are downgrading within the same release series (for
7354
 
   example, from 5.0.13 to 5.0.12) the general rule is that you
7355
 
   just have to install the new binaries on top of the old ones.
7356
 
   There is no need to do anything with the databases. As
7357
 
   always, however, it is always a good idea to make a backup.
7358
 
 
7359
 
   The following items form a checklist of things you should do
7360
 
   whenever you perform a downgrade:
7361
 
 
7362
 
     * Read the upgrading section for the release series from
7363
 
       which you are downgrading to be sure that it does not
7364
 
       have any features you really need. See Section 2.12,
7365
 
       "Upgrading MySQL."
7366
 
 
7367
 
     * If there is a downgrading section for that version, you
7368
 
       should read that as well.
7369
 
 
7370
 
     * To see which new features were added between the version
7371
 
       to which you are downgrading and your current version,
7372
 
       see the change logs (Appendix C, "MySQL Change History").
7373
 
 
7374
 
   In most cases, you can move the MySQL format files and data
7375
 
   files between different versions on the same architecture as
7376
 
   long as you stay within versions for the same release series
7377
 
   of MySQL.
7378
 
 
7379
 
   If you downgrade from one release series to another, there
7380
 
   may be incompatibilities in table storage formats. In this
7381
 
   case, use mysqldump to dump your tables before downgrading.
7382
 
   After downgrading, reload the dump file using mysql or
7383
 
   mysqlimport to re-create your tables. For examples, see
7384
 
   Section 2.12.2, "Copying MySQL Databases to Another Machine."
7385
 
 
7386
 
   A typical symptom of a downward-incompatible table format
7387
 
   change when you downgrade is that you cannot open tables. In
7388
 
   that case, use the following procedure:
7389
 
 
7390
 
    1. Stop the older MySQL server that you are downgrading to.
7391
 
 
7392
 
    2. Restart the newer MySQL server you are downgrading from.
7393
 
 
7394
 
    3. Dump any tables that were inaccessible to the older
7395
 
       server by using mysqldump to create a dump file.
7396
 
 
7397
 
    4. Stop the newer MySQL server and restart the older one.
7398
 
 
7399
 
    5. Reload the dump file into the older server. Your tables
7400
 
       should be accessible.
7401
 
 
7402
 
   It might also be the case that the structure of the system
7403
 
   tables in the mysql database has changed and that downgrading
7404
 
   introduces some loss of functionality or requires some
7405
 
   adjustments. Here are some examples:
7406
 
 
7407
 
     * Trigger creation requires the TRIGGER privilege as of
7408
 
       MySQL 5.1. In MySQL 5.0, there is no TRIGGER privilege
7409
 
       and SUPER is required instead. If you downgrade from
7410
 
       MySQL 5.1 to 5.0, you will need to give the SUPER
7411
 
       privilege to those accounts that had the TRIGGER
7412
 
       privilege in 5.1.
7413
 
 
7414
 
     * Triggers were added in MySQL 5.0, so if you downgrade
7415
 
       from 5.0 to 4.1, you cannot use triggers at all.
7416
 
 
7417
 
2.13.1. Downgrading to MySQL 5.0
7418
 
 
7419
 
   When downgrading to MySQL 5.0 from MySQL 5.1 or a later
7420
 
   version, you should keep in mind the following issues
7421
 
   relating to features found in MySQL 5.1 and later, but not in
7422
 
   MySQL 5.0:
7423
 
 
7424
 
     * Event Scheduler.  MySQL 5.0 does not support scheduled
7425
 
       events. If your databases contain scheduled event
7426
 
       definitions, you should prevent them from being dumped
7427
 
       when you use mysqldump by using the --skip-events option.
7428
 
       (See Section 4.5.4, "mysqldump --- A Database Backup
7429
 
       Program.")
7430
 
 
7431
 
     * Partitioning.  MySQL 5.0 does not support user-defined
7432
 
       partitioning. If a table was created as a partitioned
7433
 
       table in 5.1 (or if an table created in a previous
7434
 
       version of MySQL was altered to include partitions after
7435
 
       an upgrade to 5.1), the table is accessible after
7436
 
       downgrade only if you do one of the following:
7437
 
 
7438
 
          + Export the table using mysqldump and then drop it in
7439
 
            MySQL 5.1; import the table again following the
7440
 
            downgrade to MySQL 5.0.
7441
 
 
7442
 
          + Prior to the downgrade, remove the table's
7443
 
            partitioning using ALTER TABLE table_name REMOVE
7444
 
            PARTITIONING.
7445
 
 
7446
 
     * Stored routines.  MySQL 5.1.21 added a number of new
7447
 
       columns to the mysql.proc table in which stored routine
7448
 
       definitions are stored. If you are downgrading from MySQL
7449
 
       5.1.21 or later to MySQL 5.0, you cannot import the MySQL
7450
 
       5.1 routine definitions into MySQL 5.0.46 or earlier
7451
 
       using the dump of mysql.proc created by mysqldump (such
7452
 
       as when using the --all-databases option). Instead, you
7453
 
       should run mysqldump --routines prior to performing the
7454
 
       downgrade and run the stored routines DDL statements
7455
 
       following the downgrade.
7456
 
       See Bug#11986: http://bugs.mysql.com/11986,
7457
 
       Bug#30029: http://bugs.mysql.com/30029, and
7458
 
       Bug#30660: http://bugs.mysql.com/30660, for more
7459
 
       information.
7460
 
 
7461
 
2.14. Operating System-Specific Notes
7462
 
 
7463
 
2.14.1. Linux Notes
7464
 
 
7465
 
   This section discusses issues that have been found to occur
7466
 
   on Linux. The first few subsections describe general
7467
 
   operating system-related issues, problems that can occur when
7468
 
   using binary or source distributions, and post-installation
7469
 
   issues. The remaining subsections discuss problems that occur
7470
 
   with Linux on specific platforms.
7471
 
 
7472
 
   Note that most of these problems occur on older versions of
7473
 
   Linux. If you are running a recent version, you may see none
7474
 
   of them.
7475
 
 
7476
 
2.14.1.1. Linux Operating System Notes
 
7233
   Do not forget to copy the mysql database because that is where the
 
7234
   grant tables are stored. You might have to run commands as the
 
7235
   MySQL root user on the new machine until you have the mysql
 
7236
   database in place.
 
7237
 
 
7238
   After you import the mysql database on the new machine, execute
 
7239
   mysqladmin flush-privileges so that the server reloads the grant
 
7240
   table information.
 
7241
 
 
7242
2.13. Operating System-Specific Notes
 
7243
 
 
7244
2.13.1. Linux Notes
 
7245
 
 
7246
   This section discusses issues that have been found to occur on
 
7247
   Linux. The first few subsections describe general operating
 
7248
   system-related issues, problems that can occur when using binary
 
7249
   or source distributions, and post-installation issues. The
 
7250
   remaining subsections discuss problems that occur with Linux on
 
7251
   specific platforms.
 
7252
 
 
7253
   Note that most of these problems occur on older versions of Linux.
 
7254
   If you are running a recent version, you may see none of them.
 
7255
 
 
7256
2.13.1.1. Linux Operating System Notes
7477
7257
 
7478
7258
   MySQL needs at least Linux version 2.0.
7479
7259
 
7480
7260
Warning
7481
7261
 
7482
 
   We have seen some strange problems with Linux 2.2.14 and
7483
 
   MySQL on SMP systems. We also have reports from some MySQL
7484
 
   users that they have encountered serious stability problems
7485
 
   using MySQL with kernel 2.2.14. If you are using this kernel,
7486
 
   you should upgrade to 2.2.19 (or newer) or to a 2.4 kernel.
7487
 
   If you have a multiple-CPU box, you should seriously consider
7488
 
   using 2.4 because it gives you a significant speed boost.
7489
 
   Your system should be more stable.
7490
 
 
7491
 
   When using LinuxThreads, you should see a minimum of three
7492
 
   mysqld processes running. These are in fact threads. There is
7493
 
   one thread for the LinuxThreads manager, one thread to handle
7494
 
   connections, and one thread to handle alarms and signals.
7495
 
 
7496
 
2.14.1.2. Linux Binary Distribution Notes
7497
 
 
7498
 
   The Linux-Intel binary and RPM releases of MySQL are
7499
 
   configured for the highest possible speed. We are always
7500
 
   trying to use the fastest stable compiler available.
7501
 
 
7502
 
   The binary release is linked with -static, which means you do
7503
 
   not normally need to worry about which version of the system
7504
 
   libraries you have. You need not install LinuxThreads,
7505
 
   either. A program linked with -static is slightly larger than
7506
 
   a dynamically linked program, but also slightly faster
7507
 
   (3-5%). However, one problem with a statically linked program
7508
 
   is that you can't use user-defined functions (UDFs). If you
7509
 
   are going to write or use UDFs (this is something for C or
7510
 
   C++ programmers only), you must compile MySQL yourself using
7511
 
   dynamic linking.
7512
 
 
7513
 
   A known issue with binary distributions is that on older
7514
 
   Linux systems that use libc (such as Red Hat 4.x or
7515
 
   Slackware), you get some (non-fatal) issues with hostname
7516
 
   resolution. If your system uses libc rather than glibc2, you
7517
 
   probably will encounter some difficulties with hostname
7518
 
   resolution and getpwnam(). This happens because glibc
7519
 
   (unfortunately) depends on some external libraries to
7520
 
   implement hostname resolution and getpwent(), even when
7521
 
   compiled with -static. These problems manifest themselves in
 
7262
   We have seen some strange problems with Linux 2.2.14 and MySQL on
 
7263
   SMP systems. We also have reports from some MySQL users that they
 
7264
   have encountered serious stability problems using MySQL with
 
7265
   kernel 2.2.14. If you are using this kernel, you should upgrade to
 
7266
   2.2.19 (or newer) or to a 2.4 kernel. If you have a multiple-CPU
 
7267
   box, you should seriously consider using 2.4 because it gives you
 
7268
   a significant speed boost. Your system should be more stable.
 
7269
 
 
7270
   When using LinuxThreads, you should see a minimum of three mysqld
 
7271
   processes running. These are in fact threads. There is one thread
 
7272
   for the LinuxThreads manager, one thread to handle connections,
 
7273
   and one thread to handle alarms and signals.
 
7274
 
 
7275
2.13.1.2. Linux Binary Distribution Notes
 
7276
 
 
7277
   The Linux-Intel binary and RPM releases of MySQL are configured
 
7278
   for the highest possible speed. We are always trying to use the
 
7279
   fastest stable compiler available.
 
7280
 
 
7281
   The binary release is linked with -static, which means you do not
 
7282
   normally need to worry about which version of the system libraries
 
7283
   you have. You need not install LinuxThreads, either. A program
 
7284
   linked with -static is slightly larger than a dynamically linked
 
7285
   program, but also slightly faster (3-5%). However, one problem
 
7286
   with a statically linked program is that you can't use
 
7287
   user-defined functions (UDFs). If you are going to write or use
 
7288
   UDFs (this is something for C or C++ programmers only), you must
 
7289
   compile MySQL yourself using dynamic linking.
 
7290
 
 
7291
   A known issue with binary distributions is that on older Linux
 
7292
   systems that use libc (such as Red Hat 4.x or Slackware), you get
 
7293
   some (non-fatal) issues with host name resolution. If your system
 
7294
   uses libc rather than glibc2, you probably will encounter some
 
7295
   difficulties with host name resolution and getpwnam(). This
 
7296
   happens because glibc (unfortunately) depends on some external
 
7297
   libraries to implement host name resolution and getpwent(), even
 
7298
   when compiled with -static. These problems manifest themselves in
7522
7299
   two ways:
7523
7300
 
7524
7301
     * You may see the following error message when you run
7525
7302
       mysql_install_db:
7526
7303
Sorry, the host 'xxxx' could not be looked up
7527
 
 
7528
 
       You can deal with this by executing mysql_install_db
7529
 
       --force, which does not execute the resolveip test in
7530
 
       mysql_install_db. The downside is that you cannot use
7531
 
       hostnames in the grant tables: except for localhost, you
7532
 
       must use IP numbers instead. If you are using an old
7533
 
       version of MySQL that does not support --force, you must
7534
 
       manually remove the resolveip test in mysql_install_db
7535
 
       using a text editor.
 
7304
       You can deal with this by executing mysql_install_db --force,
 
7305
       which does not execute the resolveip test in mysql_install_db.
 
7306
       The downside is that you cannot use host names in the grant
 
7307
       tables: except for localhost, you must use IP numbers instead.
 
7308
       If you are using an old version of MySQL that does not support
 
7309
       --force, you must manually remove the resolveip test in
 
7310
       mysql_install_db using a text editor.
7536
7311
 
7537
7312
     * You also may see the following error when you try to run
7538
7313
       mysqld with the --user option:
7539
7314
getpwnam: No such file or directory
7540
 
 
7541
7315
       To work around this problem, start mysqld by using the su
7542
7316
       command rather than by specifying the --user option. This
7543
 
       causes the system itself to change the user ID of the
7544
 
       mysqld process so that mysqld need not do so.
 
7317
       causes the system itself to change the user ID of the mysqld
 
7318
       process so that mysqld need not do so.
7545
7319
 
7546
7320
   Another solution, which solves both problems, is not to use a
7547
 
   binary distribution. Obtain a MySQL source distribution (in
7548
 
   RPM or tar.gz format) and install that instead.
 
7321
   binary distribution. Obtain a MySQL source distribution (in RPM or
 
7322
   tar.gz format) and install that instead.
7549
7323
 
7550
7324
   On some Linux 2.2 versions, you may get the error Resource
7551
7325
   temporarily unavailable when clients make a great many new
7552
 
   connections to a mysqld server over TCP/IP. The problem is
7553
 
   that Linux has a delay between the time that you close a
7554
 
   TCP/IP socket and the time that the system actually frees it.
7555
 
   There is room for only a finite number of TCP/IP slots, so
7556
 
   you encounter the resource-unavailable error if clients
7557
 
   attempt too many new TCP/IP connections over a short period
7558
 
   of time. For example, you may see the error when you run the
7559
 
   MySQL test-connect benchmark over TCP/IP.
7560
 
 
7561
 
   We have inquired about this problem a few times on different
7562
 
   Linux mailing lists but have never been able to find a
7563
 
   suitable resolution. The only known "fix" is for clients to
7564
 
   use persistent connections, or, if you are running the
7565
 
   database server and clients on the same machine, to use Unix
7566
 
   socket file connections rather than TCP/IP connections.
7567
 
 
7568
 
2.14.1.3. Linux Source Distribution Notes
7569
 
 
7570
 
   The following notes regarding glibc apply only to the
7571
 
   situation when you build MySQL yourself. If you are running
7572
 
   Linux on an x86 machine, in most cases it is much better for
7573
 
   you to use our binary. We link our binaries against the best
7574
 
   patched version of glibc we can find and with the best
7575
 
   compiler options, in an attempt to make it suitable for a
7576
 
   high-load server. For a typical user, even for setups with a
7577
 
   lot of concurrent connections or tables exceeding the 2GB
7578
 
   limit, our binary is the best choice in most cases. After
7579
 
   reading the following text, if you are in doubt about what to
7580
 
   do, try our binary first to determine whether it meets your
7581
 
   needs. If you discover that it is not good enough, you may
7582
 
   want to try your own build. In that case, we would appreciate
7583
 
   a note about it so that we can build a better binary next
7584
 
   time.
7585
 
 
7586
 
   MySQL uses LinuxThreads on Linux. If you are using an old
7587
 
   Linux version that doesn't have glibc2, you must install
7588
 
   LinuxThreads before trying to compile MySQL. You can obtain
7589
 
   LinuxThreads from
 
7326
   connections to a mysqld server over TCP/IP. The problem is that
 
7327
   Linux has a delay between the time that you close a TCP/IP socket
 
7328
   and the time that the system actually frees it. There is room for
 
7329
   only a finite number of TCP/IP slots, so you encounter the
 
7330
   resource-unavailable error if clients attempt too many new TCP/IP
 
7331
   connections over a short period of time. For example, you may see
 
7332
   the error when you run the MySQL test-connect benchmark over
 
7333
   TCP/IP.
 
7334
 
 
7335
   We have inquired about this problem a few times on different Linux
 
7336
   mailing lists but have never been able to find a suitable
 
7337
   resolution. The only known "fix" is for clients to use persistent
 
7338
   connections, or, if you are running the database server and
 
7339
   clients on the same machine, to use Unix socket file connections
 
7340
   rather than TCP/IP connections.
 
7341
 
 
7342
2.13.1.3. Linux Source Distribution Notes
 
7343
 
 
7344
   The following notes regarding glibc apply only to the situation
 
7345
   when you build MySQL yourself. If you are running Linux on an x86
 
7346
   machine, in most cases it is much better for you to use our
 
7347
   binary. We link our binaries against the best patched version of
 
7348
   glibc we can find and with the best compiler options, in an
 
7349
   attempt to make it suitable for a high-load server. For a typical
 
7350
   user, even for setups with a lot of concurrent connections or
 
7351
   tables exceeding the 2GB limit, our binary is the best choice in
 
7352
   most cases. After reading the following text, if you are in doubt
 
7353
   about what to do, try our binary first to determine whether it
 
7354
   meets your needs. If you discover that it is not good enough, you
 
7355
   may want to try your own build. In that case, we would appreciate
 
7356
   a note about it so that we can build a better binary next time.
 
7357
 
 
7358
   MySQL uses LinuxThreads on Linux. If you are using an old Linux
 
7359
   version that doesn't have glibc2, you must install LinuxThreads
 
7360
   before trying to compile MySQL. You can obtain LinuxThreads from
7590
7361
   http://dev.mysql.com/downloads/os-linux.html.
7591
7362
 
7592
 
   Note that glibc versions before and including version 2.1.1
7593
 
   have a fatal bug in pthread_mutex_timedwait() handling, which
7594
 
   is used when INSERT DELAYED statements are issued. We
7595
 
   recommend that you not use INSERT DELAYED before upgrading
7596
 
   glibc.
 
7363
   Note that glibc versions before and including version 2.1.1 have a
 
7364
   fatal bug in pthread_mutex_timedwait() handling, which is used
 
7365
   when INSERT DELAYED statements are issued. We recommend that you
 
7366
   not use INSERT DELAYED before upgrading glibc.
7597
7367
 
7598
 
   Note that Linux kernel and the LinuxThread library can by
7599
 
   default handle a maximum of 1,024 threads. If you plan to
7600
 
   have more than 1,000 concurrent connections, you need to make
7601
 
   some changes to LinuxThreads, as follows:
 
7368
   Note that Linux kernel and the LinuxThread library can by default
 
7369
   handle a maximum of 1,024 threads. If you plan to have more than
 
7370
   1,000 concurrent connections, you need to make some changes to
 
7371
   LinuxThreads, as follows:
7602
7372
 
7603
7373
     * Increase PTHREAD_THREADS_MAX in
7604
 
       sysdeps/unix/sysv/linux/bits/local_lim.h to 4096 and
7605
 
       decrease STACK_SIZE in linuxthreads/internals.h to 256KB.
7606
 
       The paths are relative to the root of glibc. (Note that
7607
 
       MySQL is not stable with 600-1000 connections if
7608
 
       STACK_SIZE is the default of 2MB.)
 
7374
       sysdeps/unix/sysv/linux/bits/local_lim.h to 4096 and decrease
 
7375
       STACK_SIZE in linuxthreads/internals.h to 256KB. The paths are
 
7376
       relative to the root of glibc. (Note that MySQL is not stable
 
7377
       with 600-1000 connections if STACK_SIZE is the default of
 
7378
       2MB.)
7609
7379
 
7610
 
     * Recompile LinuxThreads to produce a new libpthread.a
7611
 
       library, and relink MySQL against it.
 
7380
     * Recompile LinuxThreads to produce a new libpthread.a library,
 
7381
       and relink MySQL against it.
7612
7382
 
7613
7383
   There is another issue that greatly hurts MySQL performance,
7614
7384
   especially on SMP systems. The mutex implementation in
7615
7385
   LinuxThreads in glibc 2.1 is very poor for programs with many
7616
 
   threads that hold the mutex only for a short time. This
7617
 
   produces a paradoxical result: If you link MySQL against an
7618
 
   unmodified LinuxThreads, removing processors from an SMP
7619
 
   actually improves MySQL performance in many cases. We have
7620
 
   made a patch available for glibc 2.1.3 to correct this
7621
 
   behavior
7622
 
   (http://dev.mysql.com/Downloads/Linux/linuxthreads-2.1-patch)
7623
 
   .
7624
 
 
7625
 
   With glibc 2.2.2, MySQL uses the adaptive mutex, which is
7626
 
   much better than even the patched one in glibc 2.1.3. Be
7627
 
   warned, however, that under some conditions, the current
7628
 
   mutex code in glibc 2.2.2 overspins, which hurts MySQL
7629
 
   performance. The likelihood that this condition occurs can be
7630
 
   reduced by re-nicing the mysqld process to the highest
7631
 
   priority. We have also been able to correct the overspin
7632
 
   behavior with a patch, available at
7633
 
   http://dev.mysql.com/Downloads/Linux/linuxthreads-2.2.2.patch
7634
 
   . It combines the correction of overspin, maximum number of
7635
 
   threads, and stack spacing all in one. You need to apply it
7636
 
   in the linuxthreads directory with patch -p0
7637
 
   </tmp/linuxthreads-2.2.2.patch. We hope it is included in
7638
 
   some form in future releases of glibc 2.2. In any case, if
7639
 
   you link against glibc 2.2.2, you still need to correct
7640
 
   STACK_SIZE and PTHREAD_THREADS_MAX. We hope that the defaults
7641
 
   is corrected to some more acceptable values for high-load
7642
 
   MySQL setup in the future, so that the commands needed to
7643
 
   produce your own build can be reduced to ./configure; make;
7644
 
   make install.
7645
 
 
7646
 
   We recommend that you use these patches to build a special
7647
 
   static version of libpthread.a and use it only for statically
7648
 
   linking against MySQL. We know that these patches are safe
7649
 
   for MySQL and significantly improve its performance, but we
7650
 
   cannot say anything about their effects on other
7651
 
   applications. If you link other applications that require
7652
 
   LinuxThreads against the patched static version of the
7653
 
   library, or build a patched shared version and install it on
7654
 
   your system, you do so at your own risk.
7655
 
 
7656
 
   If you experience any strange problems during the
7657
 
   installation of MySQL, or with some common utilities hanging,
7658
 
   it is very likely that they are either library or compiler
7659
 
   related. If this is the case, using our binary resolves them.
 
7386
   threads that hold the mutex only for a short time. This produces a
 
7387
   paradoxical result: If you link MySQL against an unmodified
 
7388
   LinuxThreads, removing processors from an SMP actually improves
 
7389
   MySQL performance in many cases. We have made a patch available
 
7390
   for glibc 2.1.3 to correct this behavior
 
7391
   (http://dev.mysql.com/Downloads/Linux/linuxthreads-2.1-patch).
 
7392
 
 
7393
   With glibc 2.2.2, MySQL uses the adaptive mutex, which is much
 
7394
   better than even the patched one in glibc 2.1.3. Be warned,
 
7395
   however, that under some conditions, the current mutex code in
 
7396
   glibc 2.2.2 overspins, which hurts MySQL performance. The
 
7397
   likelihood that this condition occurs can be reduced by re-nicing
 
7398
   the mysqld process to the highest priority. We have also been able
 
7399
   to correct the overspin behavior with a patch, available at
 
7400
   http://dev.mysql.com/Downloads/Linux/linuxthreads-2.2.2.patch. It
 
7401
   combines the correction of overspin, maximum number of threads,
 
7402
   and stack spacing all in one. You need to apply it in the
 
7403
   linuxthreads directory with patch -p0
 
7404
   </tmp/linuxthreads-2.2.2.patch. We hope it is included in some
 
7405
   form in future releases of glibc 2.2. In any case, if you link
 
7406
   against glibc 2.2.2, you still need to correct STACK_SIZE and
 
7407
   PTHREAD_THREADS_MAX. We hope that the defaults is corrected to
 
7408
   some more acceptable values for high-load MySQL setup in the
 
7409
   future, so that the commands needed to produce your own build can
 
7410
   be reduced to ./configure; make; make install.
 
7411
 
 
7412
   We recommend that you use these patches to build a special static
 
7413
   version of libpthread.a and use it only for statically linking
 
7414
   against MySQL. We know that these patches are safe for MySQL and
 
7415
   significantly improve its performance, but we cannot say anything
 
7416
   about their effects on other applications. If you link other
 
7417
   applications that require LinuxThreads against the patched static
 
7418
   version of the library, or build a patched shared version and
 
7419
   install it on your system, you do so at your own risk.
 
7420
 
 
7421
   If you experience any strange problems during the installation of
 
7422
   MySQL, or with some common utilities hanging, it is very likely
 
7423
   that they are either library or compiler related. If this is the
 
7424
   case, using our binary resolves them.
7660
7425
 
7661
7426
   If you link your own MySQL client programs, you may see the
7662
7427
   following error at runtime:
7665
7430
 
7666
7431
   This problem can be avoided by one of the following methods:
7667
7432
 
7668
 
     * Link clients with the
7669
 
       -Wl,r/full/path/to/libmysqlclient.so flag rather than
7670
 
       with -Lpath).
 
7433
     * Link clients with the -Wl,r/full/path/to/libmysqlclient.so
 
7434
       flag rather than with -Lpath).
7671
7435
 
7672
7436
     * Copy libmysqclient.so to /usr/lib.
7673
7437
 
7674
 
     * Add the pathname of the directory where libmysqlclient.so
7675
 
       is located to the LD_RUN_PATH environment variable before
7676
 
       running your client.
 
7438
     * Add the path name of the directory where libmysqlclient.so is
 
7439
       located to the LD_RUN_PATH environment variable before running
 
7440
       your client.
7677
7441
 
7678
 
   If you are using the Fujitsu compiler (fcc/FCC), you may have
7679
 
   some problems compiling MySQL because the Linux header files
7680
 
   are very gcc oriented. The following configure line should
7681
 
   work with fcc/FCC:
 
7442
   If you are using the Fujitsu compiler (fcc/FCC), you may have some
 
7443
   problems compiling MySQL because the Linux header files are very
 
7444
   gcc oriented. The following configure line should work with
 
7445
   fcc/FCC:
7682
7446
CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE \
7683
7447
    -DCONST=const -DNO_STRTOLL_PROTO" \
7684
7448
CXX=FCC CXXFLAGS="-O -K fast -K lib \
7690
7454
    --with-mysqld-ldflags=-all-static --disable-shared \
7691
7455
    --with-low-memory
7692
7456
 
7693
 
2.14.1.4. Linux Post-Installation Notes
7694
 
 
7695
 
   mysql.server can be found in the support-files directory
7696
 
   under the MySQL installation directory or in a MySQL source
7697
 
   tree. You can install it as /etc/init.d/mysql for automatic
7698
 
   MySQL startup and shutdown. See Section 2.11.2.2, "Starting
7699
 
   and Stopping MySQL Automatically."
7700
 
 
7701
 
   If MySQL cannot open enough files or connections, it may be
7702
 
   that you have not configured Linux to handle enough files.
7703
 
 
7704
 
   In Linux 2.2 and onward, you can check the number of
7705
 
   allocated file handles as follows:
 
7457
2.13.1.4. Linux Post-Installation Notes
 
7458
 
 
7459
   mysql.server can be found in the support-files directory under the
 
7460
   MySQL installation directory or in a MySQL source tree. You can
 
7461
   install it as /etc/init.d/mysql for automatic MySQL startup and
 
7462
   shutdown. See Section 2.11.2.2, "Starting and Stopping MySQL
 
7463
   Automatically."
 
7464
 
 
7465
   If MySQL cannot open enough files or connections, it may be that
 
7466
   you have not configured Linux to handle enough files.
 
7467
 
 
7468
   In Linux 2.2 and onward, you can check the number of allocated
 
7469
   file handles as follows:
7706
7470
shell> cat /proc/sys/fs/file-max
7707
7471
shell> cat /proc/sys/fs/dquot-max
7708
7472
shell> cat /proc/sys/fs/super-max
7709
7473
 
7710
 
   If you have more than 16MB of memory, you should add
7711
 
   something like the following to your init scripts (for
7712
 
   example, /etc/init.d/boot.local on SuSE Linux):
 
7474
   If you have more than 16MB of memory, you should add something
 
7475
   like the following to your init scripts (for example,
 
7476
   /etc/init.d/boot.local on SuSE Linux):
7713
7477
echo 65536 > /proc/sys/fs/file-max
7714
7478
echo 8192 > /proc/sys/fs/dquot-max
7715
7479
echo 1024 > /proc/sys/fs/super-max
7716
7480
 
7717
 
   You can also run the echo commands from the command line as
7718
 
   root, but these settings are lost the next time your computer
7719
 
   restarts.
 
7481
   You can also run the echo commands from the command line as root,
 
7482
   but these settings are lost the next time your computer restarts.
7720
7483
 
7721
 
   Alternatively, you can set these parameters on startup by
7722
 
   using the sysctl tool, which is used by many Linux
7723
 
   distributions (including SuSE Linux 8.0 and later). Put the
7724
 
   following values into a file named /etc/sysctl.conf:
 
7484
   Alternatively, you can set these parameters on startup by using
 
7485
   the sysctl tool, which is used by many Linux distributions
 
7486
   (including SuSE Linux 8.0 and later). Put the following values
 
7487
   into a file named /etc/sysctl.conf:
7725
7488
# Increase some values for MySQL
7726
7489
fs.file-max = 65536
7727
7490
fs.dquot-max = 8192
7731
7494
[mysqld_safe]
7732
7495
open-files-limit=8192
7733
7496
 
7734
 
   This should allow the server a limit of 8,192 for the
7735
 
   combined number of connections and open files.
 
7497
   This should allow the server a limit of 8,192 for the combined
 
7498
   number of connections and open files.
7736
7499
 
7737
 
   The STACK_SIZE constant in LinuxThreads controls the spacing
7738
 
   of thread stacks in the address space. It needs to be large
7739
 
   enough so that there is plenty of room for each individual
7740
 
   thread stack, but small enough to keep the stack of some
7741
 
   threads from running into the global mysqld data.
7742
 
   Unfortunately, as we have experimentally discovered, the
7743
 
   Linux implementation of mmap() successfully unmaps a mapped
7744
 
   region if you ask it to map out an address currently in use,
7745
 
   zeroing out the data on the entire page instead of returning
 
7500
   The STACK_SIZE constant in LinuxThreads controls the spacing of
 
7501
   thread stacks in the address space. It needs to be large enough so
 
7502
   that there is plenty of room for each individual thread stack, but
 
7503
   small enough to keep the stack of some threads from running into
 
7504
   the global mysqld data. Unfortunately, as we have experimentally
 
7505
   discovered, the Linux implementation of mmap() successfully unmaps
 
7506
   a mapped region if you ask it to map out an address currently in
 
7507
   use, zeroing out the data on the entire page instead of returning
7746
7508
   an error. So, the safety of mysqld or any other threaded
7747
 
   application depends on the "gentlemanly" behavior of the code
7748
 
   that creates threads. The user must take measures to make
7749
 
   sure that the number of running threads at any given time is
7750
 
   sufficiently low for thread stacks to stay away from the
7751
 
   global heap. With mysqld, you should enforce this behavior by
7752
 
   setting a reasonable value for the max_connections variable.
7753
 
 
7754
 
   If you build MySQL yourself, you can patch LinuxThreads for
7755
 
   better stack use. See Section 2.14.1.3, "Linux Source
7756
 
   Distribution Notes." If you do not want to patch
7757
 
   LinuxThreads, you should set max_connections to a value no
7758
 
   higher than 500. It should be even less if you have a large
7759
 
   key buffer, large heap tables, or some other things that make
7760
 
   mysqld allocate a lot of memory, or if you are running a 2.2
7761
 
   kernel with a 2GB patch. If you are using our binary or RPM
7762
 
   version, you can safely set max_connections at 1500, assuming
7763
 
   no large key buffer or heap tables with lots of data. The
7764
 
   more you reduce STACK_SIZE in LinuxThreads the more threads
7765
 
   you can safely create. We recommend values between 128KB and
7766
 
   256KB.
7767
 
 
7768
 
   If you use a lot of concurrent connections, you may suffer
7769
 
   from a "feature" in the 2.2 kernel that attempts to prevent
7770
 
   fork bomb attacks by penalizing a process for forking or
7771
 
   cloning a child. This causes MySQL not to scale well as you
7772
 
   increase the number of concurrent clients. On single-CPU
7773
 
   systems, we have seen this manifest as very slow thread
7774
 
   creation; it may take a long time to connect to MySQL (as
7775
 
   long as one minute), and it may take just as long to shut it
7776
 
   down. On multiple-CPU systems, we have observed a gradual
7777
 
   drop in query speed as the number of clients increases. In
 
7509
   application depends on the "gentlemanly" behavior of the code that
 
7510
   creates threads. The user must take measures to make sure that the
 
7511
   number of running threads at any given time is sufficiently low
 
7512
   for thread stacks to stay away from the global heap. With mysqld,
 
7513
   you should enforce this behavior by setting a reasonable value for
 
7514
   the max_connections variable.
 
7515
 
 
7516
   If you build MySQL yourself, you can patch LinuxThreads for better
 
7517
   stack use. See Section 2.13.1.3, "Linux Source Distribution
 
7518
   Notes." If you do not want to patch LinuxThreads, you should set
 
7519
   max_connections to a value no higher than 500. It should be even
 
7520
   less if you have a large key buffer, large heap tables, or some
 
7521
   other things that make mysqld allocate a lot of memory, or if you
 
7522
   are running a 2.2 kernel with a 2GB patch. If you are using our
 
7523
   binary or RPM version, you can safely set max_connections at 1500,
 
7524
   assuming no large key buffer or heap tables with lots of data. The
 
7525
   more you reduce STACK_SIZE in LinuxThreads the more threads you
 
7526
   can safely create. We recommend values between 128KB and 256KB.
 
7527
 
 
7528
   If you use a lot of concurrent connections, you may suffer from a
 
7529
   "feature" in the 2.2 kernel that attempts to prevent fork bomb
 
7530
   attacks by penalizing a process for forking or cloning a child.
 
7531
   This causes MySQL not to scale well as you increase the number of
 
7532
   concurrent clients. On single-CPU systems, we have seen this
 
7533
   manifest as very slow thread creation; it may take a long time to
 
7534
   connect to MySQL (as long as one minute), and it may take just as
 
7535
   long to shut it down. On multiple-CPU systems, we have observed a
 
7536
   gradual drop in query speed as the number of clients increases. In
7778
7537
   the process of trying to find a solution, we have received a
7779
 
   kernel patch from one of our users who claimed it helped for
7780
 
   his site. This patch is available at
7781
 
   http://dev.mysql.com/Downloads/Patches/linux-fork.patch. We
7782
 
   have done rather extensive testing of this patch on both
7783
 
   development and production systems. It has significantly
7784
 
   improved MySQL performance without causing any problems and
7785
 
   we recommend it to our users who still run high-load servers
7786
 
   on 2.2 kernels.
7787
 
 
7788
 
   This issue has been fixed in the 2.4 kernel, so if you are
7789
 
   not satisfied with the current performance of your system,
7790
 
   rather than patching your 2.2 kernel, it might be easier to
7791
 
   upgrade to 2.4. On SMP systems, upgrading also gives you a
7792
 
   nice SMP boost in addition to fixing the fairness bug.
7793
 
 
7794
 
   We have tested MySQL on the 2.4 kernel on a two-CPU machine
7795
 
   and found MySQL scales much better. There was virtually no
7796
 
   slowdown on query throughput all the way up to 1,000 clients,
7797
 
   and the MySQL scaling factor (computed as the ratio of
7798
 
   maximum throughput to the throughput for one client) was
7799
 
   180%. We have observed similar results on a four-CPU system:
7800
 
   Virtually no slowdown as the number of clients was increased
7801
 
   up to 1,000, and a 300% scaling factor. Based on these
7802
 
   results, for a high-load SMP server using a 2.2 kernel, we
7803
 
   definitely recommend upgrading to the 2.4 kernel at this
7804
 
   point.
7805
 
 
7806
 
   We have discovered that it is essential to run the mysqld
7807
 
   process with the highest possible priority on the 2.4 kernel
7808
 
   to achieve maximum performance. This can be done by adding a
7809
 
   renice -20 $$ command to mysqld_safe. In our testing on a
7810
 
   four-CPU machine, increasing the priority resulted in a 60%
7811
 
   throughput increase with 400 clients.
7812
 
 
7813
 
   We are currently also trying to collect more information on
7814
 
   how well MySQL performs with a 2.4 kernel on four-way and
7815
 
   eight-way systems. If you have access such a system and have
7816
 
   done some benchmarks, please send an email message to
7817
 
   benchmarks@mysql.com with the results. We will review them
7818
 
   for inclusion in the manual.
 
7538
   kernel patch from one of our users who claimed it helped for his
 
7539
   site. This patch is available at
 
7540
   http://dev.mysql.com/Downloads/Patches/linux-fork.patch. We have
 
7541
   done rather extensive testing of this patch on both development
 
7542
   and production systems. It has significantly improved MySQL
 
7543
   performance without causing any problems and we recommend it to
 
7544
   our users who still run high-load servers on 2.2 kernels.
 
7545
 
 
7546
   This issue has been fixed in the 2.4 kernel, so if you are not
 
7547
   satisfied with the current performance of your system, rather than
 
7548
   patching your 2.2 kernel, it might be easier to upgrade to 2.4. On
 
7549
   SMP systems, upgrading also gives you a nice SMP boost in addition
 
7550
   to fixing the fairness bug.
 
7551
 
 
7552
   We have tested MySQL on the 2.4 kernel on a two-CPU machine and
 
7553
   found MySQL scales much better. There was virtually no slowdown on
 
7554
   query throughput all the way up to 1,000 clients, and the MySQL
 
7555
   scaling factor (computed as the ratio of maximum throughput to the
 
7556
   throughput for one client) was 180%. We have observed similar
 
7557
   results on a four-CPU system: Virtually no slowdown as the number
 
7558
   of clients was increased up to 1,000, and a 300% scaling factor.
 
7559
   Based on these results, for a high-load SMP server using a 2.2
 
7560
   kernel, we definitely recommend upgrading to the 2.4 kernel at
 
7561
   this point.
 
7562
 
 
7563
   We have discovered that it is essential to run the mysqld process
 
7564
   with the highest possible priority on the 2.4 kernel to achieve
 
7565
   maximum performance. This can be done by adding a renice -20 $$
 
7566
   command to mysqld_safe. In our testing on a four-CPU machine,
 
7567
   increasing the priority resulted in a 60% throughput increase with
 
7568
   400 clients.
 
7569
 
 
7570
   We are currently also trying to collect more information on how
 
7571
   well MySQL performs with a 2.4 kernel on four-way and eight-way
 
7572
   systems. If you have access such a system and have done some
 
7573
   benchmarks, please send an email message to benchmarks@mysql.com
 
7574
   with the results. We will review them for inclusion in the manual.
7819
7575
 
7820
7576
   If you see a dead mysqld server process with ps, this usually
7821
 
   means that you have found a bug in MySQL or you have a
7822
 
   corrupted table. See Section B.1.4.2, "What to Do If MySQL
7823
 
   Keeps Crashing."
7824
 
 
7825
 
   To get a core dump on Linux if mysqld dies with a SIGSEGV
7826
 
   signal, you can start mysqld with the --core-file option.
7827
 
   Note that you also probably need to raise the core file size
7828
 
   by adding ulimit -c 1000000 to mysqld_safe or starting
7829
 
   mysqld_safe with --core-file-size=1000000. See Section 4.3.2,
7830
 
   "mysqld_safe --- MySQL Server Startup Script."
7831
 
 
7832
 
2.14.1.5. Linux x86 Notes
7833
 
 
7834
 
   MySQL requires libc 5.4.12 or newer. It is known to work with
7835
 
   libc 5.4.46. glibc 2.0.6 and later should also work. There
7836
 
   have been some problems with the glibc RPMs from Red Hat, so
7837
 
   if you have problems, check whether there are any updates.
7838
 
   The glibc 2.0.7-19 and 2.0.7-29 RPMs are known to work.
7839
 
 
7840
 
   If you are using Red Hat 8.0 or a new glibc 2.2.x library,
7841
 
   you may see mysqld die in gethostbyaddr(). This happens
7842
 
   because the new glibc library requires a stack size greater
7843
 
   than 128KB for this call. To fix the problem, start mysqld
7844
 
   with the --thread-stack=192K option. (Use -O
7845
 
   thread_stack=192K before MySQL 4.) This stack size is the
7846
 
   default on MySQL 4.0.10 and above, so you should not see the
7847
 
   problem.
 
7577
   means that you have found a bug in MySQL or you have a corrupted
 
7578
   table. See Section B.1.4.2, "What to Do If MySQL Keeps Crashing."
 
7579
 
 
7580
   To get a core dump on Linux if mysqld dies with a SIGSEGV signal,
 
7581
   you can start mysqld with the --core-file option. Note that you
 
7582
   also probably need to raise the core file size by adding ulimit -c
 
7583
   1000000 to mysqld_safe or starting mysqld_safe with
 
7584
   --core-file-size=1000000. See Section 4.3.2, "mysqld_safe ---
 
7585
   MySQL Server Startup Script."
 
7586
 
 
7587
2.13.1.5. Linux x86 Notes
 
7588
 
 
7589
   MySQL requires libc 5.4.12 or newer. It is known to work with libc
 
7590
   5.4.46. glibc 2.0.6 and later should also work. There have been
 
7591
   some problems with the glibc RPMs from Red Hat, so if you have
 
7592
   problems, check whether there are any updates. The glibc 2.0.7-19
 
7593
   and 2.0.7-29 RPMs are known to work.
 
7594
 
 
7595
   If you are using Red Hat 8.0 or a new glibc 2.2.x library, you may
 
7596
   see mysqld die in gethostbyaddr(). This happens because the new
 
7597
   glibc library requires a stack size greater than 128KB for this
 
7598
   call. To fix the problem, start mysqld with the
 
7599
   --thread-stack=192K option. (Use -O thread_stack=192K before MySQL
 
7600
   4.) This stack size is the default on MySQL 4.0.10 and above, so
 
7601
   you should not see the problem.
7848
7602
 
7849
7603
   If you are using gcc 3.0 and above to compile MySQL, you must
7850
 
   install the libstdc++v3 library before compiling MySQL; if
7851
 
   you don't do this, you get an error about a missing
7852
 
   __cxa_pure_virtual symbol during linking.
 
7604
   install the libstdc++v3 library before compiling MySQL; if you
 
7605
   don't do this, you get an error about a missing __cxa_pure_virtual
 
7606
   symbol during linking.
7853
7607
 
7854
 
   On some older Linux distributions, configure may produce an
7855
 
   error like this:
 
7608
   On some older Linux distributions, configure may produce an error
 
7609
   like this:
7856
7610
Syntax error in sched.h. Change _P to __P in the
7857
7611
/usr/include/sched.h file.
7858
7612
See the Installation chapter in the Reference Manual.
7859
7613
 
7860
 
   Just do what the error message says. Add an extra underscore
7861
 
   to the _P macro name that has only one underscore, and then
7862
 
   try again.
 
7614
   Just do what the error message says. Add an extra underscore to
 
7615
   the _P macro name that has only one underscore, and then try
 
7616
   again.
7863
7617
 
7864
 
   You may get some warnings when compiling. Those shown here
7865
 
   can be ignored:
 
7618
   You may get some warnings when compiling. Those shown here can be
 
7619
   ignored:
7866
7620
mysqld.cc -o objs-thread/mysqld.o
7867
7621
mysqld.cc: In function `void init_signals()':
7868
7622
mysqld.cc:315: warning: assignment of negative value `-1' to
7871
7625
mysqld.cc:346: warning: assignment of negative value `-1' to
7872
7626
`long unsigned int'
7873
7627
 
7874
 
   If mysqld always dumps core when it starts, the problem may
7875
 
   be that you have an old /lib/libc.a. Try renaming it, and
7876
 
   then remove sql/mysqld and do a new make install and try
7877
 
   again. This problem has been reported on some Slackware
7878
 
   installations.
 
7628
   If mysqld always dumps core when it starts, the problem may be
 
7629
   that you have an old /lib/libc.a. Try renaming it, and then remove
 
7630
   sql/mysqld and do a new make install and try again. This problem
 
7631
   has been reported on some Slackware installations.
7879
7632
 
7880
 
   If you get the following error when linking mysqld, it means
7881
 
   that your libg++.a is not installed correctly:
 
7633
   If you get the following error when linking mysqld, it means that
 
7634
   your libg++.a is not installed correctly:
7882
7635
/usr/lib/libc.a(putc.o): In function `_IO_putc':
7883
7636
putc.o(.text+0x0): multiple definition of `_IO_putc'
7884
7637
 
7885
7638
   You can avoid using libg++.a by running configure like this:
7886
7639
shell> CXX=gcc ./configure
7887
7640
 
7888
 
2.14.1.6. Linux SPARC Notes
7889
 
 
7890
 
   In some implementations, readdir_r() is broken. The symptom
7891
 
   is that the SHOW DATABASES statement always returns an empty
7892
 
   set. This can be fixed by removing HAVE_READDIR_R from
7893
 
   config.h after configuring and before compiling.
7894
 
 
7895
 
2.14.1.7. Linux Alpha Notes
7896
 
 
7897
 
   We have tested MySQL 5.1 on Alpha with our benchmarks and
7898
 
   test suite, and it appears to work well.
7899
 
 
7900
 
   We currently build the MySQL binary packages on SuSE Linux
7901
 
   7.0 for AXP, kernel 2.4.4-SMP, Compaq C compiler (V6.2-505)
7902
 
   and Compaq C++ compiler (V6.3-006) on a Compaq DS20 machine
7903
 
   with an Alpha EV6 processor.
 
7641
2.13.1.6. Linux SPARC Notes
 
7642
 
 
7643
   In some implementations, readdir_r() is broken. The symptom is
 
7644
   that the SHOW DATABASES statement always returns an empty set.
 
7645
   This can be fixed by removing HAVE_READDIR_R from config.h after
 
7646
   configuring and before compiling.
 
7647
 
 
7648
2.13.1.7. Linux Alpha Notes
 
7649
 
 
7650
   We have tested MySQL 5.1 on Alpha with our benchmarks and test
 
7651
   suite, and it appears to work well.
 
7652
 
 
7653
   We currently build the MySQL binary packages on SuSE Linux 7.0 for
 
7654
   AXP, kernel 2.4.4-SMP, Compaq C compiler (V6.2-505) and Compaq C++
 
7655
   compiler (V6.3-006) on a Compaq DS20 machine with an Alpha EV6
 
7656
   processor.
7904
7657
 
7905
7658
   You can find the preceding compilers at
7906
7659
   http://www.support.compaq.com/alpha-tools/. By using these
7907
7660
   compilers rather than gcc, we get about 9-14% better MySQL
7908
7661
   performance.
7909
7662
 
7910
 
   For MySQL on Alpha, we use the -arch generic flag to our
7911
 
   compile options, which ensures that the binary runs on all
7912
 
   Alpha processors. We also compile statically to avoid library
7913
 
   problems. The configure command looks like this:
 
7663
   For MySQL on Alpha, we use the -arch generic flag to our compile
 
7664
   options, which ensures that the binary runs on all Alpha
 
7665
   processors. We also compile statically to avoid library problems.
 
7666
   The configure command looks like this:
7914
7667
CC=ccc CFLAGS="-fast -arch generic" CXX=cxx \
7915
7668
CXXFLAGS="-fast -arch generic -noexceptions -nortti" \
7916
7669
./configure --prefix=/usr/local/mysql --disable-shared \
7917
7670
    --with-extra-charsets=complex --enable-thread-safe-client \
7918
 
    --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_share
7919
 
d
 
7671
    --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shar
 
7672
ed
7920
7673
 
7921
7674
   Some known problems when running MySQL on Linux-Alpha:
7922
7675
 
7923
 
     * Debugging threaded applications like MySQL does not work
7924
 
       with gdb 4.18. You should use gdb 5.1 instead.
 
7676
     * Debugging threaded applications like MySQL does not work with
 
7677
       gdb 4.18. You should use gdb 5.1 instead.
7925
7678
 
7926
7679
     * If you try linking mysqld statically when using gcc, the
7927
 
       resulting image dumps core at startup time. In other
7928
 
       words, do not use --with-mysqld-ldflags=-all-static with
7929
 
       gcc.
7930
 
 
7931
 
2.14.1.8. Linux PowerPC Notes
7932
 
 
7933
 
   MySQL should work on MkLinux with the newest glibc package
7934
 
   (tested with glibc 2.0.7).
7935
 
 
7936
 
2.14.1.9. Linux MIPS Notes
7937
 
 
7938
 
   To get MySQL to work on Qube2 (Linux Mips), you need the
7939
 
   newest glibc libraries. glibc-2.0.7-29C2 is known to work.
7940
 
   You must also use gcc 2.95.2 or newer).
7941
 
 
7942
 
2.14.1.10. Linux IA-64 Notes
 
7680
       resulting image dumps core at startup time. In other words, do
 
7681
       not use --with-mysqld-ldflags=-all-static with gcc.
 
7682
 
 
7683
2.13.1.8. Linux PowerPC Notes
 
7684
 
 
7685
   MySQL should work on MkLinux with the newest glibc package (tested
 
7686
   with glibc 2.0.7).
 
7687
 
 
7688
2.13.1.9. Linux MIPS Notes
 
7689
 
 
7690
   To get MySQL to work on Qube2 (Linux Mips), you need the newest
 
7691
   glibc libraries. glibc-2.0.7-29C2 is known to work. You must also
 
7692
   use gcc 2.95.2 or newer).
 
7693
 
 
7694
2.13.1.10. Linux IA-64 Notes
7943
7695
 
7944
7696
   To get MySQL to compile on Linux IA-64, we use the following
7945
7697
   configure command for building with gcc 2.96:
7952
7704
    "--with-comment=Official MySQL binary" \
7953
7705
    --with-extra-charsets=complex
7954
7706
 
7955
 
   On IA-64, the MySQL client binaries use shared libraries.
7956
 
   This means that if you install our binary distribution at a
7957
 
   location other than /usr/local/mysql, you need to add the
7958
 
   path of the directory where you have libmysqlclient.so
7959
 
   installed either to the /etc/ld.so.conf file or to the value
7960
 
   of your LD_LIBRARY_PATH environment variable.
 
7707
   On IA-64, the MySQL client binaries use shared libraries. This
 
7708
   means that if you install our binary distribution at a location
 
7709
   other than /usr/local/mysql, you need to add the path of the
 
7710
   directory where you have libmysqlclient.so installed either to the
 
7711
   /etc/ld.so.conf file or to the value of your LD_LIBRARY_PATH
 
7712
   environment variable.
7961
7713
 
7962
7714
   See Section B.1.3.1, "Problems Linking to the MySQL Client
7963
7715
   Library."
7964
7716
 
7965
 
2.14.1.11. SELinux Notes
 
7717
2.13.1.11. SELinux Notes
7966
7718
 
7967
 
   RHEL4 comes with SELinux, which supports tighter access
7968
 
   control for processes. If SELinux is enabled (SELINUX in
7969
 
   /etc/selinux/config is set to enforcing, SELINUXTYPE is set
7970
 
   to either targeted or strict), you might encounter problems
 
7719
   RHEL4 comes with SELinux, which supports tighter access control
 
7720
   for processes. If SELinux is enabled (SELINUX in
 
7721
   /etc/selinux/config is set to enforcing, SELINUXTYPE is set to
 
7722
   either targeted or strict), you might encounter problems
7971
7723
   installing MySQL AB RPM packages.
7972
7724
 
7973
 
   Red Hat has an update that solves this. It involves an update
7974
 
   of the "security policy" specification to handle the install
 
7725
   Red Hat has an update that solves this. It involves an update of
 
7726
   the "security policy" specification to handle the install
7975
7727
   structure of the RPMs provided by MySQL AB. For further
7976
7728
   information, see
7977
 
   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=167551
7978
 
   and http://rhn.redhat.com/errata/RHBA-2006-0049.html.
 
7729
   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=167551 and
 
7730
   http://rhn.redhat.com/errata/RHBA-2006-0049.html.
7979
7731
 
7980
7732
   The preceding discussion applies only to RHEL4. The patch is
7981
7733
   unnecessary for RHEL5.
7982
7734
 
7983
 
2.14.2. Mac OS X Notes
 
7735
2.13.2. Mac OS X Notes
7984
7736
 
7985
 
   On Mac OS X, tar cannot handle long filenames. If you need to
 
7737
   On Mac OS X, tar cannot handle long file names. If you need to
7986
7738
   unpack a .tar.gz distribution, use gnutar instead.
7987
7739
 
7988
 
2.14.2.1. Mac OS X 10.x (Darwin)
 
7740
2.13.2.1. Mac OS X 10.x (Darwin)
7989
7741
 
7990
7742
   MySQL should work without major problems on Mac OS X 10.x
7991
7743
   (Darwin).
7992
7744
 
7993
7745
   Known issues:
7994
7746
 
7995
 
     * If you have problems with performance under heavy load,
7996
 
       try using the --skip-thread-priority option to mysqld.
7997
 
       This runs all threads with the same priority. On Mac OS
7998
 
       X, this gives better performance, at least until Apple
7999
 
       fixes its thread scheduler.
 
7747
     * If you have problems with performance under heavy load, try
 
7748
       using the --skip-thread-priority option to mysqld. This runs
 
7749
       all threads with the same priority. On Mac OS X, this gives
 
7750
       better performance, at least until Apple fixes its thread
 
7751
       scheduler.
8000
7752
 
8001
 
     * The connection times (wait_timeout, interactive_timeout
8002
 
       and net_read_timeout) values are not honored.
 
7753
     * The connection times (wait_timeout, interactive_timeout and
 
7754
       net_read_timeout) values are not honored.
8003
7755
       This is probably a signal handling problem in the thread
8004
 
       library where the signal doesn't break a pending read and
8005
 
       we hope that a future update to the thread libraries will
8006
 
       fix this.
 
7756
       library where the signal doesn't break a pending read and we
 
7757
       hope that a future update to the thread libraries will fix
 
7758
       this.
8007
7759
 
8008
7760
   Our binary for Mac OS X is compiled on Darwin 6.3 with the
8009
7761
   following configure line:
8016
7768
 
8017
7769
   See Section 2.5, "Installing MySQL on Mac OS X."
8018
7770
 
8019
 
2.14.2.2. Mac OS X Server 1.2 (Rhapsody)
 
7771
2.13.2.2. Mac OS X Server 1.2 (Rhapsody)
8020
7772
 
8021
7773
   For current versions of Mac OS X Server, no operating system
8022
 
   changes are necessary before compiling MySQL. Compiling for
8023
 
   the Server platform is the same as for the client version of
8024
 
   Mac OS X.
 
7774
   changes are necessary before compiling MySQL. Compiling for the
 
7775
   Server platform is the same as for the client version of Mac OS X.
8025
7776
 
8026
 
   For older versions (Mac OS X Server 1.2, a.k.a. Rhapsody),
8027
 
   you must first install a pthread package before trying to
8028
 
   configure MySQL.
 
7777
   For older versions (Mac OS X Server 1.2, a.k.a. Rhapsody), you
 
7778
   must first install a pthread package before trying to configure
 
7779
   MySQL.
8029
7780
 
8030
7781
   See Section 2.5, "Installing MySQL on Mac OS X."
8031
7782
 
8032
 
2.14.3. Solaris Notes
 
7783
2.13.3. Solaris Notes
8033
7784
 
8034
7785
   For information about installing MySQL on Solaris using PKG
8035
 
   distributions, see Section 2.6, "Installing MySQL on
8036
 
   Solaris."
 
7786
   distributions, see Section 2.6, "Installing MySQL on Solaris."
8037
7787
 
8038
 
   On Solaris, you may run into trouble even before you get the
8039
 
   MySQL distribution unpacked, as the Solaris tar cannot handle
8040
 
   long filenames. This means that you may see errors when you
8041
 
   try to unpack MySQL.
 
7788
   On Solaris, you may run into trouble even before you get the MySQL
 
7789
   distribution unpacked, as the Solaris tar cannot handle long file
 
7790
   names. This means that you may see errors when you try to unpack
 
7791
   MySQL.
8042
7792
 
8043
7793
   If this occurs, you must use GNU tar (gtar) to unpack the
8044
7794
   distribution. You can find a precompiled copy for Solaris at
8045
7795
   http://dev.mysql.com/downloads/os-solaris.html.
8046
7796
 
8047
7797
   Sun native threads work only on Solaris 2.5 and higher. For
8048
 
   Solaris 2.4 and earlier, MySQL automatically uses
8049
 
   MIT-pthreads. See Section 2.10.5, "MIT-pthreads Notes."
 
7798
   Solaris 2.4 and earlier, MySQL automatically uses MIT-pthreads.
 
7799
   See Section 2.10.5, "MIT-pthreads Notes."
8050
7800
 
8051
 
   If you get the following error from configure, it means that
8052
 
   you have something wrong with your compiler installation:
 
7801
   If you get the following error from configure, it means that you
 
7802
   have something wrong with your compiler installation:
8053
7803
checking for restartable system calls... configure: error can not
8054
7804
run test programs while cross compiling
8055
7805
 
8056
 
   In this case, you should upgrade your compiler to a newer
8057
 
   version. You may also be able to solve this problem by
8058
 
   inserting the following row into the config.cache file:
 
7806
   In this case, you should upgrade your compiler to a newer version.
 
7807
   You may also be able to solve this problem by inserting the
 
7808
   following row into the config.cache file:
8059
7809
ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'}
8060
7810
 
8061
 
   If you are using Solaris on a SPARC, the recommended compiler
8062
 
   is gcc 2.95.2 or 3.2. You can find this at
8063
 
   http://gcc.gnu.org/. Note that gcc 2.8.1 does not work
8064
 
   reliably on SPARC.
 
7811
   If you are using Solaris on a SPARC, the recommended compiler is
 
7812
   gcc 2.95.2 or 3.2. You can find this at http://gcc.gnu.org/. Note
 
7813
   that gcc 2.8.1 does not work reliably on SPARC.
8065
7814
 
8066
7815
   The recommended configure line when using gcc 2.95.2 is:
8067
7816
CC=gcc CFLAGS="-O3" \
8068
7817
CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
8069
 
\
 
7818
 \
8070
7819
./configure --prefix=/usr/local/mysql --with-low-memory \
8071
7820
    --enable-assembler
8072
7821
 
8073
7822
   If you have an UltraSPARC system, you can get 4% better
8074
 
   performance by adding -mcpu=v8 -Wa,-xarch=v8plusa to the
8075
 
   CFLAGS and CXXFLAGS environment variables.
 
7823
   performance by adding -mcpu=v8 -Wa,-xarch=v8plusa to the CFLAGS
 
7824
   and CXXFLAGS environment variables.
8076
7825
 
8077
7826
   If you have Sun's Forte 5.0 (or newer) compiler, you can run
8078
7827
   configure like this:
8086
7835
CXX=CC CXXFLAGS="-noex -mt -xarch=v9" ASFLAGS="-xarch=v9" \
8087
7836
./configure --prefix=/usr/local/mysql --enable-assembler
8088
7837
 
8089
 
   To create a 64-bit Solaris binary using gcc, add -m64 to
8090
 
   CFLAGS and CXXFLAGS and remove --enable-assembler from the
8091
 
   configure line.
 
7838
   To create a 64-bit Solaris binary using gcc, add -m64 to CFLAGS
 
7839
   and CXXFLAGS and remove --enable-assembler from the configure
 
7840
   line.
8092
7841
 
8093
7842
   In the MySQL benchmarks, we obtained a 4% speed increase on
8094
 
   UltraSPARC when using Forte 5.0 in 32-bit mode, as compared
8095
 
   to using gcc 3.2 with the -mcpu flag.
8096
 
 
8097
 
   If you create a 64-bit mysqld binary, it is 4% slower than
8098
 
   the 32-bit binary, but can handle more threads and memory.
8099
 
 
8100
 
   When using Solaris 10 for x86_64, you should mount any
8101
 
   filesystems on which you intend to store InnoDB files with
8102
 
   the forcedirectio option. (By default mounting is done
8103
 
   without this option.) Failing to do so will cause a
8104
 
   significant drop in performance when using the InnoDB storage
8105
 
   engine on this platform.
8106
 
 
8107
 
   If you get a problem with fdatasync or sched_yield, you can
8108
 
   fix this by adding LIBS=-lrt to the configure line
8109
 
 
8110
 
   For compilers older than WorkShop 5.3, you might have to edit
8111
 
   the configure script. Change this line:
 
7843
   UltraSPARC when using Forte 5.0 in 32-bit mode, as compared to
 
7844
   using gcc 3.2 with the -mcpu flag.
 
7845
 
 
7846
   If you create a 64-bit mysqld binary, it is 4% slower than the
 
7847
   32-bit binary, but can handle more threads and memory.
 
7848
 
 
7849
   When using Solaris 10 for x86_64, you should mount any file
 
7850
   systems on which you intend to store InnoDB files with the
 
7851
   forcedirectio option. (By default mounting is done without this
 
7852
   option.) Failing to do so will cause a significant drop in
 
7853
   performance when using the InnoDB storage engine on this platform.
 
7854
 
 
7855
   If you get a problem with fdatasync or sched_yield, you can fix
 
7856
   this by adding LIBS=-lrt to the configure line
 
7857
 
 
7858
   For compilers older than WorkShop 5.3, you might have to edit the
 
7859
   configure script. Change this line:
8112
7860
#if !defined(__STDC__) || __STDC__ != 1
8113
7861
 
8114
7862
   To this:
8115
7863
#if !defined(__STDC__)
8116
7864
 
8117
7865
   If you turn on __STDC__ with the -Xc option, the Sun compiler
8118
 
   can't compile with the Solaris pthread.h header file. This is
8119
 
   a Sun bug (broken compiler or broken include file).
 
7866
   can't compile with the Solaris pthread.h header file. This is a
 
7867
   Sun bug (broken compiler or broken include file).
8120
7868
 
8121
 
   If mysqld issues the following error message when you run it,
8122
 
   you have tried to compile MySQL with the Sun compiler without
8123
 
   enabling the -mt multi-thread option:
 
7869
   If mysqld issues the following error message when you run it, you
 
7870
   have tried to compile MySQL with the Sun compiler without enabling
 
7871
   the -mt multi-thread option:
8124
7872
libc internal error: _rmutex_unlock: rmutex not held
8125
7873
 
8126
7874
   Add -mt to CFLAGS and CXXFLAGS and recompile.
8127
7875
 
8128
 
   If you are using the SFW version of gcc (which comes with
8129
 
   Solaris 8), you must add /opt/sfw/lib to the environment
8130
 
   variable LD_LIBRARY_PATH before running configure.
8131
 
 
8132
 
   If you are using the gcc available from sunfreeware.com, you
8133
 
   may have many problems. To avoid this, you should recompile
8134
 
   gcc and GNU binutils on the machine where you are running
8135
 
   them.
8136
 
 
8137
 
   If you get the following error when compiling MySQL with gcc,
8138
 
   it means that your gcc is not configured for your version of
8139
 
   Solaris:
 
7876
   If you are using the SFW version of gcc (which comes with Solaris
 
7877
   8), you must add /opt/sfw/lib to the environment variable
 
7878
   LD_LIBRARY_PATH before running configure.
 
7879
 
 
7880
   If you are using the gcc available from sunfreeware.com, you may
 
7881
   have many problems. To avoid this, you should recompile gcc and
 
7882
   GNU binutils on the machine where you are running them.
 
7883
 
 
7884
   If you get the following error when compiling MySQL with gcc, it
 
7885
   means that your gcc is not configured for your version of Solaris:
8140
7886
shell> gcc -O3 -g -O2 -DDBUG_OFF  -o thr_alarm ...
8141
7887
./thr_alarm.c: In function `signal_hand':
8142
7888
./thr_alarm.c:556: too many arguments to function `sigwait'
8143
7889
 
8144
 
   The proper thing to do in this case is to get the newest
8145
 
   version of gcc and compile it with your current gcc compiler.
8146
 
   At least for Solaris 2.5, almost all binary versions of gcc
8147
 
   have old, unusable include files that break all programs that
8148
 
   use threads, and possibly other programs as well.
 
7890
   The proper thing to do in this case is to get the newest version
 
7891
   of gcc and compile it with your current gcc compiler. At least for
 
7892
   Solaris 2.5, almost all binary versions of gcc have old, unusable
 
7893
   include files that break all programs that use threads, and
 
7894
   possibly other programs as well.
8149
7895
 
8150
 
   Solaris does not provide static versions of all system
8151
 
   libraries (libpthreads and libdl), so you cannot compile
8152
 
   MySQL with --static. If you try to do so, you get one of the
8153
 
   following errors:
 
7896
   Solaris does not provide static versions of all system libraries
 
7897
   (libpthreads and libdl), so you cannot compile MySQL with
 
7898
   --static. If you try to do so, you get one of the following
 
7899
   errors:
8154
7900
ld: fatal: library -ldl: not found
8155
7901
undefined reference to `dlopen'
8156
7902
cannot find -lrt
8162
7908
 
8163
7909
   This problem can be avoided by one of the following methods:
8164
7910
 
8165
 
     * Link clients with the
8166
 
       -Wl,r/full/path/to/libmysqlclient.so flag rather than
8167
 
       with -Lpath).
 
7911
     * Link clients with the -Wl,r/full/path/to/libmysqlclient.so
 
7912
       flag rather than with -Lpath).
8168
7913
 
8169
7914
     * Copy libmysqclient.so to /usr/lib.
8170
7915
 
8171
 
     * Add the pathname of the directory where libmysqlclient.so
8172
 
       is located to the LD_RUN_PATH environment variable before
8173
 
       running your client.
8174
 
 
8175
 
   If you have problems with configure trying to link with -lz
8176
 
   when you don't have zlib installed, you have two options:
8177
 
 
8178
 
     * If you want to be able to use the compressed
8179
 
       communication protocol, you need to get and install zlib
8180
 
       from ftp.gnu.org.
 
7916
     * Add the path name of the directory where libmysqlclient.so is
 
7917
       located to the LD_RUN_PATH environment variable before running
 
7918
       your client.
 
7919
 
 
7920
   If you have problems with configure trying to link with -lz when
 
7921
   you don't have zlib installed, you have two options:
 
7922
 
 
7923
     * If you want to be able to use the compressed communication
 
7924
       protocol, you need to get and install zlib from ftp.gnu.org.
8181
7925
 
8182
7926
     * Run configure with the --with-named-z-libs=no option when
8183
7927
       building MySQL.
8184
7928
 
8185
 
   If you are using gcc and have problems with loading
8186
 
   user-defined functions (UDFs) into MySQL, try adding -lgcc to
8187
 
   the link line for the UDF.
 
7929
   If you are using gcc and have problems with loading user-defined
 
7930
   functions (UDFs) into MySQL, try adding -lgcc to the link line for
 
7931
   the UDF.
8188
7932
 
8189
7933
   If you would like MySQL to start automatically, you can copy
8190
 
   support-files/mysql.server to /etc/init.d and create a
8191
 
   symbolic link to it named /etc/rc3.d/S99mysql.server.
 
7934
   support-files/mysql.server to /etc/init.d and create a symbolic
 
7935
   link to it named /etc/rc3.d/S99mysql.server.
8192
7936
 
8193
 
   If too many processes try to connect very rapidly to mysqld,
8194
 
   you should see this error in the MySQL log:
 
7937
   If too many processes try to connect very rapidly to mysqld, you
 
7938
   should see this error in the MySQL log:
8195
7939
Error in accept: Protocol error
8196
7940
 
8197
 
   You might try starting the server with the --back_log=50
8198
 
   option as a workaround for this. (Use -O back_log=50 before
8199
 
   MySQL 4.)
8200
 
 
8201
 
   Solaris doesn't support core files for setuid() applications,
8202
 
   so you can't get a core file from mysqld if you are using the
8203
 
   --user option.
8204
 
 
8205
 
2.14.3.1. Solaris 2.7/2.8 Notes
8206
 
 
8207
 
   Normally, you can use a Solaris 2.6 binary on Solaris 2.7 and
8208
 
   2.8. Most of the Solaris 2.6 issues also apply for Solaris
8209
 
   2.7 and 2.8.
 
7941
   You might try starting the server with the --back_log=50 option as
 
7942
   a workaround for this. (Use -O back_log=50 before MySQL 4.)
 
7943
 
 
7944
   Solaris doesn't support core files for setuid() applications, so
 
7945
   you can't get a core file from mysqld if you are using the --user
 
7946
   option.
 
7947
 
 
7948
2.13.3.1. Solaris 2.7/2.8 Notes
 
7949
 
 
7950
   Normally, you can use a Solaris 2.6 binary on Solaris 2.7 and 2.8.
 
7951
   Most of the Solaris 2.6 issues also apply for Solaris 2.7 and 2.8.
8210
7952
 
8211
7953
   MySQL should be able to detect new versions of Solaris
8212
 
   automatically and enable workarounds for the following
8213
 
   problems.
 
7954
   automatically and enable workarounds for the following problems.
8214
7955
 
8215
 
   Solaris 2.7 / 2.8 has some bugs in the include files. You may
8216
 
   see the following error when you use gcc:
 
7956
   Solaris 2.7 / 2.8 has some bugs in the include files. You may see
 
7957
   the following error when you use gcc:
8217
7958
/usr/include/widec.h:42: warning: `getwc' redefined
8218
 
/usr/include/wchar.h:326: warning: this is the location of the previou
8219
 
s
 
7959
/usr/include/wchar.h:326: warning: this is the location of the previo
 
7960
us
8220
7961
definition
8221
7962
 
8222
7963
   If this occurs, you can fix the problem by copying
8223
 
   /usr/include/widec.h to
8224
 
   .../lib/gcc-lib/os/gcc-version/include and changing line 41
8225
 
   from this:
 
7964
   /usr/include/widec.h to .../lib/gcc-lib/os/gcc-version/include and
 
7965
   changing line 41 from this:
8226
7966
#if     !defined(lint) && !defined(__lint)
8227
7967
 
8228
7968
   To this:
8229
7969
#if     !defined(lint) && !defined(__lint) && !defined(getwc)
8230
7970
 
8231
 
   Alternatively, you can edit /usr/include/widec.h directly.
8232
 
   Either way, after you make the fix, you should remove
8233
 
   config.cache and run configure again.
 
7971
   Alternatively, you can edit /usr/include/widec.h directly. Either
 
7972
   way, after you make the fix, you should remove config.cache and
 
7973
   run configure again.
8234
7974
 
8235
 
   If you get the following errors when you run make, it's
8236
 
   because configure didn't detect the curses.h file (probably
8237
 
   because of the error in /usr/include/widec.h):
 
7975
   If you get the following errors when you run make, it is because
 
7976
   configure didn't detect the curses.h file (probably because of the
 
7977
   error in /usr/include/widec.h):
8238
7978
In file included from mysql.cc:50:
8239
7979
/usr/include/term.h:1060: syntax error before `,'
8240
7980
/usr/include/term.h:1081: syntax error before `;'
8241
7981
 
8242
7982
   The solution to this problem is to do one of the following:
8243
7983
 
8244
 
     * Configure with CFLAGS=-DHAVE_CURSES_H
8245
 
       CXXFLAGS=-DHAVE_CURSES_H ./configure.
 
7984
     * Configure with CFLAGS=-DHAVE_CURSES_H CXXFLAGS=-DHAVE_CURSES_H
 
7985
       ./configure.
8246
7986
 
8247
7987
     * Edit /usr/include/widec.h as indicated in the preceding
8248
7988
       discussion and re-run configure.
8249
7989
 
8250
 
     * Remove the #define HAVE_TERM line from the config.h file
8251
 
       and run make again.
 
7990
     * Remove the #define HAVE_TERM line from the config.h file and
 
7991
       run make again.
8252
7992
 
8253
 
   If your linker cannot find -lz when linking client programs,
8254
 
   the problem is probably that your libz.so file is installed
8255
 
   in /usr/local/lib. You can fix this problem by one of the
8256
 
   following methods:
 
7993
   If your linker cannot find -lz when linking client programs, the
 
7994
   problem is probably that your libz.so file is installed in
 
7995
   /usr/local/lib. You can fix this problem by one of the following
 
7996
   methods:
8257
7997
 
8258
7998
     * Add /usr/local/lib to LD_LIBRARY_PATH.
8259
7999
 
8260
8000
     * Add a link to libz.so from /lib.
8261
8001
 
8262
 
     * If you are using Solaris 8, you can install the optional
8263
 
       zlib from your Solaris 8 CD distribution.
 
8002
     * If you are using Solaris 8, you can install the optional zlib
 
8003
       from your Solaris 8 CD distribution.
8264
8004
 
8265
8005
     * Run configure with the --with-named-z-libs=no option when
8266
8006
       building MySQL.
8267
8007
 
8268
 
2.14.3.2. Solaris x86 Notes
8269
 
 
8270
 
   On Solaris 8 on x86, mysqld dumps core if you remove the
8271
 
   debug symbols using strip.
8272
 
 
8273
 
   If you are using gcc on Solaris x86 and you experience
8274
 
   problems with core dumps under load, you should use the
8275
 
   following configure command:
 
8008
2.13.3.2. Solaris x86 Notes
 
8009
 
 
8010
   On Solaris 8 on x86, mysqld dumps core if you remove the debug
 
8011
   symbols using strip.
 
8012
 
 
8013
   If you are using gcc on Solaris x86 and you experience problems
 
8014
   with core dumps under load, you should use the following configure
 
8015
   command:
8276
8016
CC=gcc CFLAGS="-O3 -fomit-frame-pointer -DHAVE_CURSES_H" \
8277
8017
CXX=gcc \
8278
8018
CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors \
8282
8022
   This avoids problems with the libstdc++ library and with C++
8283
8023
   exceptions.
8284
8024
 
8285
 
   If this doesn't help, you should compile a debug version and
8286
 
   run it with a trace file or under gdb. See MySQL Internals:
8287
 
   Porting
 
8025
   If this doesn't help, you should compile a debug version and run
 
8026
   it with a trace file or under gdb. See MySQL Internals: Porting
8288
8027
   (http://forge.mysql.com/wiki/MySQL_Internals_Porting).
8289
8028
 
8290
 
2.14.4. BSD Notes
8291
 
 
8292
 
   This section provides information about using MySQL on
8293
 
   variants of BSD Unix.
8294
 
 
8295
 
2.14.4.1. FreeBSD Notes
8296
 
 
8297
 
   FreeBSD 4.x or newer is recommended for running MySQL,
8298
 
   because the thread package is much more integrated. To get a
8299
 
   secure and stable system, you should use only FreeBSD kernels
8300
 
   that are marked -RELEASE.
8301
 
 
8302
 
   The easiest (and preferred) way to install MySQL is to use
8303
 
   the mysql-server and mysql-client ports available at
8304
 
   http://www.freebsd.org/. Using these ports gives you the
8305
 
   following benefits:
8306
 
 
8307
 
     * A working MySQL with all optimizations enabled that are
8308
 
       known to work on your version of FreeBSD.
 
8029
2.13.4. BSD Notes
 
8030
 
 
8031
   This section provides information about using MySQL on variants of
 
8032
   BSD Unix.
 
8033
 
 
8034
2.13.4.1. FreeBSD Notes
 
8035
 
 
8036
   FreeBSD 4.x or newer is recommended for running MySQL, because the
 
8037
   thread package is much more integrated. To get a secure and stable
 
8038
   system, you should use only FreeBSD kernels that are marked
 
8039
   -RELEASE.
 
8040
 
 
8041
   The easiest (and preferred) way to install MySQL is to use the
 
8042
   mysql-server and mysql-client ports available at
 
8043
   http://www.freebsd.org/. Using these ports gives you the following
 
8044
   benefits:
 
8045
 
 
8046
     * A working MySQL with all optimizations enabled that are known
 
8047
       to work on your version of FreeBSD.
8309
8048
 
8310
8049
     * Automatic configuration and build.
8311
8050
 
8314
8053
     * The ability to use pkg_info -L to see which files are
8315
8054
       installed.
8316
8055
 
8317
 
     * The ability to use pkg_delete to remove MySQL if you no
8318
 
       longer want it on your machine.
8319
 
 
8320
 
   It is recommended you use MIT-pthreads on FreeBSD 2.x, and
8321
 
   native threads on FreeBSD 3 and up. It is possible to run
8322
 
   with native threads on some late 2.2.x versions, but you may
8323
 
   encounter problems shutting down mysqld.
8324
 
 
8325
 
   Unfortunately, certain function calls on FreeBSD are not yet
8326
 
   fully thread-safe. Most notably, this includes the
8327
 
   gethostbyname() function, which is used by MySQL to convert
8328
 
   hostnames into IP addresses. Under certain circumstances, the
8329
 
   mysqld process suddenly causes 100% CPU load and is
8330
 
   unresponsive. If you encounter this problem, try to start
8331
 
   MySQL using the --skip-name-resolve option.
 
8056
     * The ability to use pkg_delete to remove MySQL if you no longer
 
8057
       want it on your machine.
 
8058
 
 
8059
   It is recommended you use MIT-pthreads on FreeBSD 2.x, and native
 
8060
   threads on FreeBSD 3 and up. It is possible to run with native
 
8061
   threads on some late 2.2.x versions, but you may encounter
 
8062
   problems shutting down mysqld.
 
8063
 
 
8064
   Unfortunately, certain function calls on FreeBSD are not yet fully
 
8065
   thread-safe. Most notably, this includes the gethostbyname()
 
8066
   function, which is used by MySQL to convert host names into IP
 
8067
   addresses. Under certain circumstances, the mysqld process
 
8068
   suddenly causes 100% CPU load and is unresponsive. If you
 
8069
   encounter this problem, try to start MySQL using the
 
8070
   --skip-name-resolve option.
8332
8071
 
8333
8072
   Alternatively, you can link MySQL on FreeBSD 4.x against the
8334
 
   LinuxThreads library, which avoids a few of the problems that
8335
 
   the native FreeBSD thread implementation has. For a very good
 
8073
   LinuxThreads library, which avoids a few of the problems that the
 
8074
   native FreeBSD thread implementation has. For a very good
8336
8075
   comparison of LinuxThreads versus native threads, see Jeremy
8337
8076
   Zawodny's article FreeBSD or Linux for your MySQL Server? at
8338
8077
   http://jeremy.zawodny.com/blog/archives/000697.html.
8339
8078
 
8340
8079
   Known problem when using LinuxThreads on FreeBSD is:
8341
8080
 
8342
 
     * The connection times (wait_timeout, interactive_timeout
8343
 
       and net_read_timeout) values are not honored. The symptom
8344
 
       is that persistent connections can hang for a very long
8345
 
       time without getting closed down and that a 'kill' for a
8346
 
       thread will not take affect until the thread does it a
8347
 
       new command
 
8081
     * The connection times (wait_timeout, interactive_timeout and
 
8082
       net_read_timeout) values are not honored. The symptom is that
 
8083
       persistent connections can hang for a very long time without
 
8084
       getting closed down and that a 'kill' for a thread will not
 
8085
       take affect until the thread does it a new command
8348
8086
       This is probably a signal handling problem in the thread
8349
 
       library where the signal doesn't break a pending read.
8350
 
       This is supposed to be fixed in FreeBSD 5.0
8351
 
 
8352
 
   The MySQL build process requires GNU make (gmake) to work. If
8353
 
   GNU make is not available, you must install it first before
8354
 
   compiling MySQL.
8355
 
 
8356
 
   The recommended way to compile and install MySQL on FreeBSD
8357
 
   with gcc (2.95.2 and up) is:
 
8087
       library where the signal doesn't break a pending read. This is
 
8088
       supposed to be fixed in FreeBSD 5.0
 
8089
 
 
8090
   The MySQL build process requires GNU make (gmake) to work. If GNU
 
8091
   make is not available, you must install it first before compiling
 
8092
   MySQL.
 
8093
 
 
8094
   The recommended way to compile and install MySQL on FreeBSD with
 
8095
   gcc (2.95.2 and up) is:
8358
8096
CC=gcc CFLAGS="-O2 -fno-strength-reduce" \
8359
8097
    CXX=gcc CXXFLAGS="-O2 -fno-rtti -fno-exceptions \
8360
8098
    -felide-constructors -fno-strength-reduce" \
8365
8103
bin/mysql_install_db --user=mysql
8366
8104
bin/mysqld_safe &
8367
8105
 
8368
 
   If you notice that configure uses MIT-pthreads, you should
8369
 
   read the MIT-pthreads notes. See Section 2.10.5,
8370
 
   "MIT-pthreads Notes."
 
8106
   If you notice that configure uses MIT-pthreads, you should read
 
8107
   the MIT-pthreads notes. See Section 2.10.5, "MIT-pthreads Notes."
8371
8108
 
8372
8109
   If you get an error from make install that it can't find
8373
8110
   /usr/include/pthreads, configure didn't detect that you need
8374
 
   MIT-pthreads. To fix this problem, remove config.cache, and
8375
 
   then re-run configure with the --with-mit-threads option.
 
8111
   MIT-pthreads. To fix this problem, remove config.cache, and then
 
8112
   re-run configure with the --with-mit-threads option.
8376
8113
 
8377
 
   Be sure that your name resolver setup is correct. Otherwise,
8378
 
   you may experience resolver delays or failures when
8379
 
   connecting to mysqld. Also make sure that the localhost entry
8380
 
   in the /etc/hosts file is correct. The file should start with
8381
 
   a line similar to this:
 
8114
   Be sure that your name resolver setup is correct. Otherwise, you
 
8115
   may experience resolver delays or failures when connecting to
 
8116
   mysqld. Also make sure that the localhost entry in the /etc/hosts
 
8117
   file is correct. The file should start with a line similar to
 
8118
   this:
8382
8119
127.0.0.1       localhost localhost.your.domain
8383
8120
 
8384
 
   FreeBSD is known to have a very low default file handle
8385
 
   limit. See Section B.1.2.18, "'File' Not Found and Similar
8386
 
   Errors." Start the server by using the --open-files-limit
8387
 
   option for mysqld_safe, or raise the limits for the mysqld
8388
 
   user in /etc/login.conf and rebuild it with cap_mkdb
8389
 
   /etc/login.conf. Also be sure that you set the appropriate
8390
 
   class for this user in the password file if you are not using
8391
 
   the default (use chpass mysqld-user-name). See Section 4.3.2,
8392
 
   "mysqld_safe --- MySQL Server Startup Script."
 
8121
   FreeBSD is known to have a very low default file handle limit. See
 
8122
   Section B.1.2.18, "'File' Not Found and Similar Errors." Start the
 
8123
   server by using the --open-files-limit option for mysqld_safe, or
 
8124
   raise the limits for the mysqld user in /etc/login.conf and
 
8125
   rebuild it with cap_mkdb /etc/login.conf. Also be sure that you
 
8126
   set the appropriate class for this user in the password file if
 
8127
   you are not using the default (use chpass mysqld-user-name). See
 
8128
   Section 4.3.2, "mysqld_safe --- MySQL Server Startup Script."
8393
8129
 
8394
 
   FreeBSD limits the size of a process to 512MB, even if you
8395
 
   have much more RAM available on the system. So you may get an
8396
 
   error such as this:
 
8130
   FreeBSD limits the size of a process to 512MB, even if you have
 
8131
   much more RAM available on the system. So you may get an error
 
8132
   such as this:
8397
8133
Out of memory (Needed 16391 bytes)
8398
8134
 
8399
 
   In current versions of FreeBSD (at least 4.x and greater),
8400
 
   you may increase this limit by adding the following entries
8401
 
   to the /boot/loader.conf file and rebooting the machine
8402
 
   (these are not settings that can be changed at run time with
8403
 
   the sysctl command):
 
8135
   In current versions of FreeBSD (at least 4.x and greater), you may
 
8136
   increase this limit by adding the following entries to the
 
8137
   /boot/loader.conf file and rebooting the machine (these are not
 
8138
   settings that can be changed at run time with the sysctl command):
8404
8139
kern.maxdsiz="1073741824" # 1GB
8405
8140
kern.dfldsiz="1073741824" # 1GB
8406
8141
kern.maxssiz="134217728" # 128MB
8407
8142
 
8408
 
   For older versions of FreeBSD, you must recompile your kernel
8409
 
   to change the maximum data segment size for a process. In
8410
 
   this case, you should look at the MAXDSIZ option in the LINT
8411
 
   config file for more information.
8412
 
 
8413
 
   If you get problems with the current date in MySQL, setting
8414
 
   the TZ variable should help. See Section 2.15, "Environment
8415
 
   Variables."
8416
 
 
8417
 
2.14.4.2. NetBSD Notes
 
8143
   For older versions of FreeBSD, you must recompile your kernel to
 
8144
   change the maximum data segment size for a process. In this case,
 
8145
   you should look at the MAXDSIZ option in the LINT config file for
 
8146
   more information.
 
8147
 
 
8148
   If you get problems with the current date in MySQL, setting the TZ
 
8149
   variable should help. See Section 2.14, "Environment Variables."
 
8150
 
 
8151
2.13.4.2. NetBSD Notes
8418
8152
 
8419
8153
   To compile on NetBSD, you need GNU make. Otherwise, the build
8420
8154
   process fails when make tries to run lint on C++ files.
8421
8155
 
8422
 
2.14.4.3. OpenBSD 2.5 Notes
 
8156
2.13.4.3. OpenBSD 2.5 Notes
8423
8157
 
8424
 
   On OpenBSD 2.5, you can compile MySQL with native threads
8425
 
   with the following options:
 
8158
   On OpenBSD 2.5, you can compile MySQL with native threads with the
 
8159
   following options:
8426
8160
CFLAGS=-pthread CXXFLAGS=-pthread ./configure --with-mit-threads=no
8427
8161
 
8428
 
2.14.4.4. BSD/OS Version 2.x Notes
 
8162
2.13.4.4. BSD/OS Version 2.x Notes
8429
8163
 
8430
 
   If you get the following error when compiling MySQL, your
8431
 
   ulimit value for virtual memory is too low:
 
8164
   If you get the following error when compiling MySQL, your ulimit
 
8165
   value for virtual memory is too low:
8432
8166
item_func.h: In method
8433
8167
`Item_func_ge::Item_func_ge(const Item_func_ge &)':
8434
8168
item_func.h:28: virtual memory exhausted
8435
8169
make[2]: *** [item_func.o] Error 1
8436
8170
 
8437
 
   Try using ulimit -v 80000 and run make again. If this doesn't
8438
 
   work and you are using bash, try switching to csh or sh; some
8439
 
   BSDI users have reported problems with bash and ulimit.
 
8171
   Try using ulimit -v 80000 and run make again. If this doesn't work
 
8172
   and you are using bash, try switching to csh or sh; some BSDI
 
8173
   users have reported problems with bash and ulimit.
8440
8174
 
8441
8175
   If you are using gcc, you may also use have to use the
8442
8176
   --with-low-memory flag for configure to be able to compile
8443
8177
   sql_yacc.cc.
8444
8178
 
8445
 
   If you get problems with the current date in MySQL, setting
8446
 
   the TZ variable should help. See Section 2.15, "Environment
8447
 
   Variables."
8448
 
 
8449
 
2.14.4.5. BSD/OS Version 3.x Notes
8450
 
 
8451
 
   Upgrade to BSD/OS 3.1. If that is not possible, install
8452
 
   BSDIpatch M300-038.
 
8179
   If you get problems with the current date in MySQL, setting the TZ
 
8180
   variable should help. See Section 2.14, "Environment Variables."
 
8181
 
 
8182
2.13.4.5. BSD/OS Version 3.x Notes
 
8183
 
 
8184
   Upgrade to BSD/OS 3.1. If that is not possible, install BSDIpatch
 
8185
   M300-038.
8453
8186
 
8454
8187
   Use the following command when configuring MySQL:
8455
8188
env CXX=shlicc++ CC=shlicc2 \
8465
8198
    --prefix=/usr/local/mysql \
8466
8199
    --with-unix-socket-path=/var/mysql/mysql.sock
8467
8200
 
8468
 
   You can change the directory locations if you wish, or just
8469
 
   use the defaults by not specifying any locations.
8470
 
 
8471
 
   If you have problems with performance under heavy load, try
8472
 
   using the --skip-thread-priority option to mysqld. This runs
8473
 
   all threads with the same priority. On BSDI 3.1, this gives
8474
 
   better performance, at least until BSDI fixes its thread
8475
 
   scheduler.
8476
 
 
8477
 
   If you get the error virtual memory exhausted while
8478
 
   compiling, you should try using ulimit -v 80000 and running
8479
 
   make again. If this doesn't work and you are using bash, try
8480
 
   switching to csh or sh; some BSDI users have reported
8481
 
   problems with bash and ulimit.
8482
 
 
8483
 
2.14.4.6. BSD/OS Version 4.x Notes
8484
 
 
8485
 
   BSDI 4.x has some thread-related bugs. If you want to use
8486
 
   MySQL on this, you should install all thread-related patches.
8487
 
   At least M400-023 should be installed.
 
8201
   You can change the directory locations if you wish, or just use
 
8202
   the defaults by not specifying any locations.
 
8203
 
 
8204
   If you have problems with performance under heavy load, try using
 
8205
   the --skip-thread-priority option to mysqld. This runs all threads
 
8206
   with the same priority. On BSDI 3.1, this gives better
 
8207
   performance, at least until BSDI fixes its thread scheduler.
 
8208
 
 
8209
   If you get the error virtual memory exhausted while compiling, you
 
8210
   should try using ulimit -v 80000 and running make again. If this
 
8211
   doesn't work and you are using bash, try switching to csh or sh;
 
8212
   some BSDI users have reported problems with bash and ulimit.
 
8213
 
 
8214
2.13.4.6. BSD/OS Version 4.x Notes
 
8215
 
 
8216
   BSDI 4.x has some thread-related bugs. If you want to use MySQL on
 
8217
   this, you should install all thread-related patches. At least
 
8218
   M400-023 should be installed.
8488
8219
 
8489
8220
   On some BSDI 4.x systems, you may get problems with shared
8490
8221
   libraries. The symptom is that you can't execute any client
8491
8222
   programs, for example, mysqladmin. In this case, you need to
8492
 
   reconfigure not to use shared libraries with the
8493
 
   --disable-shared option to configure.
8494
 
 
8495
 
   Some customers have had problems on BSDI 4.0.1 that the
8496
 
   mysqld binary after a while can't open tables. This occurs
8497
 
   because some library/system-related bug causes mysqld to
8498
 
   change current directory without having asked for that to
8499
 
   happen.
8500
 
 
8501
 
   The fix is to either upgrade MySQL to at least version
8502
 
   3.23.34 or, after running configure, remove the line #define
8503
 
   HAVE_REALPATH from config.h before running make.
8504
 
 
8505
 
   Note that this means that you can't symbolically link a
8506
 
   database directories to another database directory or
8507
 
   symbolic link a table to another database on BSDI. (Making a
8508
 
   symbolic link to another disk is okay).
8509
 
 
8510
 
2.14.5. Other Unix Notes
8511
 
 
8512
 
2.14.5.1. HP-UX Version 10.20 Notes
8513
 
 
8514
 
   If you install MySQL using a binary tarball distribution on
8515
 
   HP-UX, you may run into trouble even before you get the MySQL
8516
 
   distribution unpacked, as the HP-UX tar cannot handle long
8517
 
   filenames. This means that you may see errors when you try to
8518
 
   unpack MySQL.
 
8223
   reconfigure not to use shared libraries with the --disable-shared
 
8224
   option to configure.
 
8225
 
 
8226
   Some customers have had problems on BSDI 4.0.1 that the mysqld
 
8227
   binary after a while can't open tables. This occurs because some
 
8228
   library/system-related bug causes mysqld to change current
 
8229
   directory without having asked for that to happen.
 
8230
 
 
8231
   The fix is to either upgrade MySQL to at least version 3.23.34 or,
 
8232
   after running configure, remove the line #define HAVE_REALPATH
 
8233
   from config.h before running make.
 
8234
 
 
8235
   Note that this means that you can't symbolically link a database
 
8236
   directories to another database directory or symbolic link a table
 
8237
   to another database on BSDI. (Making a symbolic link to another
 
8238
   disk is okay).
 
8239
 
 
8240
2.13.5. Other Unix Notes
 
8241
 
 
8242
2.13.5.1. HP-UX Version 10.20 Notes
 
8243
 
 
8244
   If you install MySQL using a binary tarball distribution on HP-UX,
 
8245
   you may run into trouble even before you get the MySQL
 
8246
   distribution unpacked, as the HP-UX tar cannot handle long file
 
8247
   names. This means that you may see errors when you try to unpack
 
8248
   MySQL.
8519
8249
 
8520
8250
   If this occurs, you must use GNU tar (gtar) to unpack the
8521
8251
   distribution.
8522
8252
 
8523
8253
   There are a couple of small problems when compiling MySQL on
8524
 
   HP-UX. We recommend that you use gcc instead of the HP-UX
8525
 
   native compiler, because gcc produces better code.
 
8254
   HP-UX. We recommend that you use gcc instead of the HP-UX native
 
8255
   compiler, because gcc produces better code.
8526
8256
 
8527
 
   We recommend using gcc 2.95 on HP-UX. Don't use high
8528
 
   optimization flags (such as -O6) because they may not be safe
8529
 
   on HP-UX.
 
8257
   We recommend using gcc 2.95 on HP-UX. Don't use high optimization
 
8258
   flags (such as -O6) because they may not be safe on HP-UX.
8530
8259
 
8531
8260
   The following configure line should work with gcc 2.95:
8532
8261
CFLAGS="-I/opt/dce/include -fpic" \
8547
8276
    --with-named-thread-libs=-ldce --with-lib-ccflags=-fPIC
8548
8277
    --disable-shared
8549
8278
 
8550
 
2.14.5.2. HP-UX Version 11.x Notes
 
8279
2.13.5.2. HP-UX Version 11.x Notes
8551
8280
 
8552
 
   If you install MySQL using a binary tarball distribution on
8553
 
   HP-UX, you may run into trouble even before you get the MySQL
8554
 
   distribution unpacked, as the HP-UX tar cannot handle long
8555
 
   filenames. This means that you may see errors when you try to
8556
 
   unpack MySQL.
 
8281
   If you install MySQL using a binary tarball distribution on HP-UX,
 
8282
   you may run into trouble even before you get the MySQL
 
8283
   distribution unpacked, as the HP-UX tar cannot handle long file
 
8284
   names. This means that you may see errors when you try to unpack
 
8285
   MySQL.
8557
8286
 
8558
8287
   If this occurs, you must use GNU tar (gtar) to unpack the
8559
8288
   distribution.
8560
8289
 
8561
 
   Because of some critical bugs in the standard HP-UX
8562
 
   libraries, you should install the following patches before
8563
 
   trying to run MySQL on HP-UX 11.0:
 
8290
   Because of some critical bugs in the standard HP-UX libraries, you
 
8291
   should install the following patches before trying to run MySQL on
 
8292
   HP-UX 11.0:
8564
8293
PHKL_22840 Streams cumulative
8565
8294
PHNE_22397 ARPA cumulative
8566
8295
 
8567
 
   This solves the problem of getting EWOULDBLOCK from recv()
8568
 
   and EBADF from accept() in threaded applications.
 
8296
   This solves the problem of getting EWOULDBLOCK from recv() and
 
8297
   EBADF from accept() in threaded applications.
8569
8298
 
8570
 
   If you are using gcc 2.95.1 on an unpatched HP-UX 11.x
8571
 
   system, you may get the following error:
 
8299
   If you are using gcc 2.95.1 on an unpatched HP-UX 11.x system, you
 
8300
   may get the following error:
8572
8301
In file included from /usr/include/unistd.h:11,
8573
8302
                 from ../include/global.h:125,
8574
8303
                 from mysql_priv.h:15,
8581
8310
 
8582
8311
   The problem is that HP-UX does not define pthreads_atfork()
8583
8312
   consistently. It has conflicting prototypes in
8584
 
   /usr/include/sys/unistd.h:184 and
8585
 
   /usr/include/sys/pthread.h:440.
 
8313
   /usr/include/sys/unistd.h:184 and /usr/include/sys/pthread.h:440.
8586
8314
 
8587
8315
   One solution is to copy /usr/include/sys/unistd.h into
8588
8316
   mysql/include and edit unistd.h and change it to match the
8591
8319
                                          void (*child)());
8592
8320
 
8593
8321
   Change it to look like this:
8594
 
extern int pthread_atfork(void (*prepare)(void), void (*parent)(void),
 
8322
extern int pthread_atfork(void (*prepare)(void), void (*parent)(void)
 
8323
,
8595
8324
                                          void (*child)(void));
8596
8325
 
8597
 
   After making the change, the following configure line should
8598
 
   work:
 
8326
   After making the change, the following configure line should work:
8599
8327
CFLAGS="-fomit-frame-pointer -O3 -fpic" CXX=gcc \
8600
8328
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -O3" \
8601
8329
./configure --prefix=/usr/local/mysql --disable-shared
8602
8330
 
8603
 
   If you are using HP-UX compiler, you can use the following
8604
 
   command (which has been tested with cc B.11.11.04):
 
8331
   If you are using HP-UX compiler, you can use the following command
 
8332
   (which has been tested with cc B.11.11.04):
8605
8333
CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure \
8606
8334
    --with-extra-character-set=complex
8607
8335
 
8609
8337
aCC: warning 901: unknown option: `-3': use +help for online
8610
8338
documentation
8611
8339
 
8612
 
   If you get the following error from configure, verify that
8613
 
   you don't have the path to the K&R compiler before the path
8614
 
   to the HP-UX C and C++ compiler:
 
8340
   If you get the following error from configure, verify that you
 
8341
   don't have the path to the K&R compiler before the path to the
 
8342
   HP-UX C and C++ compiler:
8615
8343
checking for cc option to accept ANSI C... no
8616
 
configure: error: MySQL requires an ANSI C compiler (and a C++ compile
8617
 
r).
 
8344
configure: error: MySQL requires an ANSI C compiler (and a C++ compil
 
8345
er).
8618
8346
Try gcc. See the Installation chapter in the Reference Manual.
8619
8347
 
8620
 
   Another reason for not being able to compile is that you
8621
 
   didn't define the +DD64 flags as just described.
 
8348
   Another reason for not being able to compile is that you didn't
 
8349
   define the +DD64 flags as just described.
8622
8350
 
8623
8351
   Another possibility for HP-UX 11 is to use the MySQL binaries
8624
 
   provided at http://dev.mysql.com/downloads/, which we have
8625
 
   built and tested ourselves. We have also received reports
8626
 
   that the HP-UX 10.20 binaries supplied by MySQL can be run
8627
 
   successfully on HP-UX 11. If you encounter problems, you
8628
 
   should be sure to check your HP-UX patch level.
8629
 
 
8630
 
2.14.5.3. IBM-AIX notes
8631
 
 
8632
 
   Automatic detection of xlC is missing from Autoconf, so a
8633
 
   number of variables need to be set before running configure.
8634
 
   The following example uses the IBM compiler:
 
8352
   provided at http://dev.mysql.com/downloads/, which we have built
 
8353
   and tested ourselves. We have also received reports that the HP-UX
 
8354
   10.20 binaries supplied by MySQL can be run successfully on HP-UX
 
8355
   11. If you encounter problems, you should be sure to check your
 
8356
   HP-UX patch level.
 
8357
 
 
8358
2.13.5.3. IBM-AIX notes
 
8359
 
 
8360
   Automatic detection of xlC is missing from Autoconf, so a number
 
8361
   of variables need to be set before running configure. The
 
8362
   following example uses the IBM compiler:
8635
8363
export CC="xlc_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192 "
8636
8364
export CXX="xlC_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192"
8637
8365
export CFLAGS="-I /usr/local/include"
8646
8374
                --enable-thread-safe-client \
8647
8375
                --enable-large-files
8648
8376
 
8649
 
   The preceding options are used to compile the MySQL
8650
 
   distribution that can be found at http://www-frec.bull.com/.
 
8377
   The preceding options are used to compile the MySQL distribution
 
8378
   that can be found at http://www-frec.bull.com/.
8651
8379
 
8652
 
   If you change the -O3 to -O2 in the preceding configure line,
8653
 
   you must also remove the -qstrict option. This is a
8654
 
   limitation in the IBM C compiler.
 
8380
   If you change the -O3 to -O2 in the preceding configure line, you
 
8381
   must also remove the -qstrict option. This is a limitation in the
 
8382
   IBM C compiler.
8655
8383
 
8656
8384
   If you are using gcc to compile MySQL, you must use the
8657
 
   -fno-exceptions flag, because the exception handling in gcc
8658
 
   is not thread-safe! There are also some known problems with
8659
 
   IBM's assembler that may cause it to generate bad code when
8660
 
   used with gcc.
 
8385
   -fno-exceptions flag, because the exception handling in gcc is not
 
8386
   thread-safe! There are also some known problems with IBM's
 
8387
   assembler that may cause it to generate bad code when used with
 
8388
   gcc.
8661
8389
 
8662
 
   We recommend the following configure line with gcc 2.95 on
8663
 
   AIX:
 
8390
   We recommend the following configure line with gcc 2.95 on AIX:
8664
8391
CC="gcc -pipe -mcpu=power -Wa,-many" \
8665
8392
CXX="gcc -pipe -mcpu=power -Wa,-many" \
8666
8393
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \
8667
8394
./configure --prefix=/usr/local/mysql --with-low-memory
8668
8395
 
8669
8396
   The -Wa,-many option is necessary for the compile to be
8670
 
   successful. IBM is aware of this problem but is in no hurry
8671
 
   to fix it because of the workaround that is available. We
8672
 
   don't know if the -fno-exceptions is required with gcc 2.95,
8673
 
   but because MySQL doesn't use exceptions and the option
8674
 
   generates faster code, we recommend that you should always
8675
 
   use it with gcc.
 
8397
   successful. IBM is aware of this problem but is in no hurry to fix
 
8398
   it because of the workaround that is available. We don't know if
 
8399
   the -fno-exceptions is required with gcc 2.95, but because MySQL
 
8400
   doesn't use exceptions and the option generates faster code, we
 
8401
   recommend that you should always use it with gcc.
8676
8402
 
8677
8403
   If you get a problem with assembler code, try changing the
8678
 
   -mcpu=xxx option to match your CPU. Typically power2, power,
8679
 
   or powerpc may need to be used. Alternatively, you might need
8680
 
   to use 604 or 604e. We are not positive but suspect that
8681
 
   power would likely be safe most of the time, even on a power2
8682
 
   machine.
8683
 
 
8684
 
   If you don't know what your CPU is, execute a uname -m
8685
 
   command. It produces a string that looks like 000514676700,
8686
 
   with a format of xxyyyyyymmss where xx and ss are always 00,
8687
 
   yyyyyy is a unique system ID and mm is the ID of the CPU
8688
 
   Planar. A chart of these values can be found at
8689
 
   http://www16.boulder.ibm.com/pseries/en_US/cmds/aixcmds5/unam
8690
 
   e.htm.
8691
 
 
8692
 
   This gives you a machine type and a machine model you can use
8693
 
   to determine what type of CPU you have.
8694
 
 
8695
 
   If you have problems with signals (MySQL dies unexpectedly
8696
 
   under high load), you may have found an OS bug with threads
8697
 
   and signals. In this case, you can tell MySQL not to use
8698
 
   signals by configuring as follows:
 
8404
   -mcpu=xxx option to match your CPU. Typically power2, power, or
 
8405
   powerpc may need to be used. Alternatively, you might need to use
 
8406
   604 or 604e. We are not positive but suspect that power would
 
8407
   likely be safe most of the time, even on a power2 machine.
 
8408
 
 
8409
   If you don't know what your CPU is, execute a uname -m command. It
 
8410
   produces a string that looks like 000514676700, with a format of
 
8411
   xxyyyyyymmss where xx and ss are always 00, yyyyyy is a unique
 
8412
   system ID and mm is the ID of the CPU Planar. A chart of these
 
8413
   values can be found at
 
8414
   http://www16.boulder.ibm.com/pseries/en_US/cmds/aixcmds5/uname.htm
 
8415
   .
 
8416
 
 
8417
   This gives you a machine type and a machine model you can use to
 
8418
   determine what type of CPU you have.
 
8419
 
 
8420
   If you have problems with signals (MySQL dies unexpectedly under
 
8421
   high load), you may have found an OS bug with threads and signals.
 
8422
   In this case, you can tell MySQL not to use signals by configuring
 
8423
   as follows:
8699
8424
CFLAGS=-DDONT_USE_THR_ALARM CXX=gcc \
8700
8425
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti \
8701
8426
-DDONT_USE_THR_ALARM" \
8702
8427
./configure --prefix=/usr/local/mysql --with-debug \
8703
8428
    --with-low-memory
8704
8429
 
8705
 
   This doesn't affect the performance of MySQL, but has the
8706
 
   side effect that you can't kill clients that are "sleeping"
8707
 
   on a connection with mysqladmin kill or mysqladmin shutdown.
8708
 
   Instead, the client dies when it issues its next command.
 
8430
   This doesn't affect the performance of MySQL, but has the side
 
8431
   effect that you can't kill clients that are "sleeping" on a
 
8432
   connection with mysqladmin kill or mysqladmin shutdown. Instead,
 
8433
   the client dies when it issues its next command.
8709
8434
 
8710
8435
   On some versions of AIX, linking with libbind.a makes
8711
8436
   getservbyname() dump core. This is an AIX bug and should be
8712
8437
   reported to IBM.
8713
8438
 
8714
 
   For AIX 4.2.1 and gcc, you have to make the following
8715
 
   changes.
 
8439
   For AIX 4.2.1 and gcc, you have to make the following changes.
8716
8440
 
8717
8441
   After configuring, edit config.h and include/my_config.h and
8718
8442
   change the line that says this:
8727
8451
extern "C" int initgroups(const char *,int);
8728
8452
#endif
8729
8453
 
8730
 
   For 32-bit binaries, if you need to allocate a lot of memory
8731
 
   to the mysqld process, it's not enough to just use ulimit -d
8732
 
   unlimited. You may also have to modify mysqld_safe to add a
8733
 
   line something like this:
 
8454
   For 32-bit binaries, if you need to allocate a lot of memory to
 
8455
   the mysqld process, it is not enough to just use ulimit -d
 
8456
   unlimited. You may also have to modify mysqld_safe to add a line
 
8457
   something like this:
8734
8458
export LDR_CNTRL='MAXDATA=0x80000000'
8735
8459
 
8736
8460
   You can find more information about using a lot of memory at
8737
 
   http://publib16.boulder.ibm.com/pseries/en_US/aixprggd/genpro
8738
 
   gc/lrg_prg_support.htm.
 
8461
   http://publib16.boulder.ibm.com/pseries/en_US/aixprggd/genprogc/lr
 
8462
   g_prg_support.htm.
8739
8463
 
8740
8464
   Users of AIX 4.3 should use gmake instead of the make utility
8741
8465
   included with AIX.
8742
8466
 
8743
 
   As of AIX 4.1, the C compiler has been unbundled from AIX as
8744
 
   a separate product. We recommend using gcc 3.3.2, which can
8745
 
   be obtained here:
8746
 
   ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/p
8747
 
   pc/gcc/
 
8467
   As of AIX 4.1, the C compiler has been unbundled from AIX as a
 
8468
   separate product. We recommend using gcc 3.3.2, which can be
 
8469
   obtained here:
 
8470
   ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gc
 
8471
   c/
8748
8472
 
8749
 
   The steps for compiling MySQL on AIX with gcc 3.3.2 are
8750
 
   similar to those for using gcc 2.95 (in particular, the need
8751
 
   to edit config.h and my_config.h after running configure).
8752
 
   However, before running configure, you should also patch the
8753
 
   curses.h file as follows:
8754
 
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/curses.
8755
 
h.ORIG
 
8473
   The steps for compiling MySQL on AIX with gcc 3.3.2 are similar to
 
8474
   those for using gcc 2.95 (in particular, the need to edit config.h
 
8475
   and my_config.h after running configure). However, before running
 
8476
   configure, you should also patch the curses.h file as follows:
 
8477
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/curses
 
8478
.h.ORIG
8756
8479
       Mon Dec 26 02:17:28 2005
8757
 
--- /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/cur
8758
 
ses.h
 
8480
--- /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/cu
 
8481
rses.h
8759
8482
Mon Dec 26 02:40:13 2005
8760
8483
***************
8761
8484
*** 2023,2029 ****
8762
8485
 
8763
8486
 
8764
8487
  #endif /* _AIX32_CURSES */
8765
 
! #if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || def
8766
 
ined
 
8488
! #if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || de
 
8489
fined
8767
8490
(__STRICT_ANSI__)
8768
8491
  extern int delwin (WINDOW *);
8769
8492
  extern int endwin (void);
8779
8502
  extern int endwin (void);
8780
8503
  extern int getcurx (WINDOW *);
8781
8504
 
8782
 
2.14.5.4. SunOS 4 Notes
 
8505
2.13.5.4. SunOS 4 Notes
8783
8506
 
8784
 
   On SunOS 4, MIT-pthreads is needed to compile MySQL. This in
8785
 
   turn means you need GNU make.
 
8507
   On SunOS 4, MIT-pthreads is needed to compile MySQL. This in turn
 
8508
   means you need GNU make.
8786
8509
 
8787
8510
   Some SunOS 4 systems have problems with dynamic libraries and
8788
 
   libtool. You can use the following configure line to avoid
8789
 
   this problem:
 
8511
   libtool. You can use the following configure line to avoid this
 
8512
   problem:
8790
8513
./configure --disable-shared --with-mysqld-ldflags=-all-static
8791
8514
 
8792
8515
   When compiling readline, you may get warnings about duplicate
8795
8518
   When compiling mysqld, there are some implicit declaration of
8796
8519
   function warnings. These can be ignored.
8797
8520
 
8798
 
2.14.5.5. Alpha-DEC-UNIX Notes (Tru64)
 
8521
2.13.5.5. Alpha-DEC-UNIX Notes (Tru64)
8799
8522
 
8800
 
   If you are using egcs 1.1.2 on Digital Unix, you should
8801
 
   upgrade to gcc 2.95.2, because egcs on DEC has some serious
8802
 
   bugs!
 
8523
   If you are using egcs 1.1.2 on Digital Unix, you should upgrade to
 
8524
   gcc 2.95.2, because egcs on DEC has some serious bugs!
8803
8525
 
8804
8526
   When compiling threaded programs under Digital Unix, the
8805
 
   documentation recommends using the -pthread option for cc and
8806
 
   cxx and the -lmach -lexc libraries (in addition to
8807
 
   -lpthread). You should run configure something like this:
 
8527
   documentation recommends using the -pthread option for cc and cxx
 
8528
   and the -lmach -lexc libraries (in addition to -lpthread). You
 
8529
   should run configure something like this:
8808
8530
CC="cc -pthread" CXX="cxx -pthread -O" \
8809
8531
./configure --with-named-thread-libs="-lpthread -lmach -lexc -lc"
8810
8532
 
8811
 
   When compiling mysqld, you may see a couple of warnings like
8812
 
   this:
 
8533
   When compiling mysqld, you may see a couple of warnings like this:
8813
8534
mysqld.cc: In function void handle_connections()':
8814
8535
mysqld.cc:626: passing long unsigned int *' as argument 3 of
8815
8536
accept(int,sockadddr *, int *)'
8816
8537
 
8817
 
   You can safely ignore these warnings. They occur because
8818
 
   configure can detect only errors, not warnings.
 
8538
   You can safely ignore these warnings. They occur because configure
 
8539
   can detect only errors, not warnings.
8819
8540
 
8820
 
   If you start the server directly from the command line, you
8821
 
   may have problems with it dying when you log out. (When you
8822
 
   log out, your outstanding processes receive a SIGHUP signal.)
8823
 
   If so, try starting the server like this:
 
8541
   If you start the server directly from the command line, you may
 
8542
   have problems with it dying when you log out. (When you log out,
 
8543
   your outstanding processes receive a SIGHUP signal.) If so, try
 
8544
   starting the server like this:
8824
8545
nohup mysqld [options] &
8825
8546
 
8826
 
   nohup causes the command following it to ignore any SIGHUP
8827
 
   signal sent from the terminal. Alternatively, start the
8828
 
   server by running mysqld_safe, which invokes mysqld using
8829
 
   nohup for you. See Section 4.3.2, "mysqld_safe --- MySQL
8830
 
   Server Startup Script."
8831
 
 
8832
 
   If you get a problem when compiling mysys/get_opt.c, just
8833
 
   remove the #define _NO_PROTO line from the start of that
8834
 
   file.
8835
 
 
8836
 
   If you are using Compaq's CC compiler, the following
8837
 
   configure line should work:
 
8547
   nohup causes the command following it to ignore any SIGHUP signal
 
8548
   sent from the terminal. Alternatively, start the server by running
 
8549
   mysqld_safe, which invokes mysqld using nohup for you. See Section
 
8550
   4.3.2, "mysqld_safe --- MySQL Server Startup Script."
 
8551
 
 
8552
   If you get a problem when compiling mysys/get_opt.c, just remove
 
8553
   the #define _NO_PROTO line from the start of that file.
 
8554
 
 
8555
   If you are using Compaq's CC compiler, the following configure
 
8556
   line should work:
8838
8557
CC="cc -pthread"
8839
8558
CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed \
8840
8559
        -speculate all -arch host"
8851
8570
gnumake
8852
8571
 
8853
8572
   If you get a problem with libtool when compiling with shared
8854
 
   libraries as just shown, when linking mysql, you should be
8855
 
   able to get around this by issuing these commands:
 
8573
   libraries as just shown, when linking mysql, you should be able to
 
8574
   get around this by issuing these commands:
8856
8575
cd mysql
8857
8576
/bin/sh ../libtool --mode=link cxx -pthread  -O3 -DDBUG_OFF \
8858
8577
    -O4 -ansi_alias -ansi_args -fast -inline speed \
8865
8584
gnumake install
8866
8585
scripts/mysql_install_db
8867
8586
 
8868
 
2.14.5.6. Alpha-DEC-OSF/1 Notes
 
8587
2.13.5.6. Alpha-DEC-OSF/1 Notes
8869
8588
 
8870
 
   If you have problems compiling and have DEC CC and gcc
8871
 
   installed, try running configure like this:
 
8589
   If you have problems compiling and have DEC CC and gcc installed,
 
8590
   try running configure like this:
8872
8591
CC=cc CFLAGS=-O CXX=gcc CXXFLAGS=-O3 \
8873
8592
./configure --prefix=/usr/local/mysql
8874
8593
 
8875
 
   If you get problems with the c_asm.h file, you can create and
8876
 
   use a 'dummy' c_asm.h file with:
 
8594
   If you get problems with the c_asm.h file, you can create and use
 
8595
   a 'dummy' c_asm.h file with:
8877
8596
touch include/c_asm.h
8878
8597
CC=gcc CFLAGS=-I./include \
8879
8598
CXX=gcc CXXFLAGS=-O3 \
8880
8599
./configure --prefix=/usr/local/mysql
8881
8600
 
8882
 
   Note that the following problems with the ld program can be
8883
 
   fixed by downloading the latest DEC (Compaq) patch kit from:
 
8601
   Note that the following problems with the ld program can be fixed
 
8602
   by downloading the latest DEC (Compaq) patch kit from:
8884
8603
   http://ftp.support.compaq.com/public/unix/.
8885
8604
 
8886
 
   On OSF/1 V4.0D and compiler "DEC C V5.6-071 on Digital Unix
8887
 
   V4.0 (Rev. 878)," the compiler had some strange behavior
8888
 
   (undefined asm symbols). /bin/ld also appears to be broken
8889
 
   (problems with _exit undefined errors occurring while linking
8890
 
   mysqld). On this system, we have managed to compile MySQL
8891
 
   with the following configure line, after replacing /bin/ld
8892
 
   with the version from OSF 4.0C:
 
8605
   On OSF/1 V4.0D and compiler "DEC C V5.6-071 on Digital Unix V4.0
 
8606
   (Rev. 878)," the compiler had some strange behavior (undefined asm
 
8607
   symbols). /bin/ld also appears to be broken (problems with _exit
 
8608
   undefined errors occurring while linking mysqld). On this system,
 
8609
   we have managed to compile MySQL with the following configure
 
8610
   line, after replacing /bin/ld with the version from OSF 4.0C:
8893
8611
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
8894
8612
 
8895
 
   With the Digital compiler "C++ V6.1-029," the following
8896
 
   should work:
 
8613
   With the Digital compiler "C++ V6.1-029," the following should
 
8614
   work:
8897
8615
CC=cc -pthread
8898
8616
CFLAGS=-O4 -ansi_alias -ansi_args -fast -inline speed \
8899
8617
       -speculate all -arch host
8905
8623
            --with-mysqld-ldflags=-all-static --disable-shared \
8906
8624
            --with-named-thread-libs="-lmach -lexc -lc"
8907
8625
 
8908
 
   In some versions of OSF/1, the alloca() function is broken.
8909
 
   Fix this by removing the line in config.h that defines
8910
 
   'HAVE_ALLOCA'.
 
8626
   In some versions of OSF/1, the alloca() function is broken. Fix
 
8627
   this by removing the line in config.h that defines 'HAVE_ALLOCA'.
8911
8628
 
8912
8629
   The alloca() function also may have an incorrect prototype in
8913
 
   /usr/include/alloca.h. This warning resulting from this can
8914
 
   be ignored.
 
8630
   /usr/include/alloca.h. This warning resulting from this can be
 
8631
   ignored.
8915
8632
 
8916
8633
   configure uses the following thread libraries automatically:
8917
8634
   --with-named-thread-libs="-lpthread -lmach -lexc -lc".
8919
8636
   When using gcc, you can also try running configure like this:
8920
8637
CFLAGS=-D_PTHREAD_USE_D4 CXX=gcc CXXFLAGS=-O3 ./configure ...
8921
8638
 
8922
 
   If you have problems with signals (MySQL dies unexpectedly
8923
 
   under high load), you may have found an OS bug with threads
8924
 
   and signals. In this case, you can tell MySQL not to use
8925
 
   signals by configuring with:
 
8639
   If you have problems with signals (MySQL dies unexpectedly under
 
8640
   high load), you may have found an OS bug with threads and signals.
 
8641
   In this case, you can tell MySQL not to use signals by configuring
 
8642
   with:
8926
8643
CFLAGS=-DDONT_USE_THR_ALARM \
8927
8644
CXXFLAGS=-DDONT_USE_THR_ALARM \
8928
8645
./configure ...
8929
8646
 
8930
 
   This does not affect the performance of MySQL, but has the
8931
 
   side effect that you can't kill clients that are "sleeping"
8932
 
   on a connection with mysqladmin kill or mysqladmin shutdown.
8933
 
   Instead, the client dies when it issues its next command.
 
8647
   This does not affect the performance of MySQL, but has the side
 
8648
   effect that you can't kill clients that are "sleeping" on a
 
8649
   connection with mysqladmin kill or mysqladmin shutdown. Instead,
 
8650
   the client dies when it issues its next command.
8934
8651
 
8935
 
   With gcc 2.95.2, you may encounter the following compile
8936
 
   error:
 
8652
   With gcc 2.95.2, you may encounter the following compile error:
8937
8653
sql_acl.cc:1456: Internal compiler error in `scan_region',
8938
8654
at except.c:2566
8939
8655
Please submit a full bug report.
8940
8656
 
8941
8657
   To fix this, you should change to the sql directory and do a
8942
 
   cut-and-paste of the last gcc line, but change -O3 to -O0 (or
8943
 
   add -O0 immediately after gcc if you don't have any -O option
8944
 
   on your compile line). After this is done, you can just
8945
 
   change back to the top-level directory and run make again.
 
8658
   cut-and-paste of the last gcc line, but change -O3 to -O0 (or add
 
8659
   -O0 immediately after gcc if you don't have any -O option on your
 
8660
   compile line). After this is done, you can just change back to the
 
8661
   top-level directory and run make again.
8946
8662
 
8947
 
2.14.5.7. SGI Irix Notes
 
8663
2.13.5.7. SGI Irix Notes
8948
8664
 
8949
8665
   As of MySQL 5.0, we don't provide binaries for Irix any more.
8950
8666
 
8951
 
   If you are using Irix 6.5.3 or newer, mysqld is able to
8952
 
   create threads only if you run it as a user that has
8953
 
   CAP_SCHED_MGT privileges (such as root) or give the mysqld
8954
 
   server this privilege with the following shell command:
 
8667
   If you are using Irix 6.5.3 or newer, mysqld is able to create
 
8668
   threads only if you run it as a user that has CAP_SCHED_MGT
 
8669
   privileges (such as root) or give the mysqld server this privilege
 
8670
   with the following shell command:
8955
8671
chcap "CAP_SCHED_MGT+epi" /opt/mysql/libexec/mysqld
8956
8672
 
8957
 
   You may have to undefine some symbols in config.h after
8958
 
   running configure and before compiling.
8959
 
 
8960
 
   In some Irix implementations, the alloca() function is
8961
 
   broken. If the mysqld server dies on some SELECT statements,
8962
 
   remove the lines from config.h that define HAVE_ALLOC and
8963
 
   HAVE_ALLOCA_H. If mysqladmin create doesn't work, remove the
8964
 
   line from config.h that defines HAVE_READDIR_R. You may have
8965
 
   to remove the HAVE_TERM_H line as well.
8966
 
 
8967
 
   SGI recommends that you install all the patches on this page
8968
 
   as a set:
8969
 
   http://support.sgi.com/surfzone/patches/patchset/6.2_indigo.r
8970
 
   ps.html
8971
 
 
8972
 
   At the very minimum, you should install the latest kernel
8973
 
   rollup, the latest rld rollup, and the latest libc rollup.
 
8673
   You may have to undefine some symbols in config.h after running
 
8674
   configure and before compiling.
 
8675
 
 
8676
   In some Irix implementations, the alloca() function is broken. If
 
8677
   the mysqld server dies on some SELECT statements, remove the lines
 
8678
   from config.h that define HAVE_ALLOC and HAVE_ALLOCA_H. If
 
8679
   mysqladmin create doesn't work, remove the line from config.h that
 
8680
   defines HAVE_READDIR_R. You may have to remove the HAVE_TERM_H
 
8681
   line as well.
 
8682
 
 
8683
   SGI recommends that you install all the patches on this page as a
 
8684
   set:
 
8685
   http://support.sgi.com/surfzone/patches/patchset/6.2_indigo.rps.ht
 
8686
   ml
 
8687
 
 
8688
   At the very minimum, you should install the latest kernel rollup,
 
8689
   the latest rld rollup, and the latest libc rollup.
8974
8690
 
8975
8691
   You definitely need all the POSIX patches on this page, for
8976
8692
   pthreads support:
8977
8693
 
8978
 
   http://support.sgi.com/surfzone/patches/patchset/6.2_posix.rp
8979
 
   s.html
 
8694
   http://support.sgi.com/surfzone/patches/patchset/6.2_posix.rps.htm
 
8695
   l
8980
8696
 
8981
 
   If you get the something like the following error when
8982
 
   compiling mysql.cc:
 
8697
   If you get the something like the following error when compiling
 
8698
   mysql.cc:
8983
8699
"/usr/include/curses.h", line 82: error(1084):
8984
8700
invalid combination of type
8985
8701
 
8986
 
   Type the following in the top-level directory of your MySQL
8987
 
   source tree:
8988
 
extra/replace bool curses_bool < /usr/include/curses.h > include/curse
8989
 
s.h
 
8702
   Type the following in the top-level directory of your MySQL source
 
8703
   tree:
 
8704
extra/replace bool curses_bool < /usr/include/curses.h > include/curs
 
8705
es.h
8990
8706
make
8991
8707
 
8992
 
   There have also been reports of scheduling problems. If only
8993
 
   one thread is running, performance is slow. Avoid this by
8994
 
   starting another client. This may lead to a two-to-tenfold
8995
 
   increase in execution speed thereafter for the other thread.
8996
 
   This is a poorly understood problem with Irix threads; you
8997
 
   may have to improvise to find solutions until this can be
8998
 
   fixed.
 
8708
   There have also been reports of scheduling problems. If only one
 
8709
   thread is running, performance is slow. Avoid this by starting
 
8710
   another client. This may lead to a two-to-tenfold increase in
 
8711
   execution speed thereafter for the other thread. This is a poorly
 
8712
   understood problem with Irix threads; you may have to improvise to
 
8713
   find solutions until this can be fixed.
8999
8714
 
9000
 
   If you are compiling with gcc, you can use the following
9001
 
   configure command:
 
8715
   If you are compiling with gcc, you can use the following configure
 
8716
   command:
9002
8717
CC=gcc CXX=gcc CXXFLAGS=-O3 \
9003
8718
./configure --prefix=/usr/local/mysql --enable-thread-safe-client \
9004
8719
    --with-named-thread-libs=-lpthread
9005
8720
 
9006
 
   On Irix 6.5.11 with native Irix C and C++ compilers ver.
9007
 
   7.3.1.2, the following is reported to work
9008
 
CC=cc CXX=CC CFLAGS='-O3 -n32 -TARG:platform=IP22 -I/usr/local/include
9009
 
 \
 
8721
   On Irix 6.5.11 with native Irix C and C++ compilers ver. 7.3.1.2,
 
8722
   the following is reported to work
 
8723
CC=cc CXX=CC CFLAGS='-O3 -n32 -TARG:platform=IP22 -I/usr/local/includ
 
8724
e \
9010
8725
-L/usr/local/lib' CXXFLAGS='-O3 -n32 -TARG:platform=IP22 \
9011
8726
-I/usr/local/include -L/usr/local/lib' \
9012
8727
./configure --prefix=/usr/local/mysql --with-innodb \
9013
8728
    --with-libwrap=/usr/local \
9014
8729
    --with-named-curses-libs=/usr/local/lib/libncurses.a
9015
8730
 
9016
 
2.14.5.8. SCO UNIX and OpenServer 5.0.x Notes
9017
 
 
9018
 
   The current port is tested only on sco3.2v5.0.5,
9019
 
   sco3.2v5.0.6, and sco3.2v5.0.7 systems. There has also been
9020
 
   progress on a port to sco3.2v4.2. Open Server 5.0.8 (Legend)
9021
 
   has native threads and allows files greater than 2GB. The
9022
 
   current maximum file size is 2GB.
9023
 
 
9024
 
   We have been able to compile MySQL with the following
9025
 
   configure command on OpenServer with gcc 2.95.3.
 
8731
2.13.5.8. SCO UNIX and OpenServer 5.0.x Notes
 
8732
 
 
8733
   The current port is tested only on sco3.2v5.0.5, sco3.2v5.0.6, and
 
8734
   sco3.2v5.0.7 systems. There has also been progress on a port to
 
8735
   sco3.2v4.2. Open Server 5.0.8 (Legend) has native threads and
 
8736
   allows files greater than 2GB. The current maximum file size is
 
8737
   2GB.
 
8738
 
 
8739
   We have been able to compile MySQL with the following configure
 
8740
   command on OpenServer with gcc 2.95.3.
9026
8741
CC=gcc CFLAGS="-D_FILE_OFFSET_BITS=64 -O3" \
9027
8742
CXX=gcc CXXFLAGS="-D_FILE_OFFSET_BITS=64 -O3" \
9028
8743
./configure --prefix=/usr/local/mysql \
9033
8748
   ftp://ftp.sco.com/pub/openserver5/opensrc/gnutools-5.0.7Kj.
9034
8749
 
9035
8750
   This development system requires the OpenServer Execution
9036
 
   Environment Supplement oss646B on OpenServer 5.0.6 and
9037
 
   oss656B and The OpenSource libraries found in gwxlibs. All
9038
 
   OpenSource tools are in the opensrc directory. They are
9039
 
   available at ftp://ftp.sco.com/pub/openserver5/opensrc/.
 
8751
   Environment Supplement oss646B on OpenServer 5.0.6 and oss656B and
 
8752
   The OpenSource libraries found in gwxlibs. All OpenSource tools
 
8753
   are in the opensrc directory. They are available at
 
8754
   ftp://ftp.sco.com/pub/openserver5/opensrc/.
9040
8755
 
9041
8756
   We recommend using the latest production release of MySQL.
9042
8757
 
9043
8758
   SCO provides operating system patches at
9044
 
   ftp://ftp.sco.com/pub/openserver5 for OpenServer 5.0.[0-6]
9045
 
   and ftp://ftp.sco.com/pub/openserverv5/507 for OpenServer
9046
 
   5.0.7.
 
8759
   ftp://ftp.sco.com/pub/openserver5 for OpenServer 5.0.[0-6] and
 
8760
   ftp://ftp.sco.com/pub/openserverv5/507 for OpenServer 5.0.7.
9047
8761
 
9048
8762
   SCO provides information about security fixes at
9049
 
   ftp://ftp.sco.com/pub/security/OpenServer for OpenServer
9050
 
   5.0.x.
 
8763
   ftp://ftp.sco.com/pub/security/OpenServer for OpenServer 5.0.x.
9051
8764
 
9052
8765
   The maximum file size on an OpenServer 5.0.x system is 2GB.
9053
8766
 
9054
8767
   The total memory which can be allocated for streams buffers,
9055
 
   clists, and lock records cannot exceed 60MB on OpenServer
9056
 
   5.0.x.
 
8768
   clists, and lock records cannot exceed 60MB on OpenServer 5.0.x.
9057
8769
 
9058
 
   Streams buffers are allocated in units of 4096 byte pages,
9059
 
   clists are 70 bytes each, and lock records are 64 bytes each,
9060
 
   so:
 
8770
   Streams buffers are allocated in units of 4096 byte pages, clists
 
8771
   are 70 bytes each, and lock records are 64 bytes each, so:
9061
8772
(NSTRPAGES x 4096) + (NCLIST x 70) + (MAX_FLCKREC x 64) <= 62914560
9062
8773
 
9063
 
   Follow this procedure to configure the Database Services
9064
 
   option. If you are unsure whether an application requires
9065
 
   this, see the documentation provided with the application.
 
8774
   Follow this procedure to configure the Database Services option.
 
8775
   If you are unsure whether an application requires this, see the
 
8776
   documentation provided with the application.
9066
8777
 
9067
8778
    1. Log in as root.
9068
8779
 
9069
 
    2. Enable the SUDS driver by editing the
9070
 
       /etc/conf/sdevice.d/suds file. Change the N in the second
9071
 
       field to a Y.
 
8780
    2. Enable the SUDS driver by editing the /etc/conf/sdevice.d/suds
 
8781
       file. Change the N in the second field to a Y.
9072
8782
 
9073
 
    3. Use mkdev aio or the Hardware/Kernel Manager to enable
9074
 
       support for asynchronous I/O and relink the kernel. To
9075
 
       allow users to lock down memory for use with this type of
9076
 
       I/O, update the aiomemlock(F) file. This file should be
9077
 
       updated to include the names of users that can use AIO
9078
 
       and the maximum amounts of memory they can lock down.
 
8783
    3. Use mkdev aio or the Hardware/Kernel Manager to enable support
 
8784
       for asynchronous I/O and relink the kernel. To allow users to
 
8785
       lock down memory for use with this type of I/O, update the
 
8786
       aiomemlock(F) file. This file should be updated to include the
 
8787
       names of users that can use AIO and the maximum amounts of
 
8788
       memory they can lock down.
9079
8789
 
9080
8790
    4. Many applications use setuid binaries so that you need to
9081
 
       specify only a single user. See the documentation
9082
 
       provided with the application to determine whether this
9083
 
       is the case for your application.
 
8791
       specify only a single user. See the documentation provided
 
8792
       with the application to determine whether this is the case for
 
8793
       your application.
9084
8794
 
9085
 
   After you complete this process, reboot the system to create
9086
 
   a new kernel incorporating these changes.
 
8795
   After you complete this process, reboot the system to create a new
 
8796
   kernel incorporating these changes.
9087
8797
 
9088
8798
   By default, the entries in /etc/conf/cf.d/mtune are set as
9089
8799
   follows:
9147
8857
     * MAXUP should be 2048.
9148
8858
 
9149
8859
   To make changes to the kernel, use the idtune name parameter
9150
 
   command. idtune modifies the /etc/conf/cf.d/stune file for
9151
 
   you. For example, to change SEMMS to 200, execute this
9152
 
   command as root:
 
8860
   command. idtune modifies the /etc/conf/cf.d/stune file for you.
 
8861
   For example, to change SEMMS to 200, execute this command as root:
9153
8862
# /etc/conf/bin/idtune SEMMNS 200
9154
8863
 
9155
8864
   Then rebuild and reboot the kernel by issuing this command:
9156
8865
# /etc/conf/bin/idbuild -B && init 6
9157
8866
 
9158
 
   We recommend tuning the system, but the proper parameter
9159
 
   values to use depend on the number of users accessing the
9160
 
   application or database and size the of the database (that
9161
 
   is, the used buffer pool). The following kernel parameters
9162
 
   can be set with idtune:
 
8867
   We recommend tuning the system, but the proper parameter values to
 
8868
   use depend on the number of users accessing the application or
 
8869
   database and size the of the database (that is, the used buffer
 
8870
   pool). The following kernel parameters can be set with idtune:
9163
8871
 
9164
 
     * SHMMAX (recommended setting: 128MB) and SHMSEG
9165
 
       (recommended setting: 15). These parameters have an
9166
 
       influence on the MySQL database engine to create user
9167
 
       buffer pools.
 
8872
     * SHMMAX (recommended setting: 128MB) and SHMSEG (recommended
 
8873
       setting: 15). These parameters have an influence on the MySQL
 
8874
       database engine to create user buffer pools.
9168
8875
 
9169
8876
     * NOFILES and MAXUP should be set to at least 2048.
9170
8877
 
9171
 
     * MAXPROC should be set to at least 3000/4000 (depends on
9172
 
       number of users) or more.
 
8878
     * MAXPROC should be set to at least 3000/4000 (depends on number
 
8879
       of users) or more.
9173
8880
 
9174
 
     * We also recommend using the following formulas to
9175
 
       calculate values for SEMMSL, SEMMNS, and SEMMNU:
 
8881
     * We also recommend using the following formulas to calculate
 
8882
       values for SEMMSL, SEMMNS, and SEMMNU:
9176
8883
SEMMSL = 13
9177
 
 
9178
 
       13 is what has been found to be the best for both
9179
 
       Progress and MySQL.
 
8884
       13 is what has been found to be the best for both Progress and
 
8885
       MySQL.
9180
8886
SEMMNS = SEMMSL x number of db servers to be run on the system
9181
 
 
9182
 
       Set SEMMNS to the value of SEMMSL multiplied by the
9183
 
       number of database servers (maximum) that you are running
9184
 
       on the system at one time.
 
8887
       Set SEMMNS to the value of SEMMSL multiplied by the number of
 
8888
       database servers (maximum) that you are running on the system
 
8889
       at one time.
9185
8890
SEMMNU = SEMMNS
9186
 
 
9187
8891
       Set the value of SEMMNU to equal the value of SEMMNS. You
9188
8892
       could probably set this to 75% of SEMMNS, but this is a
9189
8893
       conservative estimate.
9190
8894
 
9191
8895
   You need to at least install the SCO OpenServer Linker and
9192
 
   Application Development Libraries or the OpenServer
9193
 
   Development System to use gcc. You cannot use the GCC Dev
9194
 
   system without installing one of these.
 
8896
   Application Development Libraries or the OpenServer Development
 
8897
   System to use gcc. You cannot use the GCC Dev system without
 
8898
   installing one of these.
9195
8899
 
9196
 
   You should get the FSU Pthreads package and install it first.
9197
 
   This can be found at
9198
 
   http://moss.csc.ncsu.edu/~mueller/ftp/pub/PART/pthreads.tar.g
9199
 
   z. You can also get a precompiled package from
 
8900
   You should get the FSU Pthreads package and install it first. This
 
8901
   can be found at
 
8902
   http://moss.csc.ncsu.edu/~mueller/ftp/pub/PART/pthreads.tar.gz.
 
8903
   You can also get a precompiled package from
9200
8904
   ftp://ftp.zenez.com/pub/zenez/prgms/FSU-threads-3.14.tar.gz.
9201
8905
 
9202
8906
   FSU Pthreads can be compiled with SCO Unix 4.2 with tcpip, or
9203
 
   using OpenServer 3.0 or Open Desktop 3.0 (OS 3.0 ODT 3.0)
9204
 
   with the SCO Development System installed using a good port
9205
 
   of GCC 2.5.x. For ODT or OS 3.0, you need a good port of GCC
9206
 
   2.5.x. There are a lot of problems without a good port. The
9207
 
   port for this product requires the SCO Unix Development
9208
 
   system. Without it, you are missing the libraries and the
9209
 
   linker that is needed. You also need
9210
 
   SCO-3.2v4.2-includes.tar.gz. This file contains the changes
9211
 
   to the SCO Development include files that are needed to get
9212
 
   MySQL to build. You need to replace the existing system
9213
 
   include files with these modified header files. They can be
9214
 
   obtained from
9215
 
   ftp://ftp.zenez.com/pub/zenez/prgms/SCO-3.2v4.2-includes.tar.
9216
 
   gz.
9217
 
 
9218
 
   To build FSU Pthreads on your system, all you should need to
9219
 
   do is run GNU make. The Makefile in FSU-threads-3.14.tar.gz
9220
 
   is set up to make FSU-threads.
9221
 
 
9222
 
   You can run ./configure in the threads/src directory and
9223
 
   select the SCO OpenServer option. This command copies
9224
 
   Makefile.SCO5 to Makefile. Then run make.
9225
 
 
9226
 
   To install in the default /usr/include directory, log in as
9227
 
   root, and then cd to the thread/src directory and run make
9228
 
   install.
 
8907
   using OpenServer 3.0 or Open Desktop 3.0 (OS 3.0 ODT 3.0) with the
 
8908
   SCO Development System installed using a good port of GCC 2.5.x.
 
8909
   For ODT or OS 3.0, you need a good port of GCC 2.5.x. There are a
 
8910
   lot of problems without a good port. The port for this product
 
8911
   requires the SCO Unix Development system. Without it, you are
 
8912
   missing the libraries and the linker that is needed. You also need
 
8913
   SCO-3.2v4.2-includes.tar.gz. This file contains the changes to the
 
8914
   SCO Development include files that are needed to get MySQL to
 
8915
   build. You need to replace the existing system include files with
 
8916
   these modified header files. They can be obtained from
 
8917
   ftp://ftp.zenez.com/pub/zenez/prgms/SCO-3.2v4.2-includes.tar.gz.
 
8918
 
 
8919
   To build FSU Pthreads on your system, all you should need to do is
 
8920
   run GNU make. The Makefile in FSU-threads-3.14.tar.gz is set up to
 
8921
   make FSU-threads.
 
8922
 
 
8923
   You can run ./configure in the threads/src directory and select
 
8924
   the SCO OpenServer option. This command copies Makefile.SCO5 to
 
8925
   Makefile. Then run make.
 
8926
 
 
8927
   To install in the default /usr/include directory, log in as root,
 
8928
   and then cd to the thread/src directory and run make install.
9229
8929
 
9230
8930
   Remember that you must use GNU make to build MySQL.
9231
8931
 
9232
8932
Note
9233
8933
 
9234
 
   If you don't start mysqld_safe as root, you should get only
9235
 
   the default 110 open files per process. mysqld writes a note
9236
 
   about this in the log file.
 
8934
   If you don't start mysqld_safe as root, you should get only the
 
8935
   default 110 open files per process. mysqld writes a note about
 
8936
   this in the log file.
9237
8937
 
9238
8938
   With SCO 3.2V4.2, you should use FSU Pthreads version 3.14 or
9239
8939
   newer. The following configure command should work:
9243
8943
    --with-named-thread-libs="-lgthreads -lsocket -lgen -lgthreads" \
9244
8944
    --with-named-curses-libs="-lcurses"
9245
8945
 
9246
 
   You may have problems with some include files. In this case,
9247
 
   you can find new SCO-specific include files at
9248
 
   ftp://ftp.zenez.com/pub/zenez/prgms/SCO-3.2v4.2-includes.tar.
9249
 
   gz.
 
8946
   You may have problems with some include files. In this case, you
 
8947
   can find new SCO-specific include files at
 
8948
   ftp://ftp.zenez.com/pub/zenez/prgms/SCO-3.2v4.2-includes.tar.gz.
9250
8949
 
9251
 
   You should unpack this file in the include directory of your
9252
 
   MySQL source tree.
 
8950
   You should unpack this file in the include directory of your MySQL
 
8951
   source tree.
9253
8952
 
9254
8953
   SCO development notes:
9255
8954
 
9256
 
     * MySQL should automatically detect FSU Pthreads and link
9257
 
       mysqld with -lgthreads -lsocket -lgthreads.
9258
 
 
9259
 
     * The SCO development libraries are re-entrant in FSU
9260
 
       Pthreads. SCO claims that its library functions are
9261
 
       re-entrant, so they must be re-entrant with FSU Pthreads.
9262
 
       FSU Pthreads on OpenServer tries to use the SCO scheme to
9263
 
       make re-entrant libraries.
9264
 
 
9265
 
     * FSU Pthreads (at least the version at
9266
 
       ftp://ftp.zenez.com) comes linked with GNU malloc. If you
9267
 
       encounter problems with memory usage, make sure that
9268
 
       gmalloc.o is included in libgthreads.a and
9269
 
       libgthreads.so.
 
8955
     * MySQL should automatically detect FSU Pthreads and link mysqld
 
8956
       with -lgthreads -lsocket -lgthreads.
 
8957
 
 
8958
     * The SCO development libraries are re-entrant in FSU Pthreads.
 
8959
       SCO claims that its library functions are re-entrant, so they
 
8960
       must be re-entrant with FSU Pthreads. FSU Pthreads on
 
8961
       OpenServer tries to use the SCO scheme to make re-entrant
 
8962
       libraries.
 
8963
 
 
8964
     * FSU Pthreads (at least the version at ftp://ftp.zenez.com)
 
8965
       comes linked with GNU malloc. If you encounter problems with
 
8966
       memory usage, make sure that gmalloc.o is included in
 
8967
       libgthreads.a and libgthreads.so.
9270
8968
 
9271
8969
     * In FSU Pthreads, the following system calls are
9272
8970
       pthreads-aware: read(), write(), getmsg(), connect(),
9273
8971
       accept(), select(), and wait().
9274
8972
 
9275
8973
     * The CSSA-2001-SCO.35.2 (the patch is listed in custom as
9276
 
       erg711905-dscr_remap security patch (version 2.0.0))
9277
 
       breaks FSU threads and makes mysqld unstable. You have to
9278
 
       remove this one if you want to run mysqld on an
9279
 
       OpenServer 5.0.6 machine.
 
8974
       erg711905-dscr_remap security patch (version 2.0.0)) breaks
 
8975
       FSU threads and makes mysqld unstable. You have to remove this
 
8976
       one if you want to run mysqld on an OpenServer 5.0.6 machine.
9280
8977
 
9281
 
     * If you use SCO OpenServer 5, you may need to recompile
9282
 
       FSU pthreads with -DDRAFT7 in CFLAGS. Otherwise, InnoDB
9283
 
       may hang at a mysqld startup.
 
8978
     * If you use SCO OpenServer 5, you may need to recompile FSU
 
8979
       pthreads with -DDRAFT7 in CFLAGS. Otherwise, InnoDB may hang
 
8980
       at a mysqld startup.
9284
8981
 
9285
8982
     * SCO provides operating system patches at
9286
8983
       ftp://ftp.sco.com/pub/openserver5 for OpenServer 5.0.x.
9291
8988
 
9292
8989
     * Pre-OSR506 security fixes. Also, the telnetd fix at
9293
8990
       ftp://stage.caldera.com/pub/security/openserver/ or
9294
 
       ftp://stage.caldera.com/pub/security/openserver/CSSA-2001
9295
 
       -SCO.10/ as both libsocket.so.2 and libresolv.so.1 with
 
8991
       ftp://stage.caldera.com/pub/security/openserver/CSSA-2001-SCO.
 
8992
       10/ as both libsocket.so.2 and libresolv.so.1 with
9296
8993
       instructions for installing on pre-OSR506 systems.
9297
 
       It's probably a good idea to install these patches before
 
8994
       It is probably a good idea to install these patches before
9298
8995
       trying to compile/use MySQL.
9299
8996
 
9300
 
   Beginning with Legend/OpenServer 6.0.0, there are native
9301
 
   threads and no 2GB file size limit.
 
8997
   Beginning with Legend/OpenServer 6.0.0, there are native threads
 
8998
   and no 2GB file size limit.
9302
8999
 
9303
 
2.14.5.9. SCO OpenServer 6.0.x Notes
 
9000
2.13.5.9. SCO OpenServer 6.0.x Notes
9304
9001
 
9305
9002
   OpenServer 6 includes these key improvements:
9306
9003
 
9322
9019
     * /u95/bin is for commands that have better standards
9323
9020
       conformance, for example Large File System (LFS) support.
9324
9021
 
9325
 
     * /udk/bin is for commands that behave the same as on
9326
 
       UnixWare 7.1.4. The default is for the LFS support.
9327
 
 
9328
 
   The following is a guide to setting PATH on OpenServer 6. If
9329
 
   the user wants the traditional OpenServer 5.0.x then PATH
9330
 
   should be /bin first. If the user wants LFS support, the path
9331
 
   should be /u95/bin:/bin. If the user wants UnixWare 7 support
9332
 
   first, the path would be /udk/bin:/u95/bin:/bin:.
9333
 
 
9334
 
   We recommend using the latest production release of MySQL.
9335
 
   Should you choose to use an older release of MySQL on
9336
 
   OpenServer 6.0.x, you must use a version of MySQL at least as
9337
 
   recent as 3.22.13 to get fixes for some portability and OS
9338
 
   problems.
9339
 
 
9340
 
   MySQL distribution files with names of the following form are
9341
 
   tar archives of media are tar archives of media images
9342
 
   suitable for installation with the SCO Software Manager
9343
 
   (/etc/custom) on SCO OpenServer 6:
9344
 
mysql-PRODUCT-5.1.31-sco-osr6-i686.VOLS.tar
 
9022
     * /udk/bin is for commands that behave the same as on UnixWare
 
9023
       7.1.4. The default is for the LFS support.
 
9024
 
 
9025
   The following is a guide to setting PATH on OpenServer 6. If the
 
9026
   user wants the traditional OpenServer 5.0.x then PATH should be
 
9027
   /bin first. If the user wants LFS support, the path should be
 
9028
   /u95/bin:/bin. If the user wants UnixWare 7 support first, the
 
9029
   path would be /udk/bin:/u95/bin:/bin:.
 
9030
 
 
9031
   We recommend using the latest production release of MySQL. Should
 
9032
   you choose to use an older release of MySQL on OpenServer 6.0.x,
 
9033
   you must use a version of MySQL at least as recent as 3.22.13 to
 
9034
   get fixes for some portability and OS problems.
 
9035
 
 
9036
   MySQL distribution files with names of the following form are tar
 
9037
   archives of media are tar archives of media images suitable for
 
9038
   installation with the SCO Software Manager (/etc/custom) on SCO
 
9039
   OpenServer 6:
 
9040
mysql-PRODUCT-5.1.35-sco-osr6-i686.VOLS.tar
9345
9041
 
9346
9042
   A distribution where PRODUCT is pro-cert is the Commercially
9347
 
   licensed MySQL Pro Certified server. A distribution where
9348
 
   PRODUCT is pro-gpl-cert is the MySQL Pro Certified server
9349
 
   licensed under the terms of the General Public License (GPL).
 
9043
   licensed MySQL Pro Certified server. A distribution where PRODUCT
 
9044
   is pro-gpl-cert is the MySQL Pro Certified server licensed under
 
9045
   the terms of the General Public License (GPL).
9350
9046
 
9351
9047
   Select whichever distribution you wish to install and, after
9352
 
   download, extract the tar archive into an empty directory.
9353
 
   For example:
 
9048
   download, extract the tar archive into an empty directory. For
 
9049
   example:
9354
9050
shell> mkdir /tmp/mysql-pro
9355
9051
shell> cd /tmp/mysql-pro
9356
 
shell> tar xf /tmp/mysql-pro-cert-5.1.31-sco-osr6-i686.VOLS.tar
 
9052
shell> tar xf /tmp/mysql-pro-cert-5.1.35-sco-osr6-i686.VOLS.tar
9357
9053
 
9358
 
   Prior to installation, back up your data in accordance with
9359
 
   the procedures outlined in Section 2.12, "Upgrading MySQL."
 
9054
   Prior to installation, back up your data in accordance with the
 
9055
   procedures outlined in Section 2.12.1, "Upgrading MySQL."
9360
9056
 
9361
9057
   Remove any previously installed pkgadd version of MySQL:
9362
9058
shell> pkginfo mysql 2>&1 > /dev/null && pkgrm mysql
9367
9063
 
9368
9064
   Alternatively, the SCO Software Manager can be displayed
9369
9065
   graphically by clicking on the Software Manager icon on the
9370
 
   desktop, selecting Software -> Install New, selecting the
9371
 
   host, selecting Media Images for the Media Device, and
9372
 
   entering /tmp/mysql-pro as the Image Directory.
 
9066
   desktop, selecting Software -> Install New, selecting the host,
 
9067
   selecting Media Images for the Media Device, and entering
 
9068
   /tmp/mysql-pro as the Image Directory.
9373
9069
 
9374
 
   After installation, run mkdev mysql as the root user to
9375
 
   configure your newly installed MySQL Pro Certified server.
 
9070
   After installation, run mkdev mysql as the root user to configure
 
9071
   your newly installed MySQL Pro Certified server.
9376
9072
 
9377
9073
Note
9378
9074
 
9379
 
   The installation procedure for VOLS packages does not create
9380
 
   the mysql user and group that the package uses by default.
9381
 
   You should either create the mysql user and group, or else
9382
 
   select a different user and group using an option in mkdev
9383
 
   mysql.
 
9075
   The installation procedure for VOLS packages does not create the
 
9076
   mysql user and group that the package uses by default. You should
 
9077
   either create the mysql user and group, or else select a different
 
9078
   user and group using an option in mkdev mysql.
9384
9079
 
9385
 
   If you wish to configure your MySQL Pro server to interface
9386
 
   with the Apache Web server via PHP, download and install the
9387
 
   PHP update from SCO at
 
9080
   If you wish to configure your MySQL Pro server to interface with
 
9081
   the Apache Web server via PHP, download and install the PHP update
 
9082
   from SCO at
9388
9083
   ftp://ftp.sco.com/pub/updates/OpenServer/SCOSA-2006.17/.
9389
9084
 
9390
 
   We have been able to compile MySQL with the following
9391
 
   configure command on OpenServer 6.0.x:
 
9085
   We have been able to compile MySQL with the following configure
 
9086
   command on OpenServer 6.0.x:
9392
9087
CC=cc CFLAGS="-D_FILE_OFFSET_BITS=64 -O3" \
9393
9088
CXX=CC CXXFLAGS="-D_FILE_OFFSET_BITS=64 -O3" \
9394
9089
./configure --prefix=/usr/local/mysql \
9405
9100
   SCO provides information about security fixes at
9406
9101
   ftp://ftp.sco.com/pub/security/OpenServer.
9407
9102
 
9408
 
   By default, the maximum file size on a OpenServer 6.0.0
9409
 
   system is 1TB. Some operating system utilities have a
9410
 
   limitation of 2GB. The maximum possible file size on UnixWare
9411
 
   7 is 1TB with VXFS or HTFS.
 
9103
   By default, the maximum file size on a OpenServer 6.0.0 system is
 
9104
   1TB. Some operating system utilities have a limitation of 2GB. The
 
9105
   maximum possible file size on UnixWare 7 is 1TB with VXFS or HTFS.
9412
9106
 
9413
 
   OpenServer 6 can be configured for large file support (file
9414
 
   sizes greater than 2GB) by tuning the UNIX kernel.
 
9107
   OpenServer 6 can be configured for large file support (file sizes
 
9108
   greater than 2GB) by tuning the UNIX kernel.
9415
9109
 
9416
9110
   By default, the entries in /etc/conf/cf.d/mtune are set as
9417
9111
   follows:
9421
9115
HVMMLIM         0x9000000       0x1000000       0x7FFFFFFF
9422
9116
 
9423
9117
   To make changes to the kernel, use the idtune name parameter
9424
 
   command. idtune modifies the /etc/conf/cf.d/stune file for
9425
 
   you. We recommend setting the kernel values by executing the
9426
 
   following commands as root:
 
9118
   command. idtune modifies the /etc/conf/cf.d/stune file for you. We
 
9119
   recommend setting the kernel values by executing the following
 
9120
   commands as root:
9427
9121
# /etc/conf/bin/idtune SDATLIM 0x7FFFFFFF
9428
9122
# /etc/conf/bin/idtune HDATLIM 0x7FFFFFFF
9429
9123
# /etc/conf/bin/idtune SVMMLIM 0x7FFFFFFF
9434
9128
   Then rebuild and reboot the kernel by issuing this command:
9435
9129
# /etc/conf/bin/idbuild -B && init 6
9436
9130
 
9437
 
   We recommend tuning the system, but the proper parameter
9438
 
   values to use depend on the number of users accessing the
9439
 
   application or database and size the of the database (that
9440
 
   is, the used buffer pool). The following kernel parameters
9441
 
   can be set with idtune:
 
9131
   We recommend tuning the system, but the proper parameter values to
 
9132
   use depend on the number of users accessing the application or
 
9133
   database and size the of the database (that is, the used buffer
 
9134
   pool). The following kernel parameters can be set with idtune:
9442
9135
 
9443
 
     * SHMMAX (recommended setting: 128MB) and SHMSEG
9444
 
       (recommended setting: 15). These parameters have an
9445
 
       influence on the MySQL database engine to create user
9446
 
       buffer pools.
 
9136
     * SHMMAX (recommended setting: 128MB) and SHMSEG (recommended
 
9137
       setting: 15). These parameters have an influence on the MySQL
 
9138
       database engine to create user buffer pools.
9447
9139
 
9448
9140
     * SFNOLIM and HFNOLIM should be at maximum 2048.
9449
9141
 
9450
 
     * NPROC should be set to at least 3000/4000 (depends on
9451
 
       number of users).
 
9142
     * NPROC should be set to at least 3000/4000 (depends on number
 
9143
       of users).
9452
9144
 
9453
 
     * We also recommend using the following formulas to
9454
 
       calculate values for SEMMSL, SEMMNS, and SEMMNU:
 
9145
     * We also recommend using the following formulas to calculate
 
9146
       values for SEMMSL, SEMMNS, and SEMMNU:
9455
9147
SEMMSL = 13
9456
 
 
9457
 
       13 is what has been found to be the best for both
9458
 
       Progress and MySQL.
 
9148
       13 is what has been found to be the best for both Progress and
 
9149
       MySQL.
9459
9150
SEMMNS = SEMMSL x number of db servers to be run on the system
9460
 
 
9461
 
       Set SEMMNS to the value of SEMMSL multiplied by the
9462
 
       number of database servers (maximum) that you are running
9463
 
       on the system at one time.
 
9151
       Set SEMMNS to the value of SEMMSL multiplied by the number of
 
9152
       database servers (maximum) that you are running on the system
 
9153
       at one time.
9464
9154
SEMMNU = SEMMNS
9465
 
 
9466
9155
       Set the value of SEMMNU to equal the value of SEMMNS. You
9467
9156
       could probably set this to 75% of SEMMNS, but this is a
9468
9157
       conservative estimate.
9469
9158
 
9470
 
2.14.5.10. SCO UnixWare 7.1.x and OpenUNIX 8.0.0 Notes
9471
 
 
9472
 
   We recommend using the latest production release of MySQL.
9473
 
   Should you choose to use an older release of MySQL on
9474
 
   UnixWare 7.1.x, you must use a version of MySQL at least as
9475
 
   recent as 3.22.13 to get fixes for some portability and OS
9476
 
   problems.
9477
 
 
9478
 
   We have been able to compile MySQL with the following
9479
 
   configure command on UnixWare 7.1.x:
 
9159
2.13.5.10. SCO UnixWare 7.1.x and OpenUNIX 8.0.0 Notes
 
9160
 
 
9161
   We recommend using the latest production release of MySQL. Should
 
9162
   you choose to use an older release of MySQL on UnixWare 7.1.x, you
 
9163
   must use a version of MySQL at least as recent as 3.22.13 to get
 
9164
   fixes for some portability and OS problems.
 
9165
 
 
9166
   We have been able to compile MySQL with the following configure
 
9167
   command on UnixWare 7.1.x:
9480
9168
CC="cc" CFLAGS="-I/usr/local/include" \
9481
9169
CXX="CC" CXXFLAGS="-I/usr/local/include" \
9482
9170
./configure --prefix=/usr/local/mysql \
9499
9187
   The UnixWare 7 file size limit is 1 TB with VXFS. Some OS
9500
9188
   utilities have a limitation of 2GB.
9501
9189
 
9502
 
   On UnixWare 7.1.4 you do not need to do anything to get large
9503
 
   file support, but to enable large file support on prior
9504
 
   versions of UnixWare 7.1.x, run fsadm.
 
9190
   On UnixWare 7.1.4 you do not need to do anything to get large file
 
9191
   support, but to enable large file support on prior versions of
 
9192
   UnixWare 7.1.x, run fsadm.
9505
9193
# fsadm -Fvxfs -o largefiles /
9506
9194
# fsadm /         * Note
9507
9195
# ulimit unlimited
9522
9210
HVMMLIM         0x9000000       0x1000000       0x7FFFFFFF
9523
9211
 
9524
9212
   To make changes to the kernel, use the idtune name parameter
9525
 
   command. idtune modifies the /etc/conf/cf.d/stune file for
9526
 
   you. We recommend setting the kernel values by executing the
9527
 
   following commands as root:
 
9213
   command. idtune modifies the /etc/conf/cf.d/stune file for you. We
 
9214
   recommend setting the kernel values by executing the following
 
9215
   commands as root:
9528
9216
# /etc/conf/bin/idtune SDATLIM 0x7FFFFFFF
9529
9217
# /etc/conf/bin/idtune HDATLIM 0x7FFFFFFF
9530
9218
# /etc/conf/bin/idtune SVMMLIM 0x7FFFFFFF
9535
9223
   Then rebuild and reboot the kernel by issuing this command:
9536
9224
# /etc/conf/bin/idbuild -B && init 6
9537
9225
 
9538
 
   We recommend tuning the system, but the proper parameter
9539
 
   values to use depend on the number of users accessing the
9540
 
   application or database and size the of the database (that
9541
 
   is, the used buffer pool). The following kernel parameters
9542
 
   can be set with idtune:
 
9226
   We recommend tuning the system, but the proper parameter values to
 
9227
   use depend on the number of users accessing the application or
 
9228
   database and size the of the database (that is, the used buffer
 
9229
   pool). The following kernel parameters can be set with idtune:
9543
9230
 
9544
 
     * SHMMAX (recommended setting: 128MB) and SHMSEG
9545
 
       (recommended setting: 15). These parameters have an
9546
 
       influence on the MySQL database engine to create user
9547
 
       buffer pools.
 
9231
     * SHMMAX (recommended setting: 128MB) and SHMSEG (recommended
 
9232
       setting: 15). These parameters have an influence on the MySQL
 
9233
       database engine to create user buffer pools.
9548
9234
 
9549
9235
     * SFNOLIM and HFNOLIM should be at maximum 2048.
9550
9236
 
9551
 
     * NPROC should be set to at least 3000/4000 (depends on
9552
 
       number of users).
 
9237
     * NPROC should be set to at least 3000/4000 (depends on number
 
9238
       of users).
9553
9239
 
9554
 
     * We also recommend using the following formulas to
9555
 
       calculate values for SEMMSL, SEMMNS, and SEMMNU:
 
9240
     * We also recommend using the following formulas to calculate
 
9241
       values for SEMMSL, SEMMNS, and SEMMNU:
9556
9242
SEMMSL = 13
9557
 
 
9558
 
       13 is what has been found to be the best for both
9559
 
       Progress and MySQL.
 
9243
       13 is what has been found to be the best for both Progress and
 
9244
       MySQL.
9560
9245
SEMMNS = SEMMSL x number of db servers to be run on the system
9561
 
 
9562
 
       Set SEMMNS to the value of SEMMSL multiplied by the
9563
 
       number of database servers (maximum) that you are running
9564
 
       on the system at one time.
 
9246
       Set SEMMNS to the value of SEMMSL multiplied by the number of
 
9247
       database servers (maximum) that you are running on the system
 
9248
       at one time.
9565
9249
SEMMNU = SEMMNS
9566
 
 
9567
9250
       Set the value of SEMMNU to equal the value of SEMMNS. You
9568
9251
       could probably set this to 75% of SEMMNS, but this is a
9569
9252
       conservative estimate.
9570
9253
 
9571
 
2.15. Environment Variables
9572
 
 
9573
 
   This section lists all the environment variables that are
9574
 
   used directly or indirectly by MySQL. Most of these can also
9575
 
   be found in other places in this manual.
9576
 
 
9577
 
   Note that any options on the command line take precedence
9578
 
   over values specified in option files and environment
9579
 
   variables, and values in option files take precedence over
9580
 
   values in environment variables.
9581
 
 
9582
 
   In many cases, it is preferable to use an option file instead
9583
 
   of environment variables to modify the behavior of MySQL. See
9584
 
   Section 4.2.3.2, "Using Option Files."
 
9254
2.14. Environment Variables
 
9255
 
 
9256
   This section lists all the environment variables that are used
 
9257
   directly or indirectly by MySQL. Most of these can also be found
 
9258
   in other places in this manual.
 
9259
 
 
9260
   Note that any options on the command line take precedence over
 
9261
   values specified in option files and environment variables, and
 
9262
   values in option files take precedence over values in environment
 
9263
   variables.
 
9264
 
 
9265
   In many cases, it is preferable to use an option file instead of
 
9266
   environment variables to modify the behavior of MySQL. See Section
 
9267
   4.2.3.2, "Using Option Files."
9585
9268
   Variable Description
9586
9269
   CXX The name of your C++ compiler (for running configure).
9587
9270
   CC The name of your C compiler (for running configure).
9591
9274
   DBI_TRACE Trace options for Perl DBI.
9592
9275
   HOME The default path for the mysql history file is
9593
9276
   $HOME/.mysql_history.
9594
 
   LD_RUN_PATH Used to specify the location of
9595
 
   libmysqlclient.so.
 
9277
   LD_RUN_PATH Used to specify the location of libmysqlclient.so.
9596
9278
   MYSQL_DEBUG Debug trace options when debugging.
9597
9279
   MYSQL_GROUP_SUFFIX Option group suffix value (like specifying
9598
9280
   --defaults-group-suffix).
9599
9281
   MYSQL_HISTFILE The path to the mysql history file. If this
9600
9282
   variable is set, its value overrides the default for
9601
9283
   $HOME/.mysql_history.
9602
 
   MYSQL_HOME The path to the directory in which the
9603
 
   server-specific my.cnf file resides (as of MySQL 5.0.3).
9604
 
   MYSQL_HOST The default hostname used by the mysql
9605
 
   command-line client.
 
9284
   MYSQL_HOME The path to the directory in which the server-specific
 
9285
   my.cnf file resides (as of MySQL 5.0.3).
 
9286
   MYSQL_HOST The default host name used by the mysql command-line
 
9287
   client.
9606
9288
   MYSQL_PS1 The command prompt to use in the mysql command-line
9607
9289
   client.
9608
 
   MYSQL_PWD The default password when connecting to mysqld.
9609
 
   Note that using this is insecure. See Section 5.5.6, "Keeping
9610
 
   Passwords Secure."
 
9290
   MYSQL_PWD The default password when connecting to mysqld. Note
 
9291
   that using this is insecure. See Section 5.5.6.2, "End-User
 
9292
   Guidelines for Password Security."
9611
9293
   MYSQL_TCP_PORT The default TCP/IP port number.
9612
 
   MYSQL_UNIX_PORT The default Unix socket filename; used for
 
9294
   MYSQL_UNIX_PORT The default Unix socket file name; used for
9613
9295
   connections to localhost.
9614
9296
   PATH Used by the shell to find MySQL programs.
9615
9297
   TMPDIR The directory where temporary files are created.
9616
9298
   TZ This should be set to your local time zone. See Section
9617
9299
   B.1.4.6, "Time Zone Problems."
9618
 
   UMASK_DIR The user-directory creation mask when creating
9619
 
   directories. Note that this is ANDed with UMASK.
9620
 
   UMASK The user-file creation mask when creating files.
 
9300
   UMASK The user-file creation mode when creating files. See note
 
9301
   following table.
 
9302
   UMASK_DIR The user-directory creation mode when creating
 
9303
   directories. See note following table.
9621
9304
   USER The default user name on Windows and NetWare used when
9622
9305
   connecting to mysqld.
9623
9306
 
9624
 
2.16. Perl Installation Notes
9625
 
 
9626
 
   Perl support for MySQL is provided by means of the DBI/DBD
9627
 
   client interface. The interface requires Perl 5.6.0, and
9628
 
   5.6.1 or later is preferred. DBI does not work if you have an
9629
 
   older version of Perl.
9630
 
 
9631
 
   If you want to use transactions with Perl DBI, you need to
9632
 
   have DBD::mysql 2.0900. If you are using the MySQL 4.1 or
9633
 
   newer client library, you must use DBD::mysql 2.9003 or
9634
 
   newer. Support for server-side prepared statements requires
9635
 
   DBD::mysql 3.0009 or newer.
9636
 
 
9637
 
   Perl support is not included with MySQL distributions. You
9638
 
   can obtain the necessary modules from http://search.cpan.org
9639
 
   for Unix, or by using the ActiveState ppm program on Windows.
9640
 
   The following sections describe how to do this.
9641
 
 
9642
 
   Perl support for MySQL must be installed if you want to run
9643
 
   the MySQL benchmark scripts; see Section 7.1.4, "The MySQL
9644
 
   Benchmark Suite." It is also required for the MySQL Cluster
9645
 
   ndb_size.pl utility; see Section 17.9.15, "ndb_size.pl ---
9646
 
   NDBCLUSTER Size Requirement Estimator."
9647
 
 
9648
 
2.16.1. Installing Perl on Unix
9649
 
 
9650
 
   MySQL Perl support requires that you have installed MySQL
9651
 
   client programming support (libraries and header files). Most
9652
 
   installation methods install the necessary files. However, if
9653
 
   you installed MySQL from RPM files on Linux, be sure that
9654
 
   you've installed the developer RPM. The client programs are
9655
 
   in the client RPM, but client programming support is in the
9656
 
   developer RPM.
9657
 
 
9658
 
   If you want to install Perl support, the files you need can
9659
 
   be obtained from the CPAN (Comprehensive Perl Archive
9660
 
   Network) at http://search.cpan.org.
9661
 
 
9662
 
   The easiest way to install Perl modules on Unix is to use the
9663
 
   CPAN module. For example:
 
9307
   The UMASK and UMASK_DIR variables, despite their names, are used
 
9308
   as modes, not masks:
 
9309
 
 
9310
     * If UMASK is set, mysqld uses ($UMASK | 0600) as the mode for
 
9311
       file creation, so that newly created files have a mode in the
 
9312
       range from 0600 to 0666 (all values octal).
 
9313
 
 
9314
     * If UMASK_DIR is set, mysqld uses ($UMASK_DIR | 0700) as the
 
9315
       base mode for directory creation, which then is AND-ed with
 
9316
       ~(~$UMASK & 0666), so that newly created directories have a
 
9317
       mode in the range from 0700 to 0777 (all values octal). The
 
9318
       AND operation may remove read and write permissions from the
 
9319
       directory mode, but not execute permissions.
 
9320
 
 
9321
   MySQL assumes that the value for UMASK or UMASK_DIR is in octal if
 
9322
   it starts with a zero.
 
9323
 
 
9324
2.15. Perl Installation Notes
 
9325
 
 
9326
   Perl support for MySQL is provided by means of the DBI/DBD client
 
9327
   interface. The interface requires Perl 5.6.0, and 5.6.1 or later
 
9328
   is preferred. DBI does not work if you have an older version of
 
9329
   Perl.
 
9330
 
 
9331
   If you want to use transactions with Perl DBI, you need to have
 
9332
   DBD::mysql 2.0900. If you are using the MySQL 4.1 or newer client
 
9333
   library, you must use DBD::mysql 2.9003 or newer. Support for
 
9334
   server-side prepared statements requires DBD::mysql 3.0009 or
 
9335
   newer.
 
9336
 
 
9337
   Perl support is not included with MySQL distributions. You can
 
9338
   obtain the necessary modules from http://search.cpan.org for Unix,
 
9339
   or by using the ActiveState ppm program on Windows. The following
 
9340
   sections describe how to do this.
 
9341
 
 
9342
   Perl support for MySQL must be installed if you want to run the
 
9343
   MySQL benchmark scripts; see Section 7.1.4, "The MySQL Benchmark
 
9344
   Suite." It is also required for the MySQL Cluster ndb_size.pl
 
9345
   utility; see Section 17.9.15, "ndb_size.pl --- NDBCLUSTER Size
 
9346
   Requirement Estimator."
 
9347
 
 
9348
2.15.1. Installing Perl on Unix
 
9349
 
 
9350
   MySQL Perl support requires that you have installed MySQL client
 
9351
   programming support (libraries and header files). Most
 
9352
   installation methods install the necessary files. However, if you
 
9353
   installed MySQL from RPM files on Linux, be sure that you've
 
9354
   installed the developer RPM. The client programs are in the client
 
9355
   RPM, but client programming support is in the developer RPM.
 
9356
 
 
9357
   If you want to install Perl support, the files you need can be
 
9358
   obtained from the CPAN (Comprehensive Perl Archive Network) at
 
9359
   http://search.cpan.org.
 
9360
 
 
9361
   The easiest way to install Perl modules on Unix is to use the CPAN
 
9362
   module. For example:
9664
9363
shell> perl -MCPAN -e shell
9665
9364
cpan> install DBI
9666
9365
cpan> install DBD::mysql
9667
9366
 
9668
 
   The DBD::mysql installation runs a number of tests. These
9669
 
   tests attempt to connect to the local MySQL server using the
9670
 
   default user name and password. (The default user name is
9671
 
   your login name on Unix, and ODBC on Windows. The default
9672
 
   password is "no password.") If you cannot connect to the
9673
 
   server with those values (for example, if your account has a
9674
 
   password), the tests fail. You can use force install
9675
 
   DBD::mysql to ignore the failed tests.
9676
 
 
9677
 
   DBI requires the Data::Dumper module. It may be installed; if
9678
 
   not, you should install it before installing DBI.
9679
 
 
9680
 
   It is also possible to download the module distributions in
9681
 
   the form of compressed tar archives and build the modules
9682
 
   manually. For example, to unpack and build a DBI
9683
 
   distribution, use a procedure such as this:
 
9367
   The DBD::mysql installation runs a number of tests. These tests
 
9368
   attempt to connect to the local MySQL server using the default
 
9369
   user name and password. (The default user name is your login name
 
9370
   on Unix, and ODBC on Windows. The default password is "no
 
9371
   password.") If you cannot connect to the server with those values
 
9372
   (for example, if your account has a password), the tests fail. You
 
9373
   can use force install DBD::mysql to ignore the failed tests.
 
9374
 
 
9375
   DBI requires the Data::Dumper module. It may be installed; if not,
 
9376
   you should install it before installing DBI.
 
9377
 
 
9378
   It is also possible to download the module distributions in the
 
9379
   form of compressed tar archives and build the modules manually.
 
9380
   For example, to unpack and build a DBI distribution, use a
 
9381
   procedure such as this:
9684
9382
 
9685
9383
    1. Unpack the distribution into the current directory:
9686
9384
shell> gunzip < DBI-VERSION.tar.gz | tar xvf -
9687
 
 
9688
9385
       This command creates a directory named DBI-VERSION.
9689
9386
 
9690
 
    2. Change location into the top-level directory of the
9691
 
       unpacked distribution:
 
9387
    2. Change location into the top-level directory of the unpacked
 
9388
       distribution:
9692
9389
shell> cd DBI-VERSION
9693
9390
 
9694
 
 
9695
9391
    3. Build the distribution and compile everything:
9696
9392
shell> perl Makefile.PL
9697
9393
shell> make
9698
9394
shell> make test
9699
9395
shell> make install
9700
9396
 
9701
 
   The make test command is important because it verifies that
9702
 
   the module is working. Note that when you run that command
9703
 
   during the DBD::mysql installation to exercise the interface
9704
 
   code, the MySQL server must be running or the test fails.
 
9397
   The make test command is important because it verifies that the
 
9398
   module is working. Note that when you run that command during the
 
9399
   DBD::mysql installation to exercise the interface code, the MySQL
 
9400
   server must be running or the test fails.
9705
9401
 
9706
9402
   It is a good idea to rebuild and reinstall the DBD::mysql
9707
9403
   distribution whenever you install a new release of MySQL,
9708
9404
   particularly if you notice symptoms such as that all your DBI
9709
9405
   scripts fail after you upgrade MySQL.
9710
9406
 
9711
 
   If you do not have access rights to install Perl modules in
9712
 
   the system directory or if you want to install local Perl
9713
 
   modules, the following reference may be useful:
9714
 
   http://servers.digitaldaze.com/extensions/perl/modules.html#m
9715
 
   odules
 
9407
   If you do not have access rights to install Perl modules in the
 
9408
   system directory or if you want to install local Perl modules, the
 
9409
   following reference may be useful:
 
9410
   http://servers.digitaldaze.com/extensions/perl/modules.html#module
 
9411
   s
9716
9412
 
9717
9413
   Look under the heading "Installing New Modules that Require
9718
9414
   Locally Installed Modules."
9719
9415
 
9720
 
2.16.2. Installing ActiveState Perl on Windows
 
9416
2.15.2. Installing ActiveState Perl on Windows
9721
9417
 
9722
 
   On Windows, you should do the following to install the MySQL
9723
 
   DBD module with ActiveState Perl:
 
9418
   On Windows, you should do the following to install the MySQL DBD
 
9419
   module with ActiveState Perl:
9724
9420
 
9725
9421
    1. Get ActiveState Perl from
9726
 
       http://www.activestate.com/Products/ActivePerl/ and
9727
 
       install it.
 
9422
       http://www.activestate.com/Products/ActivePerl/ and install
 
9423
       it.
9728
9424
 
9729
9425
    2. Open a console window (a "DOS window").
9730
9426
 
9731
 
    3. If necessary, set the HTTP_proxy variable. For example,
9732
 
       you might try a setting like this:
 
9427
    3. If necessary, set the HTTP_proxy variable. For example, you
 
9428
       might try a setting like this:
9733
9429
set HTTP_proxy=my.proxy.com:3128
9734
9430
 
9735
 
 
9736
9431
    4. Start the PPM program:
9737
9432
C:\> C:\perl\bin\ppm.pl
9738
9433
 
9739
 
 
9740
9434
    5. If you have not previously done so, install DBI:
9741
9435
ppm> install DBI
9742
9436
 
9743
 
 
9744
9437
    6. If this succeeds, run the following command:
9745
9438
ppm> install DBD-mysql
9746
9439
 
9747
 
   This procedure should work with ActiveState Perl 5.6 or
9748
 
   newer.
 
9440
   This procedure should work with ActiveState Perl 5.6 or newer.
9749
9441
 
9750
 
   If you cannot get the procedure to work, you should install
9751
 
   the MyODBC driver instead and connect to the MySQL server
9752
 
   through ODBC:
 
9442
   If you cannot get the procedure to work, you should install the
 
9443
   MyODBC driver instead and connect to the MySQL server through
 
9444
   ODBC:
9753
9445
use DBI;
9754
9446
$dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) ||
9755
9447
  die "Got error $DBI::errstr when connecting to $dsn\n";
9756
9448
 
9757
 
2.16.3. Problems Using the Perl DBI/DBD Interface
 
9449
2.15.3. Problems Using the Perl DBI/DBD Interface
9758
9450
 
9759
 
   If Perl reports that it cannot find the ../mysql/mysql.so
9760
 
   module, the problem is probably that Perl cannot locate the
9761
 
   libmysqlclient.so shared library. You should be able to fix
9762
 
   this problem by one of the following methods:
 
9451
   If Perl reports that it cannot find the ../mysql/mysql.so module,
 
9452
   the problem is probably that Perl cannot locate the
 
9453
   libmysqlclient.so shared library. You should be able to fix this
 
9454
   problem by one of the following methods:
9763
9455
 
9764
9456
     * Compile the DBD::mysql distribution with perl Makefile.PL
9765
9457
       -static -config rather than perl Makefile.PL.
9767
9459
     * Copy libmysqlclient.so to the directory where your other
9768
9460
       shared libraries are located (probably /usr/lib or /lib).
9769
9461
 
9770
 
     * Modify the -L options used to compile DBD::mysql to
9771
 
       reflect the actual location of libmysqlclient.so.
 
9462
     * Modify the -L options used to compile DBD::mysql to reflect
 
9463
       the actual location of libmysqlclient.so.
9772
9464
 
9773
 
     * On Linux, you can add the pathname of the directory where
 
9465
     * On Linux, you can add the path name of the directory where
9774
9466
       libmysqlclient.so is located to the /etc/ld.so.conf file.
9775
9467
 
9776
 
     * Add the pathname of the directory where libmysqlclient.so
9777
 
       is located to the LD_RUN_PATH environment variable. Some
9778
 
       systems use LD_LIBRARY_PATH instead.
9779
 
 
9780
 
   Note that you may also need to modify the -L options if there
9781
 
   are other libraries that the linker fails to find. For
9782
 
   example, if the linker cannot find libc because it is in /lib
9783
 
   and the link command specifies -L/usr/lib, change the -L
9784
 
   option to -L/lib or add -L/lib to the existing link command.
9785
 
 
9786
 
   If you get the following errors from DBD::mysql, you are
9787
 
   probably using gcc (or using an old binary compiled with
9788
 
   gcc):
 
9468
     * Add the path name of the directory where libmysqlclient.so is
 
9469
       located to the LD_RUN_PATH environment variable. Some systems
 
9470
       use LD_LIBRARY_PATH instead.
 
9471
 
 
9472
   Note that you may also need to modify the -L options if there are
 
9473
   other libraries that the linker fails to find. For example, if the
 
9474
   linker cannot find libc because it is in /lib and the link command
 
9475
   specifies -L/usr/lib, change the -L option to -L/lib or add -L/lib
 
9476
   to the existing link command.
 
9477
 
 
9478
   If you get the following errors from DBD::mysql, you are probably
 
9479
   using gcc (or using an old binary compiled with gcc):
9789
9480
/usr/bin/perl: can't resolve symbol '__moddi3'
9790
9481
/usr/bin/perl: can't resolve symbol '__divdi3'
9791
9482
 
9792
9483
   Add -L/usr/lib/gcc-lib/... -lgcc to the link command when the
9793
9484
   mysql.so library gets built (check the output from make for
9794
 
   mysql.so when you compile the Perl client). The -L option
9795
 
   should specify the pathname of the directory where libgcc.a
9796
 
   is located on your system.
9797
 
 
9798
 
   Another cause of this problem may be that Perl and MySQL are
9799
 
   not both compiled with gcc. In this case, you can solve the
9800
 
   mismatch by compiling both with gcc.
9801
 
 
9802
 
   You may see the following error from DBD::mysql when you run
9803
 
   the tests:
 
9485
   mysql.so when you compile the Perl client). The -L option should
 
9486
   specify the path name of the directory where libgcc.a is located
 
9487
   on your system.
 
9488
 
 
9489
   Another cause of this problem may be that Perl and MySQL are not
 
9490
   both compiled with gcc. In this case, you can solve the mismatch
 
9491
   by compiling both with gcc.
 
9492
 
 
9493
   You may see the following error from DBD::mysql when you run the
 
9494
   tests:
9804
9495
t/00base............install_driver(mysql) failed:
9805
 
Can't load '../blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysq
9806
 
l:
 
9496
Can't load '../blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mys
 
9497
ql:
9807
9498
../blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
9808
 
uncompress at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm line 169
9809
 
.
 
9499
uncompress at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm line 16
 
9500
9.
9810
9501
 
9811
 
   This means that you need to include the -lz compression
9812
 
   library on the link line. That can be done by changing the
9813
 
   following line in the file lib/DBD/mysql/Install.pm:
 
9502
   This means that you need to include the -lz compression library on
 
9503
   the link line. That can be done by changing the following line in
 
9504
   the file lib/DBD/mysql/Install.pm:
9814
9505
$sysliblist .= " -lm";
9815
9506
 
9816
9507
   Change that line to:
9817
9508
$sysliblist .= " -lm -lz";
9818
9509
 
9819
 
   After this, you must run make realclean and then proceed with
9820
 
   the installation from the beginning.
 
9510
   After this, you must run make realclean and then proceed with the
 
9511
   installation from the beginning.
9821
9512
 
9822
 
   If you want to install DBI on SCO, you have to edit the
9823
 
   Makefile in DBI-xxx and each subdirectory. Note that the
9824
 
   following assumes gcc 2.95.2 or newer:
 
9513
   If you want to install DBI on SCO, you have to edit the Makefile
 
9514
   in DBI-xxx and each subdirectory. Note that the following assumes
 
9515
   gcc 2.95.2 or newer:
9825
9516
OLD:                                  NEW:
9826
9517
CC = cc                               CC = gcc
9827
9518
CCCDLFLAGS = -KPIC -W1,-Bexport       CCCDLFLAGS = -fpic
9840
9531
NEW:
9841
9532
CCFLAGS = -U M_XENIX -DPERL_SCO5 -I/usr/local/include
9842
9533
 
9843
 
   These changes are necessary because the Perl dynaloader does
9844
 
   not load the DBI modules if they were compiled with icc or
9845
 
   cc.
 
9534
   These changes are necessary because the Perl dynaloader does not
 
9535
   load the DBI modules if they were compiled with icc or cc.
9846
9536
 
9847
9537
   If you want to use the Perl module on a system that does not
9848
 
   support dynamic linking (such as SCO), you can generate a
9849
 
   static version of Perl that includes DBI and DBD::mysql. The
9850
 
   way this works is that you generate a version of Perl with
9851
 
   the DBI code linked in and install it on top of your current
9852
 
   Perl. Then you use that to build a version of Perl that
9853
 
   additionally has the DBD code linked in, and install that.
 
9538
   support dynamic linking (such as SCO), you can generate a static
 
9539
   version of Perl that includes DBI and DBD::mysql. The way this
 
9540
   works is that you generate a version of Perl with the DBI code
 
9541
   linked in and install it on top of your current Perl. Then you use
 
9542
   that to build a version of Perl that additionally has the DBD code
 
9543
   linked in, and install that.
9854
9544
 
9855
 
   On SCO, you must have the following environment variables
9856
 
   set:
 
9545
   On SCO, you must have the following environment variables set:
9857
9546
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/progressive/lib
9858
9547
 
9859
9548
   Or:
9864
9553
MANPATH=scohelp:/usr/man:/usr/local1/man:/usr/local/man:\
9865
9554
    /usr/skunk/man:
9866
9555
 
9867
 
   First, create a Perl that includes a statically linked DBI
9868
 
   module by running these commands in the directory where your
9869
 
   DBI distribution is located:
 
9556
   First, create a Perl that includes a statically linked DBI module
 
9557
   by running these commands in the directory where your DBI
 
9558
   distribution is located:
9870
9559
shell> perl Makefile.PL -static -config
9871
9560
shell> make
9872
9561
shell> make install
9873
9562
shell> make perl
9874
9563
 
9875
9564
   Then you must install the new Perl. The output of make perl
9876
 
   indicates the exact make command you need to execute to
9877
 
   perform the installation. On SCO, this is make -f
9878
 
   Makefile.aperl inst_perl MAP_TARGET=perl.
 
9565
   indicates the exact make command you need to execute to perform
 
9566
   the installation. On SCO, this is make -f Makefile.aperl inst_perl
 
9567
   MAP_TARGET=perl.
9879
9568
 
9880
 
   Next, use the just-created Perl to create another Perl that
9881
 
   also includes a statically linked DBD::mysql by running these
9882
 
   commands in the directory where your DBD::mysql distribution
9883
 
   is located:
 
9569
   Next, use the just-created Perl to create another Perl that also
 
9570
   includes a statically linked DBD::mysql by running these commands
 
9571
   in the directory where your DBD::mysql distribution is located:
9884
9572
shell> perl Makefile.PL -static -config
9885
9573
shell> make
9886
9574
shell> make install
9887
9575
shell> make perl
9888
9576
 
9889
 
   Finally, you should install this new Perl. Again, the output
9890
 
   of make perl indicates the command to use.
 
9577
   Finally, you should install this new Perl. Again, the output of
 
9578
   make perl indicates the command to use.