1
2
Chapter 2. Installing and Upgrading MySQL
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
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.
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.:
22
+ For MySQL Enterprise Server, the officially
23
supported platforms are listed at
24
http://www.mysql.com/support/supportedplatforms.html
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
23
+ For MySQL Enterprise Server, the officially supported
24
platforms are listed at
25
http://www.mysql.com/support/supportedplatforms.html.
27
+ MySQL Community Server runs on the platforms listed at
28
Section 2.1.1, "Operating Systems Supported by MySQL
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."
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
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.
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
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
72
71
2.1. General Installation Issues
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
74
install MySQL Enterprise Server or MySQL Community Server. The set
75
of applicable platforms depends on which distribution you will
79
78
* For MySQL Enterprise Server, the officially supported
80
79
platforms are listed at
81
80
http://www.mysql.com/support/supportedplatforms.html.
83
* MySQL Community Server runs on the platforms listed at
84
Section 2.1.1, "Operating Systems Supported by MySQL
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
93
For MySQL Community Server, install the main distribution
94
plus any hotfixes and updates:
96
* Download a binary release, or download a source release
97
and build MySQL yourself from the source code.
99
* Retrieve MySQL from the Bazaar tree and build it from
100
source. The Bazaar tree contains the latest developer
82
* MySQL Community Server runs on the platforms listed at Section
83
2.1.1, "Operating Systems Supported by MySQL Community
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.
91
For MySQL Community Server, install the main distribution plus any
94
* Download a binary release, or download a source release and
95
build MySQL yourself from the source code.
97
* Retrieve MySQL from the Bazaar tree and build it from source.
98
The Bazaar tree contains the latest developer code.
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."
112
109
2.1.1. Operating Systems Supported by MySQL Community Server
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.
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
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.)
132
MySQL has been reported to compile successfully on the
133
following combinations of operating system and thread
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++
129
MySQL has been reported to compile successfully on the following
130
combinations of operating system and thread package.
132
* AIX 4.x, 5.x with native threads. See Section 2.13.5.3,
141
137
* FreeBSD 5.x and up with native threads.
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."
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."
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."
151
147
* NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha. See Section
152
2.14.4.2, "NetBSD Notes."
154
* Novell NetWare 6.0 and 6.5. See Section 2.8, "Installing
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,
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."
165
* SCO Openserver 6.0.x. See Section 2.14.5.9, "SCO
166
OpenServer 6.0.x Notes."
168
* SCO UnixWare 7.1.x. See Section 2.14.5.10, "SCO UnixWare
169
7.1.x and OpenUNIX 8.0.0 Notes."
171
* SGI Irix 6.x with native threads. See Section 2.14.5.7,
174
* Solaris 2.5 and above with native threads on SPARC and
175
x86. See Section 2.14.3, "Solaris Notes."
177
* Tru64 Unix. See Section 2.14.5.5, "Alpha-DEC-UNIX Notes
148
2.13.4.2, "NetBSD Notes."
150
* Novell NetWare 6.0 and 6.5. See Section 2.8, "Installing MySQL
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
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
161
* SCO Openserver 6.0.x. See Section 2.13.5.9, "SCO OpenServer
164
* SCO UnixWare 7.1.x. See Section 2.13.5.10, "SCO UnixWare 7.1.x
165
and OpenUNIX 8.0.0 Notes."
167
* SGI Irix 6.x with native threads. See Section 2.13.5.7, "SGI
170
* Solaris 2.5 and above with native threads on SPARC and x86.
171
See Section 2.13.3, "Solaris Notes."
173
* Tru64 Unix. See Section 2.13.5.5, "Alpha-DEC-UNIX Notes
180
* Windows 2000, Windows XP, Windows Vista, Windows Server
181
2003, and Windows Server 2008. See Section 2.3,
182
"Installing MySQL on Windows."
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.
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
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.
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.
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.
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
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
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:
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
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
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
208
* General file system stability and performance.
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.
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
225
220
* The amount of testing we have done internally for similar
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
233
228
2.1.2. Choosing Which MySQL Distribution to Install
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
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.
242
236
2.1.2.1. Choosing Which Version of MySQL to Install
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:
249
243
* MySQL 6.0 is the current development release series.
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
256
* MySQL 5.0 is the previous stable (production-quality)
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.
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.
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
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.
249
* MySQL 5.0 is the previous stable (production-quality) release
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
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
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.
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.
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
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
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
308
* The first number (5) is the major version and describes
309
the file format. All MySQL 5 releases have the same file
312
* The second number (0) is the release level. Taken
313
together, the major version and release level constitute
314
the release series number.
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
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.
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:
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.
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
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.
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:
296
* The first number (5) is the major version and describes the
297
file format. All MySQL 5 releases have the same file format.
299
* The second number (0) is the release level. Taken together,
300
the major version and release level constitute the release
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.
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.
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:
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.
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.
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
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
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.
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
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.
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
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.
376
358
All releases have been tested at least with these tools:
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
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
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."
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
399
381
2.1.2.2. Choosing a Distribution Format
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
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
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
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.
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
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.
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
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
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."
1404
1324
MySQL distributions for Windows can be downloaded from
1405
http://dev.mysql.com/downloads/. See Section 2.1.3, "How to
1325
http://dev.mysql.com/downloads/. See Section 2.1.3, "How to Get
1408
1328
2.3.1. Choosing An Installation Package
1410
For MySQL 5.1, there are three installation packages to
1411
choose from when installing MySQL on Windows:
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.
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
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:
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.
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.
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
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
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.
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
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."
1448
1364
2.3.2. Installing MySQL with the Automated Installer
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.
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
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.
1463
1378
2.3.3. Using the MySQL Installation Wizard
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.
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
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.
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.
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.
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.
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
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.
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
1510
1421
2.3.3.1. Downloading and Starting the MySQL Installation Wizard
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
1424
http://dev.mysql.com/downloads/. If the package you download is
1425
contained within a Zip archive, you need to extract the archive
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
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.
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.
1542
1452
2.3.3.2. Choosing an Install Type
1544
There are three installation types available: Typical,
1545
Complete, and Custom.
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
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
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.
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,
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.
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.
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.
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."
1571
1479
2.3.3.3. The Custom Install Dialog
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.
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.
1584
1491
You can change the default installation path by clicking the
1585
Change... button to the right of the displayed installation
1492
Change... button to the right of the displayed installation path.
1588
After choosing your installation components and installation
1589
path, click the Next button to advance to the confirmation
1494
After choosing your installation components and installation path,
1495
click the Next button to advance to the confirmation dialog.
1592
1497
2.3.3.4. The Confirmation Dialog
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.
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.
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
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.
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.
1615
1519
2.3.3.5. Changes Made by MySQL Installation Wizard
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
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.
1622
1525
Changes to the Registry
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.
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.
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.
1644
1547
Changes to the Start Menu
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.
1652
1555
The following entries are created within the new Start menu
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
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
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.
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
1671
1573
Changes to the File System
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.
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
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
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.
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
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.
1699
1600
2.3.3.6. Upgrading MySQL with the Installation Wizard
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
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
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.
1714
1614
See Section 2.3.14, "Upgrading MySQL on Windows."
1716
1616
2.3.4. MySQL Server Instance Configuration Wizard
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
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
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.
1729
1629
2.3.4.1. Starting the MySQL Server Instance Configuration Wizard
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
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.
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
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.
1755
Alternatively, you can navigate to the bin directory of your
1756
MySQL installation and launch the MySQLInstanceConfig.exe
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.
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.
1653
Alternatively, you can navigate to the bin directory of your MySQL
1654
installation and launch the MySQLInstanceConfig.exe file directly.
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
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"
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.
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."
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,
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).
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.
1796
1691
2.3.4.2. Choosing a Maintenance Option
1942
1836
2.3.4.6. The InnoDB Tablespace Dialog
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
1950
MySQL Server Instance Configuration Wizard: InnoDB Data
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.
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
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.
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.
1963
1855
2.3.4.7. The Concurrent Connections Dialog
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
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
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
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.
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.
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.
1992
1880
2.3.4.8. The Networking and Strict Mode Options Dialog
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
1885
MySQL Server Instance Configuration Wizard: Network Configuration
2000
1887
TCP/IP networking is enabled by default. To disable TCP/IP
2001
networking, uncheck the box next to the Enable TCP/IP
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.
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
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.
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."
2018
1904
2.3.4.9. The Character Set Dialog
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
2025
1911
MySQL Server Instance Configuration Wizard: Character Set
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.
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.
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.
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.
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
2041
1927
2.3.4.10. The Service Options Dialog
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
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.
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.
2059
Service names can include any legal character except forward
2060
(/) or backward (\) slashes, and must be less than 256
1943
Service names can include any legal character except forward (/)
1944
or backward (\) slashes, and must be less than 256 characters
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.
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
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.
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.
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.
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.
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.
2088
1971
2.3.4.11. The Security Options Dialog
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
2095
1978
MySQL Server Instance Configuration Wizard: Security
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.
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.
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
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.
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.
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.
2112
1994
2.3.4.12. The Confirmation Dialog
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
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.
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.
2132
The MySQL Configuration Wizard then writes these options to
2133
the corresponding configuration file.
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.
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
2013
The MySQL Configuration Wizard then writes these options to the
2014
corresponding configuration file.
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.
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
2023
Wizard connects to the server, sets your new root password, and
2024
applies any other security settings you may have selected.
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.
2150
2030
2.3.5. Installing MySQL from a Noinstall Zip Archive
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
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:
2157
2036
1. Extract the archive to the desired install directory
2498
2366
The service-installation command does not start the server.
2499
2367
Instructions for that are given later in this section.
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:
2505
* On the Windows desktop, right-click on the My Computer
2506
icon, and select Properties
2508
* Next select the Advanced tab from the System Properties
2509
menu that appears, and click the Environment Variables
2512
* Under System Variables, select Path, and then click the
2513
Edit button. The Edit System Variable dialogue should
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:
2373
* On the Windows desktop, right-click on the My Computer icon,
2374
and select Properties.
2376
* Next select the Advanced tab from the System Properties menu
2377
that appears, and click the Environment Variables button.
2379
* Under System Variables, select Path, and then click the Edit
2380
button. The Edit System Variable dialogue should appear.
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
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
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
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:
2545
2410
* You can specify a service name immediately following the
2546
2411
--install option. The default service name is MySQL.
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
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
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.
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
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:
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.
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
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.
2429
For a MySQL server that is installed as a Windows service, the
2430
following rules determine the service name and option files that
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.
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.
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.
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
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
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.
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
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
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.
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
2491
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install-m
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
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."
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.
2647
2506
2.3.12. Testing The MySQL Installation
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
2511
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlshow" -u root
2654
2513
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" version
2656
2515
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql" test
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.
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.
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
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
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."
2676
2535
For more information about mysqlshow, see Section 4.5.6,
2677
"mysqlshow --- Display Database, Table, and Column
2536
"mysqlshow --- Display Database, Table, and Column Information."
2680
2538
2.3.13. Troubleshooting a MySQL Installation Under Windows
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.
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."
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
2703
The following examples show other common error messages you
2704
may encounter when installing MySQL and starting the server
2707
* If the MySQL server cannot find the mysql privileges
2708
database or other critical files, you may see these
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,
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."
2560
The following examples show other common error messages you may
2561
encounter when installing MySQL and starting the server for the
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
2567
Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't
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,
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
2733
2586
C:\> echo %WINDIR%
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
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:
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
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:
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
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
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."
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
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
2768
This occurs when the Configuration Wizard tries to
2769
install the service and finds an existing service with
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
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
2780
2624
C:\> sc delete mysql
2781
2625
[SC] DeleteService SUCCESS
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.
2788
2631
2.3.14. Upgrading MySQL on Windows
2790
2633
This section lists some of the steps you should take when
2791
2634
upgrading MySQL on Windows.
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
2802
2645
http://dev.mysql.com/downloads/.
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
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
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
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
2825
2667
To remove the MySQL service, use the following command:
2826
2668
C:\> C:\mysql\bin\mysqld --remove
2828
2669
If you do not remove the existing service, the MySQL
2829
Installation Wizard may fail to properly install the new
2670
Installation Wizard may fail to properly install the new MySQL
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.
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."
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.
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
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
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."
2858
2698
2.3.15. MySQL on Windows Compared to MySQL on Unix
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:
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
2716
http://support.microsoft.com/default.aspx?scid=kb;en-us;196271
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
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.
2892
2729
* Blocking read
2893
MySQL uses a blocking read for each connection. That has
2894
the following implications if named-pipe connections are
2730
MySQL uses a blocking read for each connection. That has the
2731
following implications if named-pipe connections are enabled:
2897
2733
+ A connection is not disconnected automatically after
2898
eight hours, as happens with the Unix version of
2901
+ If a connection hangs, it is not possible to break
2902
it without killing MySQL.
2904
+ mysqladmin kill does not work on a sleeping
2907
+ mysqladmin shutdown cannot abort as long as there
2908
are sleeping connections.
2734
eight hours, as happens with the Unix version of MySQL.
2736
+ If a connection hangs, it is not possible to break it
2737
without killing MySQL.
2739
+ mysqladmin kill does not work on a sleeping connection.
2741
+ mysqladmin shutdown cannot abort as long as there are
2742
sleeping connections.
2909
2743
We plan to fix this problem in the future.
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.
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
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.
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.
2933
2766
* DROP DATABASE
2934
2767
You cannot drop a database that is in use by some thread.
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
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."
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;
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;
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
2962
This is mainly a problem when you try to apply a binary
2790
Windows thinks that it has encountered end-of-file and aborts
2792
This is mainly a problem when you try to apply a binary log as
2964
2794
C:\> mysqlbinlog binary_log_file | mysql --user=root
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"
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.
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
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'
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
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:
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.
2993
2819
2.4. Installing MySQL from RPM Packages on Linux
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."
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."
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."
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."
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
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
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.
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."
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
2850
MySQL-client packages to get a functional MySQL installation. The
2851
other packages are not required for a standard installation.
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.
3040
When upgrading a MySQL Cluster RPM installation, you must
3041
upgrade all installed RPMs, including the Server and Client
2863
When upgrading a MySQL Cluster RPM installation, you must upgrade
2864
all installed RPMs, including the Server and Client RPMs.
3044
For more information about installing MySQL Cluster from
3045
RPMs, see Section 17.2.2, "MySQL Cluster Multi-Computer
2866
For more information about installing MySQL Cluster from RPMs, see
2867
Section 17.2.2, "MySQL Cluster Multi-Computer Installation."
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
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.
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
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.)
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
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.
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.
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.
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
2906
The libraries and include files that are needed if you want to
2907
compile other MySQL clients, such as the Perl modules.
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
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.
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.
3116
2931
* MySQL-embedded-VERSION.glibc23.i386.rpm
3117
2932
The embedded MySQL server library.
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.
3134
2948
* MySQL-test-VERSION.glibc23.i386.rpm
3135
2949
This package includes the MySQL test suite.
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).
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
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.
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
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
3158
2973
In MySQL 5.1, only glibc23 packages are available currently.
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
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
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
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
3173
2988
shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm
3174
2989
shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
3176
To install only the client programs, install just the client
2991
To install only the client programs, install just the client RPM:
3178
2992
shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
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."
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
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."
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.
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:
3207
3018
shell> ln -s rc.d/init.d .
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.
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.
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."
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."
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.
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
3247
3057
2.5. Installing MySQL on Mac OS X
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
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
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
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.
3260
3069
To obtain MySQL, see Section 2.1.3, "How to Get MySQL."
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
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.
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)
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
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.
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.
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
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
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
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
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.
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
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.
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
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
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
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
3895
3661
5. Change location into the installation directory:
3896
3662
shell> cd mysql
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:
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."
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
3674
script used to initialize the mysql database containing
3675
the grant tables that store the server access
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 .
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.
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
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
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.
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
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
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
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.
3970
After everything has been unpacked and installed, you should
3971
test your distribution. To start the MySQL server, use the
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.
3729
After everything has been unpacked and installed, you should test
3730
your distribution. To start the MySQL server, use the following
3973
3732
shell> bin/mysqld_safe --user=mysql &
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
3981
If the command fails immediately and prints mysqld ended, you
3982
can find some information in the host_name.err file in the
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
3985
3744
More information about mysqld_safe is given in Section 4.3.2,
3986
3745
"mysqld_safe --- MySQL Server Startup Script."
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."
3995
3754
2.10. MySQL Installation Using a Source Distribution
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
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
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.
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."
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.
4012
3769
You need the following tools to build and install MySQL from
4015
3772
* GNU gunzip to uncompress the distribution.
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
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.
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
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.
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.
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.
4044
3798
* libtool 1.5.24 or later is also recommended.
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
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 \
4604
4298
dynamically loaded
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
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."
4613
* To configure MySQL with debugging code, use the
4614
--with-debug option:
4306
* To configure MySQL with debugging code, use the --with-debug
4615
4308
shell> ./configure --with-debug
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
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
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
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
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.
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
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.
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.
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.
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)
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:
4695
+ The plugin-related options
4697
+ The names of all available plugins
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
4704
4378
--with-plugins=PLUGIN[,PLUGIN]...
4705
4379
--with-plugins=GROUP
4706
4380
--with-plugin-PLUGIN
4707
4381
--without-plugin-PLUGIN
4709
PLUGIN is an individual plugin name such as csv or
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
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
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
4392
+ The plugin-related options
4394
+ The names of all available plugins
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
4404
--without-plugin-PLUGIN disables the given plugin from being
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
4731
4416
2.10.3. Installing from the Development Source Tree
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
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).
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.
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.
4756
4440
To build under Unix/Linux, you must have the following tools
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.
4765
4448
* autoconf 2.58 (or newer), available from
4766
4449
http://www.gnu.org/software/autoconf/.
4774
4457
* m4, available from http://www.gnu.org/software/m4/.
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
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
4785
The maximum table size is not actually exceeded; the
4786
error is caused by bugs in older versions of bison.
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.
4792
Once you have the necessary tools installed, you first need
4793
to create a local branch of the MySQL source code on your
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.
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.
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:
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
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
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
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
4817
4496
shell> bzr branch mysql-5.1 mysql-5.1-build
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
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.
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."
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
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.
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
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
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
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
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
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.
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.
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."
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
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.
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
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."
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
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
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:
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
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.
4920
4590
2.10.4. Dealing with Problems Compiling MySQL
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
4929
The solution to many problems involves reconfiguring. If you
4930
do need to reconfigure, take note of the following:
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.
4598
The solution to many problems involves reconfiguring. If you do
4599
need to reconfigure, take note of the following:
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
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.
4945
4614
To prevent old configuration information or object files from
4946
4615
being used, run these commands before re-running configure:
5637
5266
+------+-------+------+
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
5269
"mysqlshow --- Display Database, Table, and Column Information,"
5270
and Section 4.5.1, "mysql --- The MySQL Command-Line Tool."
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
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."
5649
5276
2.11.2. Unix Post-Installation Procedures
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
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:
5662
* If you install MySQL on Linux using RPM distributions,
5663
the server RPM runs mysql_install_db.
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
5289
* If you install MySQL on Linux using RPM distributions, the
5290
server RPM runs mysql_install_db.
5292
* If you install MySQL on Mac OS X using a PKG distribution, the
5293
installer runs mysql_install_db.
5668
5295
Otherwise, you'll need to run mysql_install_db yourself.
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."
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."
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.
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."
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."
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.
5315
1. Change location into the top-level directory of your MySQL
5316
installation, represented here by BASEDIR:
5691
5317
shell> cd BASEDIR
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.
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
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
5318
BASEDIR is likely to be something like /usr/local/mysql or
5319
/usr/local. The following steps assume that you are located in
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
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
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
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."
5747
5372
3. Start the MySQL server:
5748
5373
shell> bin/mysqld_safe --user=mysql &
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
5757
Further instructions for running MySQL as an unprivileged
5758
user are given in Section 5.3.5, "How to Run MySQL as a
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
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'
5765
If you have other problems starting the server, see
5766
Section 2.11.2.3, "Starting and Troubleshooting the MySQL
5387
If you have other problems starting the server, see Section
5388
2.11.2.3, "Starting and Troubleshooting the MySQL Server."
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
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
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
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
6544
6125
The UPDATE statement applies both to Windows and to Unix.
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
6550
6131
shell> mysqladmin -u root -p shutdown
6551
6132
Enter password: (enter root password here)
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.
6559
To set up additional accounts, you can use the GRANT
6560
statement. For instructions, see Section 5.5.2, "Adding User
6563
2.12. Upgrading MySQL
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.
6578
The following items form a checklist of things that you
6579
should do whenever you perform an upgrade from MySQL 5.0 to
6137
B.1.4.1, "How to Reset the Root Password," covers the procedure
6140
To set up additional accounts, you can use the GRANT statement.
6141
For instructions, see Section 5.5.2, "Adding User Accounts."
6143
2.12. Upgrading or Downgrading MySQL
6145
2.12.1. Upgrading MySQL
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.
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:
6582
6162
* Before any upgrade, back up your databases, including the
6583
6163
mysql database that contains the grant tables.
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.
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."
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.
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."
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.)
6606
6185
* If you are running MySQL Server on Windows, see Section
6607
6186
2.3.14, "Upgrading MySQL on Windows."
6609
* If you are using replication, see Section 16.3.3,
6610
"Upgrading a Replication Setup," for information on
6611
upgrading your replication setup.
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.
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.
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
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
6188
* If you are using replication, see Section 16.3.3, "Upgrading a
6189
Replication Setup," for information on upgrading your
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
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.
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
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.
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
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.
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.
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.
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
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.
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.
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.
6247
2.12.1.1. Upgrading from MySQL 5.0 to 5.1
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."
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
6692
In general, you should do the following when upgrading from
6695
* Read all the items in the following sections to see
6696
whether any of them might affect your applications:
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.
6263
In general, you should do the following when upgrading from MySQL
6266
* Read all the items in the following sections to see whether
6267
any of them might affect your applications:
6269
+ Section 2.12.1, "Upgrading MySQL," has general update
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.
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)."
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
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
6724
A dump and reload is done like this:
6726
+ Dump the affected tables with mysqldump before
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."
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.
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)."
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
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
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."
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.)
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
6748
6318
* If you are running MySQL Server on Windows, see Section
6749
6319
2.3.14, "Upgrading MySQL on Windows."
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
6755
The following lists describe changes that may affect
6756
applications and that you should watch out for when upgrading
6325
The following lists describe changes that may affect applications
6326
and that you should watch out for when upgrading to MySQL 5.1.
6759
6328
Configuration Changes:
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.
6771
6339
Server Changes:
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
6784
However, the fix is not backward compatible and can
6785
result in a downgrading problem under these
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:
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.
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.
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#
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
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
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.
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;
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`;
6827
6403
This problem is fixed as of MySQL 5.1.23.
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
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
6839
6414
1. Create a view v_orig in MySQL 5.1.29 or higher.
6841
6416
2. Rename the view to v_new and then back to v_orig.
6843
3. Downgrade to an older 5.1.x server and run
6418
3. Downgrade to an older 5.1.x server and run mysql_upgrade.
6846
6420
4. Try to rename v_orig to v_new again. This operation
6848
As a workaround to avoid this problem, use either of
6851
+ Dump your data using mysqldump before downgrading
6852
and reload the dump file after downgrading.
6854
+ Instead of renaming a view after the downgrade, drop
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.
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
6425
+ Dump your data using mysqldump before downgrading and
6426
reload the dump file after downgrading.
6428
+ Instead of renaming a view after the downgrade, drop it
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
6441
For example, a table definition might look like this when
6442
dumped in MySQL 5.0:
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
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
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.
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
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.
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."
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.
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
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
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
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.
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
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.
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
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
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.
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.
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.
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
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.
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.
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
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.
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,
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.
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
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).
6994
6604
* Incompatible change: As of MySQL 5.1.15, the following
6995
conditions apply to enabling the read_only system
6605
conditions apply to enabling the read_only system variable:
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.
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.
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.
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:
7027
6634
+ IGNORE_SPACE is disabled.
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:
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
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.
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
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;
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."
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
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.
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
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.
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.
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."
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
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.
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
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
6713
shell> mysqlcheck --check-upgrade --fix-db-names --fix-table-names --
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.
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.
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.
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;
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.
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
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
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
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
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
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.
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.
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:
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.)
7204
2. Dump all trigger definitions using the following
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:
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.)
6796
2. Dump all trigger definitions using the following SELECT
6798
SELECT CONCAT('CREATE TRIGGER ', t.TRIGGER_SCHEMA, '.', t.TRIGGER_NAM
6800
' ', t.ACTION_TIMING, ' ', t.EVENT_MANIPULATION, ' ON '
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;
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
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
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.
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
7228
4. Start the server and re-create all triggers using
7229
the triggers.sql file: For example in my case it
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 //
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.
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.)
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."
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.
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
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)
7278
2.12.2. Copying MySQL Databases to Another Machine
6863
2.12.2. Downgrading MySQL
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.
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.
6875
The following items form a checklist of things you should do
6876
whenever you perform a downgrade:
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
6883
* If there is a downgrading section for that version, you should
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").
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."
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.
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."
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:
6913
1. Stop the older MySQL server that you are downgrading to.
6915
2. Restart the newer MySQL server you are downgrading from.
6917
3. Dump any tables that were inaccessible to the older server by
6918
using mysqldump to create a dump file.
6920
4. Stop the newer MySQL server and restart the older one.
6922
5. Reload the dump file into the older server. Your tables should
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
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.
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.
6939
2.12.2.1. Downgrading to MySQL 5.0
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:
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
6952
+ Export the table using mysqldump and then drop it in
6953
MySQL 5.1; import the table again following the downgrade
6956
+ Prior to the downgrade, remove the table's partitioning
6957
using ALTER TABLE table_name REMOVE PARTITIONING.
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.")
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.
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.
6984
2.12.3. Checking Whether Table Indexes Must Be Rebuilt
6986
A binary upgrade or downgrade is one that installs one version of
6987
MySQL "in place" over an existing version, without dumping and
6990
1. Stop the server for the existing version if it is running.
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.
6996
3. Start the server for the new version.
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
7006
* Comparison results that differ from previous results
7008
* Inability to find some index values due to misordered index
7011
* Misordered ORDER BY results
7013
* Tables that CHECK TABLE reports as being in need of repair
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."
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.
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.
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."
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."
7049
Changes that cause index rebuilding to be necessary:
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).
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).
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).
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).
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).
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).
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).
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).
7120
2.12.4. Rebuilding Tables or Table Indexes
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.
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
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.
7144
For the examples in this section, suppose that a table t1 is
7147
c1 VARCHAR(10) CHARACTER SET macce,
7148
c2 TEXT CHARACTER SET ujis,
7149
c3 VARCHAR(20) CHARACTER SET latin1,
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
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
7164
To recreate all tables in all databases, use the --all-databases
7166
shell> mysqldump --all-databases > dump.sql
7167
shell> mysql < dump.sql
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;
7174
If you are not sure which storage engine is used for the table,
7175
use SHOW CREATE TABLE to display the table definition.
7177
2.12.5. Copying MySQL Databases to Another Machine
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."
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
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.
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.
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
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
7200
shell> mysqldump -h 'other_hostname' --compress db_name | mysql db_na
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
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
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
7326
7220
First, create the directory for the output files and dump the
7329
7223
shell> mysqldump --tab=DUMPDIR db_name
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
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
7336
7231
shell> mysqlimport db_name DUMPDIR/*.txt # load data into tables
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.
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.
7347
2.13. Downgrading MySQL
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.
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.
7359
The following items form a checklist of things you should do
7360
whenever you perform a downgrade:
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,
7367
* If there is a downgrading section for that version, you
7368
should read that as well.
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").
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
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."
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:
7390
1. Stop the older MySQL server that you are downgrading to.
7392
2. Restart the newer MySQL server you are downgrading from.
7394
3. Dump any tables that were inaccessible to the older
7395
server by using mysqldump to create a dump file.
7397
4. Stop the newer MySQL server and restart the older one.
7399
5. Reload the dump file into the older server. Your tables
7400
should be accessible.
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:
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
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.
7417
2.13.1. Downgrading to MySQL 5.0
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
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
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:
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.
7442
+ Prior to the downgrade, remove the table's
7443
partitioning using ALTER TABLE table_name REMOVE
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
7461
2.14. Operating System-Specific Notes
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.
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
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
7238
After you import the mysql database on the new machine, execute
7239
mysqladmin flush-privileges so that the server reloads the grant
7242
2.13. Operating System-Specific Notes
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
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.
7256
2.13.1.1. Linux Operating System Notes
7478
7258
MySQL needs at least Linux version 2.0.
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.
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.
7496
2.14.1.2. Linux Binary Distribution Notes
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.
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
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.
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.
7275
2.13.1.2. Linux Binary Distribution Notes
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.
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.
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
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
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.
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
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.
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.
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.
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.
7568
2.14.1.3. Linux Source Distribution Notes
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
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
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
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.
7342
2.13.1.3. Linux Source Distribution Notes
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.
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.
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
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.
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:
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
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.
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
7622
(http://dev.mysql.com/Downloads/Linux/linuxthreads-2.1-patch)
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;
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.
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).
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.
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.
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.
7661
7426
If you link your own MySQL client programs, you may see the
7662
7427
following error at runtime:
7732
7495
open-files-limit=8192
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.
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.
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
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.
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.
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
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.
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
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.
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.
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.
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
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
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.
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
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."
7832
2.14.1.5. Linux x86 Notes
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.
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
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."
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."
7587
2.13.1.5. Linux x86 Notes
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.
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.
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.
7854
On some older Linux distributions, configure may produce an
7608
On some older Linux distributions, configure may produce an error
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.
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
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
7864
You may get some warnings when compiling. Those shown here
7618
You may get some warnings when compiling. Those shown here can be
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