This is the MySQL reference manual; it documents MySQL version 3.22.21.
MySQL is a very fast, multi-threaded, multi-user and robust SQL (Structured Query Language) database server.
For Unix and OS/2 platforms, MySQL is basically free; for Microsoft platforms you must get a MySQL license after a trial time of 30 days. See section 3 MySQL licensing and support.
The MySQL home page provides the latest information about MySQL.
For a discussion of MySQL's capabilities, see section 1.4 The main features of MySQL.
For installation instructions, see section 4 Installing MySQL. For tips on porting MySQL to new machines or operating systems, see section G Comments on porting to other systems.
For information about upgrading from a 3.21 release, see section 4.16.1 Upgrading from a 3.21 version to 3.22.
For examples of SQL and benchmarking information, see the benchmarking directory. For source distributions, this is the `bench' directory. For binary distributions, this is the `sql-bench' directory.
For a history of new features and bug fixes, see section D MySQL change history.
For a list of currently known bugs and misfeatures, see section E Known errors and design deficiencies in MySQL.
For future plans, see section F List of things we want to add to MySQL in the future (The TODO).
For a list of all the contributors to this product, see section C Contributors to MySQL.
IMPORTANT:
Send bug (error) reports, questions and comments to the mailing list at
For source distributions, the mysqlbug script can be found in the
`scripts' directory. For binary distributions, mysqlbug can be
found in the `bin' directory.
If you have any suggestions concerning additions or corrections to this
manual, please send them to the MySQL mailing list
(mysql@lists.mysql.com) with the following subject line:
documentation suggestion: [Insert Topic Here].
See section 2.1 The MySQL mailing lists.
MySQL is a true multi-user, multi-threaded SQL database server. SQL
is the most popular database language in the world. MySQL is a
client/server implementation that consists of a server daemon mysqld
and many different client programs and libraries.
The main goals of MySQL are speed, robustness and ease of use. MySQL was originally developed because we at TcX needed a SQL server that could handle very large databases an order of magnitude faster than what any database vendor could offer to us. We have now been using MySQL since 1996 in an environment with more than 40 databases containing 10,000 tables, of which more than 500 have more than 7 million rows. This is about 100 gigabytes of mission-critical data.
The base upon which MySQL is built is a set of routines that have been used in a highly demanding production environment for many years. Although MySQL is still under development, it already offers a rich and highly useful function set.
The official way to pronounce MySQL is "My Ess Que Ell" (Not MY-SEQUEL).
This manual is currently available in Texinfo, plain text, Info, HTML, PostScript and PDF versions. Because of their size, PostScript and PDF versions are not included with the main MySQL distribution, but are available for separate download at http://www.mysql.com.
The primary document is the Texinfo file. The HTML version is produced
automatically with a modified version of texi2html. The plain text and
Info versions are produced with makeinfo. The Postscript version is
produced using texi2dvi and dvips. The PDF version is produced
with the Ghostscript utility ps2pdf.
This manual is written and maintained by David Axmark, Michael (Monty) Widenius, Paul DuBois and Kim Aldale. For other contributors, see section C Contributors to MySQL.
This manual uses certain typographical conventions:
constant
mysqladmin works, invoke it with the
--help option."
When commands are shown that are meant to be executed by a particular
program, the program is indicated by the prompt shown with the command. For
example, shell> indicates a command that you execute from your login
shell, and mysql> indicates a command that you execute from the
mysql client:
shell> type a shell command here mysql> type a mysql command here
Shell commands are shown using Bourne shell syntax. If you are using a
csh-style shell, you may need to issue commands slightly differently.
For example, the sequence to set an environment variable and run a command
looks like this in Bourne shell syntax:
shell> VARNAME=value some_command
For csh, you would execute the sequence like this:
shell> setenv VARNAME value shell> some_command
Database, table and column names often must be substituted into commands. To
indicate that such substitution is necessary, this manual uses
db_name, tbl_name and col_name. For example, you might
see a statement like this:
mysql> SELECT col_name FROM db_name.tbl_name;
This means that if you were to enter a similar statement, you would supply your own database, table and column names, perhaps like this:
mysql> SELECT author_name FROM biblio_db.author_list;
SQL statements may be written in uppercase or lowercase. When this manual
shows a SQL statement, uppercase is used for particular keywords if those
keywords are under discussion (to emphasize them) and lowercase is used for
the rest of the statement. So you might see the following in a discussion of
the SELECT statement:
mysql> SELECT count(*) FROM tbl_name;
On the other hand, in a discussion of the COUNT() function, the
statement would be written like this:
mysql> select COUNT(*) from tbl_name;
If no particular emphasis is intended, all keywords are written uniformly in uppercase.
In syntax descriptions, square brackets (`[' and `]') are used to indicate optional words or clauses:
DROP TABLE [IF EXISTS] tbl_name
When a syntax element consists of a number of alternatives, the alternatives are separated by vertical bars (`|'). When one member from a set of choices may be chosen, the alternatives are listed within square brackets. When one member from a set of choices must be chosen, the alternatives are listed within braces (`{' and `}'):
TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)
{DESCRIBE | DESC} tbl_name {col_name | wild}
We once started off with the intention of using mSQL to connect to our
tables using our own fast low-level (ISAM) routines. However, after some
testing we came to the conclusion that mSQL was not fast enough or
flexible enough for our needs. This resulted in a new SQL interface to our
database but with almost the same API interface as mSQL. This API was
chosen to ease porting of third-party code.
The derivation of the name MySQL is not perfectly clear. Our base directory and a large number of our libraries and tools have had the prefix "my" for well over 10 years. However, Monty's daughter (some years younger) is also named My. So which of the two gave its name to MySQL is still a mystery, even for us.
The following list describes some of the important characteristics of MySQL:
FLOAT, DOUBLE, CHAR, VARCHAR,
TEXT, BLOB, DATE, TIME, DATETIME,
TIMESTAMP, YEAR, SET and ENUM types. See section 7.2 Column types.
SELECT and WHERE
parts of queries. Example:
mysql> SELECT CONCAT(first_name, " ", last_name) FROM tbl_name
WHERE income/dependents > 10000 AND age > 30;
GROUP BY and ORDER BY clauses. Support for
group functions (COUNT(), AVG(), STD(), SUM(),
MAX() and MIN()).
LEFT OUTER JOIN with ANSI SQL and ODBC syntax.
CHAR or VARCHAR field.
INSERT to insert a
subset of a table's columns; those columns that are not explicitly given
values are set to their default values.
libtool for portability.
purify).
isamchk, a very fast utility for table checking, optimization
and repair.
See section 13 Using isamchk for table maintenance and crash recovery.
DELETE, INSERT, REPLACE, and UPDATE return
how many rows were affected.
ABS
is a valid column name. The only restriction is that for a function call, no
spaces are allowed between the function name and the `(' that follows it.
See section 7.30 Is MySQL picky about reserved words?.
--help or -?
options to obtain online assistance.
SHOW command can be used to retrieve
information about databases, tables and indexes. The EXPLAIN command
can be used to determine how the optimizer resolves a query.
This section addresses the questions, "how stable is MySQL?" and, "can I depend on MySQL in this project?" Here we will try to clarify some issues and to answer some of the more important questions that seem to concern many people. This section has been put together from information gathered from the mailing list (which is very active in reporting bugs).
At TcX, MySQL has worked without any problems in our projects since mid-1996. When MySQL was released to a wider public, we noticed that there were some pieces of "untested code" that were quickly found by the new users who made queries in a manner different than our own. Each new release has had fewer portability problems than the previous one (even though each has had many new features), and we hope that it will be possible to label one of the next releases "stable".
Each release of MySQL has been usable and there have been problems only when users start to use code from "the gray zones". Naturally, outside users can't know what the gray zones are; this section attempts to indicate those that are currently known. The descriptions deal with the 3.22.x version of MySQL. All known and reported bugs are fixed in the latest version, with the exception of the bugs listed in the bugs section, which are things that are "design"-related. See section E Known errors and design deficiencies in MySQL.
MySQL is written in multiple layers and different independent modules. These modules are listed below with an indication of how well-tested each of them is:
mysql, mysqladmin and mysqlshow,
mysqldump, and mysqlimport.
fcntl()). In these cases, you should run the
MySQL daemon with the --skip-locking flag. Problems are known
to occur on some Linux systems and on SunOS when using NFS-mounted file
systems.
fcntl() call, which is fixed
by using the --skip-locking option to mysqld. Some people
have reported lockup problems with the 0.5 release.
SELECT
statements are usually done in one time frame so there shouldn't be a mutex
locking/thread juggling.
LOAD DATA ..., INSERT ... SELECT -- Stable
ALTER TABLE -- Gamma
mysqlaccess -- Gamma
GRANT -- Beta
TcX provides email support for paying customers, but the MySQL mailing list usually provides answers to common questions. Bugs are usually fixed right away with a patch; for serious bugs, there is almost always a new release.
MySQL itself has no problems with Year 2000 (Y2K) compliance:
2069; all 2-digit years are regarded to be in the range
1970 to 2069, which means that if you store 01 in a
year column, MySQL treats it as 2001.
YEAR column type
can store years 0 and 1901 to 2155 in 1 byte and display
them using 2 or 4 digits.
You may run into problems with applications that use MySQL in a
way that is not Y2K-safe. For example, many old applications store
or manipulate years using 2-digit values (which are ambiguous) rather than
4-digit values. This problem may be compounded by applications that use
values such as 00 or 99 as "missing" value indicators.
Unfortunately, these problems may be difficult to fix, since different applications may be written by different programmers, each of whom may use a different set of conventions and date-handling functions.
Here is a simple demonstration illustrating that MySQL doesn't have any problems with dates until the year 2030!
mysql> DROP TABLE IF EXISTS y2k;
mysql> CREATE TABLE y2k (date date, date_time datetime, time_stamp timestamp);
mysql> INSERT INTO y2k VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
mysql> INSERT INTO y2k VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
mysql> INSERT INTO y2k VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
mysql> INSERT INTO y2k VALUES ("2000-01-01","2000-01-01 00:00:00",20000101000000);
mysql> INSERT INTO y2k VALUES ("2000-02-28","2000-02-28 00:00:00",20000228000000);
mysql> INSERT INTO y2k VALUES ("2000-02-29","2000-02-29 00:00:00",20000229000000);
mysql> INSERT INTO y2k VALUES ("2000-03-01","2000-03-01 00:00:00",20000301000000);
mysql> INSERT INTO y2k VALUES ("2000-12-31","2000-12-31 23:59:59",20001231235959);
mysql> INSERT INTO y2k VALUES ("2001-01-01","2001-01-01 00:00:00",20010101000000);
mysql> INSERT INTO y2k VALUES ("2004-12-31","2004-12-31 23:59:59",20041231235959);
mysql> INSERT INTO y2k VALUES ("2005-01-01","2005-01-01 00:00:00",20050101000000);
mysql> INSERT INTO y2k VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
mysql> INSERT INTO y2k VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000);
mysql> SELECT * FROM y2k;
+------------+---------------------+----------------+
| date | date_time | time_stamp |
+------------+---------------------+----------------+
| 1998-12-31 | 1998-12-31 23:59:59 | 19981231235959 |
| 1999-01-01 | 1999-01-01 00:00:00 | 19981231000000 |
| 1999-09-09 | 1999-09-09 23:59:59 | 19990909235959 |
| 2000-01-01 | 2000-01-01 00:00:00 | 20000101000000 |
| 2000-02-28 | 2000-02-28 00:00:00 | 20000228000000 |
| 2000-02-29 | 2000-02-29 00:00:00 | 20000229000000 |
| 2000-03-01 | 2000-03-01 00:00:00 | 20000301000000 |
| 2000-12-31 | 2000-12-31 23:59:59 | 20001231235959 |
| 2001-01-01 | 2001-01-01 00:00:00 | 20010101000000 |
| 2004-12-31 | 2004-12-31 23:59:59 | 20041231235959 |
| 2005-01-01 | 2005-01-01 00:00:00 | 20050101000000 |
| 2030-01-01 | 2030-01-01 00:00:00 | 20300101000000 |
| 2050-01-01 | 2050-01-01 00:00:00 | 00000000000000 |
+------------+---------------------+----------------+
13 rows in set (0.00 sec)
mysql> DROP TABLE y2k;
This shows that the DATE and DATETIME types are Date
Data compliant, while the TIMESTAMP type, that is used to store the
current time, has a range up to only 2030-01-01. TIMESTAMP has
a range of 1970 to 2030 on 32-bit machines.
Even though MySQL is Y2K-compliant, it is your responsibility to provide unambiguous input. See section 7.2.6.1 Y2K issues and date types for MySQL's rules for dealing with ambiguous date input data (data containing 2-digit year values).
This book has been recommended by a several people on the MySQL mailing list:
Judith S. Bowman, Sandra L. Emerson and Marcy Darnovsky The Practical SQL Handbook: Using Structured Query Language Second Edition Addison-Wesley ISBN 0-201-62623-3 http://www.awl.com
This book has also received some recommendations on the mailing list:
Martin Gruber Understanding SQL ISBN 0-89588-644-8 Publisher Sybex 510 523 8233 Alameda, CA USA
A SQL tutorial is available on the net at http://w3.one.net/~jhoffman/sqltut.htm.
DBI/DBD.
mSQL
mSQL TCL
DBI/DBD modules homepage
There are also many web pages that use MySQL. See section A Some MySQL users. Send any additions to this list to
To subscribe to the main MySQL mailing list, send a message to the electronic mail address mysql-subscribe@lists.mysql.com.
To unsubscribe from the main MySQL mailing list, send a message to the electronic mail address mysql-unsubscribe@lists.mysql.com.
Only the address to which you send your messages is significant. The subject line and the body of the message are ignored.
If your reply address is not valid, you can specify your address explicitly.
Adding a hyphen to the subscribe or unsubscribe command word, followed by
your address with the `@' character in your address replaced by a
`='. For example, to subscribe john@host.domain, send a message
to mysql-subscribe-john=host.domain@lists.mysql.com.
Mail to mysql-subscribe@lists.mysql.com or ezmlm mailing list processor. Information about ezmlm is available at the ezmlm Website.
To post a message to the list itself, send your message to
mysql@lists.mysql.com. However, please do not send mail about
subscribing or unsubscribing to mysql@lists.mysql.com, since any
mail sent to that address is distributed automatically to thousands of other
users.
Your local site may have many subscribers to mysql@lists.mysql.com.
If so, it may have a local mailing list, so that messages sent from
lists.mysql.com to your site are propagated to the local list. In such
cases, please contact your system administrator to be added to or dropped
from the local MySQL list.
The following MySQL mailing lists exist:
announce
mysql
mysql-digest
mysql list in digest form. That means you get all individual
messages, sent as one large mail message once a day.
java
java-digest
java list.
win32
win32-digest
win32 list.
myodbc
myodbc-digest
myodbc list.
msql-mysql-modules
msql-mysql-modules-digest
msql-mysql-modules list.
developer
developer-digest
developer list.
You subscribe or unsubscribe to all lists in the same way as described
above. In your subscribe or unsubscribe message, just put the appropriate
mailing list name rather than mysql. For example, to subscribe to or
unsubscribe from the myodbc list, send a message to
Before posting a bug report or question, please do the following:
http://www.mysql.com/Manual_chapter/manual_toc.htmlWe try to keep the manual up to date by updating it frequently with solutions to newly found problems!
http://www.mysql.com/doc.html
If you can't find an answer in the manual or the archives, check with your local MySQL expert. If you still can't find an answer to your question, go ahead and read the next section about how to send mail to
Writing a good bug report takes patience, but doing it right the first time saves time for us and for you. This section will help you write your report correctly so that you don't waste your time doing things that may not help us much or at all.
We encourage everyone to use the mysqlbug script to generate a bug
report (or a report about any problem), if possible. mysqlbug can be
found in the `scripts' directory in the source distribution, or, for a
binary distribution, in the `bin' directory under your MySQL
installation directory. If you are unable to use mysqlbug, you should
still include all the necessary information listed in this section.
The mysqlbug script helps you generate a report by determining much
of the following information automatically, but if something important is
missing, please include it with your message! Please read this section
carefully and make sure that all the information described here is included
in your report.
Remember that it is possible to respond to a message containing too much information, but not to one containing too little. Often people omit facts because they think they know the cause of a problem and assume that some details don't matter. A good principle is: if you are in doubt about stating something, state it! It is a thousand times faster and less troublesome to write a couple of lines more in your report than to be forced to ask again and wait for the answer because you didn't include enough information the first time.
The most common errors are that people don't indicate the version number of the MySQL distribution they are using, or don't indicate what platform they have MySQL installed on (including the platform version number). This is highly relevant information and in 99 cases out of 100 the bug report is useless without it! Very often we get questions like "Why doesn't this work for me?" and then we find that the feature requested wasn't implemented in that MySQL version, or that a bug described in a report has been fixed already in newer MySQL versions. Sometimes the error is platform dependent; in such cases, it is next to impossible to fix anything without knowing the operating system and the version number of the platform.
Remember also to provide information about your compiler, if it is related to the problem. Often people find bugs in compilers and think the problem is MySQL related. Most compilers are under development all the time and become better version by version, too. To determine whether or not your problem depends on your compiler, we need to know what compiler is used. Note that every compiling problem should be regarded as a bug report and reported accordingly.
It is most helpful when a good description of the problem is included in the bug report. That is, a good example of all the things you did that led to the problem and the problem itself exactly described. The best reports are those that include a full example showing how to reproduce the bug or problem.
If a program produces an error message, it is very important to include the message in your report! If we try to search for something from the archives using programs, it is better that the error message reported exactly matches the one that the program produces. (Even the case sensitivity should be observed!) You should never try to remember what the error message was; instead, copy and paste the entire message into your report!
Please include the following information in your report:
mysqladmin version. mysqladmin can be
found in the `bin' directory under your MySQL installation
directory.
uname -a.
mysqldump --no-data db_name tbl_name1 tbl_name2 ... This is very easy
to do and is a powerful way to get information about any table in a database
that will help us create a situation matching the one you have.
SELECT statements, you should
always include the output of EXPLAIN SELECT ..., and at least the
number of rows that the SELECT statement produces. The more
information you give about your situation, the more likely it is that someone
can help you! For example, the following is an example of a very good bug
report (it should of course be posted with the mysqlbug script):
Example run under the mysql command line tool:
mysql> SHOW VARIABLES;
mysql> EXPLAIN SELECT ...
<output-from-EXPLAIN>
mysql> FLUSH STATUS;
mysql> SELECT ...
<A short version of the output from SELECT,
including the time taken to run the query>
mysql> SHOW STATUS;
<output from SHOW STATUS>
mysqladmin variables extended-status processlist in your mail to
provide some information of how your system is performing!
ftp to
transfer it to ftp://www.mysql.com/pub/mysql/secret/. If the data are
really top secret and you don't want to show them even to us, then go ahead
and provide an example using other names, but please regard this as the last
choice.
mysqld
daemon and that you use to run any MySQL client programs. The
options to programs like mysqld and mysql, and to the
configure script are often keys to answers and very relevant! It is
never a bad idea to include them anyway! If you use any modules, such as
Perl or PHP, please include the version number(s) of those as well.
mysqldump and create a `README' file
that describes your problem.
Create a compressed archive of your files using
tar and gzip or zip, and use ftp
to transfer the archive to ftp://www.mysql.com/pub/mysql/secret/.
Then send a short description of the problem to
mysqlaccess, the output of mysqladmin reload and all
the error messages you get when trying to connect! When you test your
privileges, you should first run mysqlaccess. After this, execute
mysqladmin reload version, and last you should try to connect with the
program that gives you trouble. mysqlaccess can be found in the
`bin' directory under your MySQL installation directory.
parse error, please check your syntax closely! If you
can't find something wrong with it, it's extremely likely that your current
version of MySQL doesn't support the query you are using. If you
are using the current version and the manual at
http://www.mysql.com/doc.html doesn't cover the syntax you are using,
MySQL doesn't support your query. In this case, your only options
are to implement the syntax yourself or email mysql-support@mysql.com
and ask for an offer to implement it!
If the manual covers the syntax you are using, but you have an older version
of MySQL, you should check the MySQL change history to see
when the syntax was implemented. See section D MySQL change history. In this case, you have the
option of upgrading to a newer version of MySQL.
isamchk.
See section 13 Using isamchk for table maintenance and crash recovery.
mysqld should
NEVER crash a table if nothing killed it in the middle of an
update! If you can find the source of why mysqld dies, it's much
easier for us to provide you with a fix for the problem!
If you are a support customer, please cross-post the bug report to the appropriate mailing list to see if someone else has experienced (and perhaps solved) the problem.
For information on reporting bugs in MyODBC, see section 15.2 How to report problems with MyODBC.
For solutions to some common problems, see See section 16 Problems and common errors.
When answers are sent to you individually and not to the mailing list, it is considered good etiquette to summarize the answers and send the summary to the mailing list so that others may have the benefit of responses you received that helped you solve your problem!
If you consider your answer to have broad interest, you may want to post it to the mailing list instead of replying directly to the individual who asked. Try to make your answer general enough that people other than the original poster may benefit from it. When you post to the list, please make sure that your answer is not a duplication of a previous answer.
Try to summarize the essential part of the question in your reply; don't feel obliged to quote the entire original message.
Please don't post mail messages from your browser with HTML mode turned on! Many users doesn't read mail with a browser!
This chapter describes MySQL licensing and support arrangements, including:
The formal terms of the license for non-Microsoft operating systems such as Unix or OS/2 are specified in section J The MySQL server license for non Microsoft operating systems. Basically, our licensing policy is as follows:
mysqld server. However, a
multiple-CPU machine counts as a single machine, and there is no restriction
on the number of MySQL servers that run on one machine, or on the
number of clients concurrently connected to a server running on that
machine!
mysql command line client includes code from the readline
library that is under the GNU Public License.
pack_isam utility for creating fast compressed read-only
databases. (The server includes support for reading such databases but not
the packing tool used to create them.) If support agreements generate
sufficient revenue, we will probably release this tool under the same
license as the MySQL server.
For use under Microsoft operating systems (Win95/Win98/WinNT), you need a MySQL license after a trial period of 30 days, with the exception that licenses may be obtained upon request at no cost for educational use or for university- or government-sponsored research settings. See section K The MySQL license for Microsoft operating systems. A shareware version of MySQL-Win32 that you can try before buying is available at http://www.mysql.com/mysql_w32.htmy. After you have paid, you will get a password that will enable you to access the newest MySQL-Win32 version.
If you have any questions as to whether or not a license is required for your particular use of MySQL, please contact us. See section 3.5.2 Contact information.
If you require a MySQL license, the easiest way to pay for it is to use the license form at TcX's secure server at https://www.tcx.se/license.htmy. Other forms of payment are discussed in section 3.5.1 Payment information.
There are several different copyrights on the MySQL distribution:
mysqlclient
library and programs in the `client' directory is in the public
domain. Each file that is in the public domain has a header which clearly
states so. This includes everything in the `client' directory and some parts of
the mysys, mystring and dbug libraries.
getopt) are covered by the
"GNU LIBRARY LIBRARY GENERAL PUBLIC LICENSE". See the
`mysys/COPYING.LIB' file.
readline) are covered by the
"GNU GENERAL PUBLIC LICENSE". See the `readline/COPYING' file.
regexp library) are covered by a Berkeley
style copyright.
The following points set forth the philosophy behind our copyright policy:
We may choose to distribute older versions of MySQL with the GPL in the future. However, these versions will be identified as GNU MySQL. Also, all copyright notices in the relevant files will be changed to the GPL.
This section is a clarification of the license terms that are set forth in the "MySQL FREE PUBLIC LICENSE" (FPL). See section J The MySQL server license for non Microsoft operating systems.
MySQL may be used freely, including by commercial entities for evaluation or unsupported internal use. However, distribution for commercial purposes of MySQL, or anything containing or derived from MySQL in whole or in part, requires a written commercial license from TcX AB, the sole entity authorized to grant such licenses.
You may not include MySQL "free" in a package containing anything for which a charge is being made, except as noted below.
The intent of the exception provided in the second clause of the license is to allow commercial organizations operating an FTP server or a bulletin board to distribute MySQL freely from it, provided that:
If you want to distribute software in a commercial context that incorporates MySQL and you do not want to meet these conditions, you should contact TcX AB to find out about commercial licensing, which involves a payment. The only ways you legally can distribute MySQL or anything containing MySQL are by distributing MySQL under the requirements of the FPL, or by getting a commercial license from TcX AB.
This section describes some situations illustrating whether or not you must license the MySQL server. Generally these examples involve providing MySQL as part of a product or service that you are selling to a customer, or requiring that MySQL be used in conjunction with your product. In such cases, it is your responsibility to obtain a license for the customer if one is necessary. (This requirement is waived if your customer already has a MySQL license. But the seller must send customer information and the license number to TcX, and the license must be a full license, not an OEM license.)
Note that a single MySQL license covers any number of
CPUs/users/customers/mysqld servers on a machine!
To determine whether or not you need a MySQL license when selling your application, you should ask whether the proper functioning of your application is contingent on the use of MySQL and whether you include MySQL with your product. There are several cases to consider:
mysqld server. For example, if you've designed your
application around MySQL, then you've really made a commercial
product that requires the engine, so you need a license.
If your application does not require MySQL, you need not obtain a
license. For example, if MySQL just added some new optional
features to your product (such as adding logging to a database if
MySQL is used rather than logging to a text file), it should fall
within normal use, and a license would not be required.
In other words, you need a license if you sell a product designed
specifically for use with MySQL or that requires the MySQL
server to function at all. This is true whether or not you provide
MySQL for your client as part of your product distribution.
It also depends on what you're doing for the client. Do you plan to provide
your client with detailed instructions on installing MySQL with your
software? Then your product may be contingent on the use of MySQL;
if so, you need to buy a license. If you are simply tying into a database
that you expect already to have been installed by the time your software is
purchased, then you probably don't need a license.
mysqld server,
because in this case you are selling a system that includes MySQL.
This is true whether the use of MySQL with your product
is required or optional.
If you perform MySQL installation on a client's machine and any money changes hands for the service (directly or indirectly), then you must buy a MySQL license.
If you sell an application for which MySQL is not strictly required but can be used, a license may be indicated, depending on how MySQL is set up. Suppose your product neither requires MySQL nor includes it in your product distribution, but can be configured to use MySQL for those customers who so desire. (This would be the case, for example, if your product can use any of a number of database engines.)
If the customer obtains and installs MySQL, no license is needed. If you perform that service for your customer, then a license is needed because then you are selling a service that includes MySQL.
Internet Service Providers (ISPs) often host MySQL servers for their customers.
If you are an ISP that allows customers to install and administer MySQL for themselves on your machine with no assistance from you, neither you nor your customer need a MySQL license.
If you charge for MySQL installation and administrative support as part of your customer service, then you need a license because you are selling a service that includes MySQL.
If you use MySQL in conjunction with a web server, you don't have to pay for a license.
This is true even if you run a commercial web server that uses MySQL, since you are not selling MySQL itself. However, in this case we would like you to purchase MySQL support, because MySQL is helping your enterprise.
Our current license prices are shown below. All prices are in US Dollars. If you pay by credit card, the currency is EURO (European Union Euro) so the prices will differ slightly.
| Number of licenses | Price per copy | Total |
| 1 | US $200 | US $200 |
| 10 pack | US $150 | US $1500 |
| 50 pack | US $120 | US $6000 |
For high volume (OEM) purchases, the following prices apply:
| Number of licenses | Price per copy | Minimum at one time | Minimum payment |
| 100-1000 | US $40 | 100 | US $4000 |
| 1000-2500 | US $25 | 200 | US $5000 |
| 2500-5000 | US $20 | 400 | US $8000 |
For OEM purchases, you must act as the middle-man for eventual problems or extension requests from your users. We also require OEM customers to have a support contract.
If you have a low-margin high-volume product, you can always talk to us about other terms (for example, a percent of the sale price). If you do, please be informative about your product, pricing, market and any other information that may be relevant.
After buying 10 MySQL licenses, you will get a personal copy of
the pack_isam utility. You are not allowed to redistribute this
utility but you can distribute tables packed with it.
A full-price license is not a support agreement and includes very minimal support. This means that we try to answer any relevant question. If the answer is in the documentation, we will direct you to the appropriate section. If you have not purchased a license or support, we probably will not answer at all.
If you discover what we consider a real bug, we are likely to fix it in any case. But if you pay for support we will notify you about the fix status instead of just fixing it in a later release.
More comprehensive support is sold separately. Descriptions of what each level of support includes are given in section 3.6 Types of commercial support. Costs for the various types of commercial support are shown below. Support level prices are in EURO (European Union Euro). One EURO is about 1.17 USD.
| Type of support | Cost per year |
| Basic email support | EURO 170 |
| Extended email support | EURO 1000 |
| Login support | EURO 2000 |
| Extended login support | EURO 5000 |
You may upgrade from any lower level of support to a higher level of support for the difference between the prices of the two support levels.
Currently we can take SWIFT payments, cheques or credit cards.
Payment should be made to:
Postgirot Bank AB 105 06 STOCKHOLM, SWEDEN T.C.X DataKonsult AB BOX 6434 11382 STOCKHOLM, SWEDEN SWIFT address: PGSI SESS Account number: 96 77 06 - 3
Specify: license and/or support and your name and email address.
In Europe and Japan you can use EuroGiro (that should be less expensive) to the same account.
If you want to pay by cheque, make it payable to "Monty Program KB" and mail it to the address below:
T.C.X DataKonsult AB BOX 6434 11382 STOCKHOLM, SWEDEN
If you want to pay by credit card over the Internet, you can use TcX's secure license form.
You can also print a copy of the license form, fill it in and send it by fax to:
+46-8-729 69 05
If you want us to bill you, you can use the license form and write "bill us" in the comment field. You can also mail a message to with your company information and ask us to bill you.
For commercial licensing, or if you have any questions about any of the information in this section, please contact:
David Axmark Detron HB Kungsgatan 65 B 753 21 UPPSALA SWEDEN Voice Phone +46-18-10 22 80 (Swedish and English spoken) Fax +46-8-729 69 05 (Email *much* preferred) E-Mail: mysql-licensing@mysql.com
Basic email support is a very inexpensive support option and should be thought of more as a way to support our development of MySQL than as a real support option.
At this support level, the MySQL mailing lists are the preferred means of communication. Questions normally should be mailed to the primary mailing list (mysql@lists.mysql.com) or one of the other regular lists (for example, mysql-win32@lists.mysql.com for Windows-related MySQL questions), as someone else already may have experienced and solved the problem you have. See section 2.2 Asking questions or reporting bugs.
However, by purchasing basic email support, you also have access to the support address mysql-support@mysql.com, which is not available as part of the minimal support that you get by purchasing a MySQL license. This means that for especially critical questions, you can cross-post your message to mysql-support@mysql.com. (If the message contains sensitive data, you should post only to mysql-support@mysql.com.) Whenever you send a message to mysql-support@mysql.com, always remember to include your registration number and expiration date to ensure a quick response.
Basic email support includes the following types of service:
Extended email support includes everything in basic email support with these additions:
pack_isam packing tool for creating
fast compressed read-only databases (it does not support BLOB or
TEXT types yet). The current server includes support for reading such
databases but not the packing tool used to create them.
mysqld for your situation.
Login support includes everything in extended email support with these additions:
kill -9 command).
Extended login support includes everything in login support with these additions:
mysql> select MY_CALCULATION(col_name1,col_name2) from tbl_name;
This chapter describes how to obtain and install MySQL:
Check the MySQL home page for information about the current version and for downloading instructions.
However, the Internet connection at TcX is not so fast; we would prefer that you do the actual downloading from one of the mirror sites listed below.
Please report bad or out of date mirrors to webmaster@mysql.com.
Europe:
Austria [Univ. of Technology/Vienna]
WWW
FTP
Bulgaria [Naturella]
FTP
Denmark [Ake]
WWW
Denmark [SunSITE]
WWW
FTP
Estonia [Tradenet]
WWW
Finland [EUnet]
WWW
Germany [Bonn University, Bonn]
WWW
FTP
Germany [Wolfenbuettel]
WWW
FTP
Germany [Staufen]
WWW
Greece [NTUA, Athens]
WWW
FTP
Israel [Netvision]
WWW
Italy [Teta Srl]
WWW
Poland [Sunsite]
WWW
FTP
Portugal [lerianet]
WWW
FTP
Russia [DirectNet]
WWW
Russia [IZHCOM]
WWW
FTP
Romania [Timisoara]
WWW
FTP
Romania [Bucharest]
WWW
FTP
Sweden [Sunet]
WWW
FTP
UK [Omnipotent/UK]
WWW
FTP
UK [PLiG/UK]
WWW
FTP
UK [SunSITE]
WWW
FTP
Ukraine [PACO]
WWW
FTP
North America:
Canada [Tryc]
WWW
USA [Hurricane Electric/San Jose]
WWW
USA [Buoy/New York]
WWW
USA [Netcasting/West Coast]
FTP
USA [Circle Net/North Carolina]
WWW
USA [Gina net/Florida]
WWW
USA [pingzero/Los Angeles]
WWW
USA [DIGEX]
FTP
USA [Phoenix]
WWW
South America:
Chile [vision]
http://mysql.vision.cl/
Chile [Amerikanclaris]
WWW
FTP
Asia:
Korea [KREONet]
WWW
Japan [Soft Agency]
WWW
Japan [Nagoya Syouka University]
WWW
FTP
Japan [HappySize]
WWW
FTP
Singapore [HJC]
WWW
FTP
Taiwan [NCTU]
WWW
Taiwan [TTN]
WWW
Australia:
Australia [AARNet/Queensland]
WWW
FTP
Australia [Tas]
WWW
FTP
Australia [Blue Planet/Melbourne]
WWW
FTP
Africa:
We use GNU Autoconf so it is possible to port MySQL to all modern systems with working Posix threads and a C++ compiler. (To compile only the client code, a C++ compiler is required but not threads.) We use and develop the software ourselves primarily on Sun Solaris (versions 2.5 & 2.6) and to a lesser extent on RedHat Linux 5.0.
MySQL has been reported to compile sucessfully on the following operating system/thread package combinations. Note that for many operating systems, the native thread support works only in the latest versions.
glibc 2.0.7
The first decision to make is whether you want to use the latest development release or the last stable release:
crash-me and
benchmark tests.
See section 11 The MySQL benchmark suite.
The second decision to make is whether you want to use a source distribution or a binary distribution:
The MySQL naming scheme uses release numbers that consist of three
numbers and a suffix. For example, a release name like
mysql-3.21.17-beta is interpreted like this:
3) describes the file format. All
version 3 releases have the same file format. When a version 4 appears, every
table will have to be converted to the new format (nice tools for this will
be included, of course).
21) is the release level. Normally there are two to
choose from. One is the release/stable branch (currently 21) and the
other is the development branch (currently 22) . Normally both are
stable, but the development version may have quirks, missing documentation on
new features or may fail to compile on some systems.
17) is the version number within the
release level. This is incremented for each new distribution. Usually you
want the latest version for the release level you have choosen.
beta) indicates the stability level of
the release. The possible suffixes are:
alpha indicates that the release contains some large section of
new code that hasn't been 100% tested. Known bugs (usually there are none)
should be documented in the News section. See section D MySQL change history. There are also new
commands and extensions in most alpha releases.
beta means that all new code has been tested. No major new features
were added. There should be no known bugs.
gamma is a beta that has been around a while and seems to work fine.
This is what many other companies call a release.
All versions of MySQL are run through our standard tests and benchmarks to ensure that they are relatively safe to use. Since the standard tests are extended over time to check for all previously found bugs, the test suite keeps getting better.
Note that all releases have been tested at least with:
crash-me test
Another test is that we use the newest MySQL version in our internal production environment, on at least one machine. We have more than 100 gigabytes of data to work with.
MySQL is evolving quite rapidly here at TcX and we want to share this with other MySQL users. We try to make a release when we have very useful features that others seem to have a need for.
We also try to help out users who request features that are easy to implement. We also take note of what our licensed users want to have and we especially take note of what our extended email supported customers want and try to help them out.
No one has to download a new release. The News section will tell you if the new release has something you really want. See section D MySQL change history.
We use the following policy when updating MySQL:
The current stable release is 3.22; We have already moved active development to 3.23. Bugs will still be fixed in the stable version. We don't believe in a complete freeze, as this also leaves out bug fixes and things that "must be done". "Somewhat frozen" means that we may add small things that "almost surely will not affect anything that's already working".
This section describes the default layout of the directories created by installing binary and source distributions.
A binary distribution is installed by unpacking it at the installation location you choose (typically `/usr/local/mysql') and creates the following directories in that location:
| Directory | Contents of directory |
| `bin' | Client programs and the mysqld server
|
| `data' | Log files, databases |
| `include' | Include (header) files |
| `lib' | Libraries |
| `scripts' | mysql_install_db
|
| `share/mysql' | Error message files |
| `sql-bench' | Benchmarks |
A source distribution is installed after you configure and compile it. By default, the installation step installs files under `/usr/local', in the following subdirectories:
| Directory | Contents of directory |
| `bin' | Client programs and scripts |
| `include/mysql' | Include (header) files |
| `info' | Documentation in Info format |
| `lib/mysql' | Libraries |
| `libexec' | The mysqld server
|
| `share/mysql' | Error message files |
| `sql-bench' | Benchmarks and crash-me test
|
| `var' | Databases and log files. |
Within an installation directory, the layout of a source installation differs from that of a binary installation in the following ways:
mysqld server is installed in the `libexec'
directory rather than in the `bin' directory.
mysql_install_db is installed in the `/usr/local/bin' directory
rather than in `/usr/local/mysql/scripts'.
You need the following tools to install a MySQL binary distribution:
gunzip to uncompress the distribution.
tar to unpack the distribution. GNU tar is
known to work.
An alternative installation method under Linux is to use RPM (RedHat Package Manager) distributions. See section 4.6.1 Linux RPM notes.
If you run into problems, PLEASE ALWAYS USE mysqlbug when
posting questions to mysql@lists.mysql.com. Even if the problem
isn't a bug, mysqlbug gathers system information that will help others
solve your problem. By not using mysqlbug, you lessen the likelihood
of getting a solution to your problem! You will find mysqlbug in the
`bin' directory after you unpack the distribution. See section 2.3 How to report bugs or problems.
The basic commands you must execute to install and use a MySQL binary distribution are:
shell> gunzip < mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s mysql-VERSION-OS mysql shell> cd mysql shell> scripts/mysql_install_db shell> bin/safe_mysqld &
You can add new users using the bin/mysql_setpermission script if
you install the DBI and Msql-Mysql-modules Perl modules.
Here follows a more detailed description:
To install a binary distribution, follow the steps below, then proceed to section 4.15 Post-installation setup and testing, for post-installation setup and testing:
root.)
tar
archives and have names like `mysql-VERSION-OS.tar.gz', where
VERSION is a number (e.g., 3.21.15), and OS indicates
the type of operating system for which the distribution is intended (e.g.,
pc-linux-gnu-i586).
shell> gunzip < mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s mysql-VERSION-OS mysqlThe first command creates a directory named `mysql-VERSION-OS'. The second command makes a symbolic link to that directory. This lets you refer more easily to the installation directory as `/usr/local/mysql'.
shell> cd mysqlYou will find several files and subdirectories in the
mysql directory.
The most important for installation purposes are the `bin' and
`scripts' subdirectories.
PATH environment variable so that your shell finds the MySQL
programs properly.
mysql_install_db script used to initialize
the server access permissions.
mysqlaccess and have the MySQL
distribution in some nonstandard place, you must change the location where
mysqlaccess expects to find the mysql client. Edit the
`bin/mysqlaccess' script at approximately line 18. Search for a line
that looks like this:
$MYSQL = '/usr/local/bin/mysql'; # path to mysql executableChange the path to reflect the location where
mysql actually is
stored on your system. If you do not do this, you will get a broken
pipe error when you run mysqlaccess.
shell> scripts/mysql_install_db
DBI/DBD interface,
see section 4.10 Perl installation comments.
support-files/mysql.server to the location where
your system has its startup files. More information can be found in the
support-files/mysql.server script itself, and in section 4.15.3 Starting and stopping MySQL automatically.
After everything has been unpacked and installed, you should initialize and test your distribution.
You can start the MySQL server with the following command:
shell> bin/safe_mysqld &
Note that MySQL versions before 3.22.10 started the MySQL
server when you run mysql_install_db. This is no longer true!
See section 4.15 Post-installation setup and testing.
The recommended way to install MySQL on Linux is by using an RPM
file. The MySQL RPMs are currently being built on a RedHat 5.2
system but should work on other versions of Linux that support rpm and
use glibc.
If you have problems with an RPM file, for example Sorry, the host
'xxxx' could not be looked up, see section 4.6.3.1 Linux notes.
The RPM files you may want to use are:
MySQL-VERSION.i386.rpm
The MySQL server. You will need this unless you only want to
connect to another MySQL server running on another machine.
MySQL-client-VERSION.i386.rpm
The standard MySQL client programs. You probably always want to
install this package.
MySQL-bench-VERSION.i386.rpm
Tests and benchmarks. Requires Perl and msql-mysql-modules RPMs.
MySQL-devel-VERSION.i386.rpm
Libraries and include files needed if you want to compile other
MySQL clients, such as the Perl modules.
MySQL-VERSION.src.rpm
This contains the source code for all of the above packages. It can also
be used to try to build RPMs for other architectures (for example, Alpha
or SPARC).
To see all files in an RPM package:
shell> rpm -qpl MySQL-VERSION.i386.rpm
To perform a standard minimal installation, run this command:
shell> rpm -i MySQL-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm
To install just the client package:
shell> rpm -i MySQL-client-VERSION.i386.rpm
The RPM places data in `/var/lib/mysql'. The RPM also creates the appropriate entries in `/sbin/rc.d/' to start the server automatically at boot time. (This means that if you have performed a previous installation, you may want to make a copy of your previously-installed MySQL startup file if you made any changes to it, so you don't lose your changes.)
After installing the RPM file(s), go to the binary install section and use the instructions there, starting from the step that creates the MySQL grant tables. See section 4.6 Installing a MySQL binary distribution.
If you compile MySQL clients that you've written yourself or that
you obtain from a third party, they must be linked using the
-lmysqlclient option on the link command. You may also need to
specify a -L option to tell the linker where to find the library. For
example, if the library is installed in `/usr/local/mysql/lib', use
-L/usr/local/mysql/lib -lmysqlclient on the link command.
For clients that use MySQL header files, you may need to specify a
-I option when you compile them (for example,
-I/usr/local/mysql/include), so the compiler can find the header
files.
The following sections indicate some of the issues that have been observed to occur on particular systems when installing MySQL from a binary distribution.
MySQL needs at least Linux 2.0.
The binary release is linked with -static, which means you not
normally need not worry about which version of the system libraries you
have. You need not install LinuxThreads, either. A program linked with
-static is slightly bigger than a dynamically-linked program but
also slightly faster (3-5%). The only problem is that you can't use
user definable functions (UDFs) with a statically-linked program. If
you are going to write or use UDF functions (this is something only for
C or C++ programmers) you must compile MySQL yourself, using
dynamic linking.
If you are using a libc based system (instead of a glibc2
system), you will probably get some problems with hostname resolving
with the binary release. (This is because glibc unfortunately
depends on some external libraries to resolve hostnames, even when
compiled with -static). In this case you probably get the
following error message when you run mysql_install_db:
Sorry, the host 'xxxx' could not be looked up
You can solve this problem one of the following ways:
tar
distribution) and install this instead.
mysql_install_db --force; This will not execute the
resolveip test in mysql_install_db. The downside is that
you can't use host names in the grant tables; you must use IP numbers
instead (except for localhost). If you are using an old MySQL
release that doesn't support --force you have to remove the
resolveip test in mysql_install with an editor.
The Linux-Intel binary and RPM releases of MySQL are configured for the highest possible speed. We are always trying to use the fastest stable compiler available.
MySQL Perl support requires Perl 5.004_03 or newer.
The binary distribution of MySQL for HP-UX is distributed as an HP depot file. This means that you must be running at least HP-UX 10.x to have access to HP's software depot tools.
The HP version of MySQL was compiled on an HP 9000/8xx server under HP-UX 10.20, and uses MIT-pthreads. It is known to work well under this configuration. This version does not use HP's native thread package. It is highly unlikely that MySQL will use HP native threads on anything but HP-UX 10.30 or later.
Other configurations that may work:
The following configurations almost definitely won't work:
To install the distribution, use one of the commands below, where
/path/to/depot is the full pathname of the depot file:
shell> /usr/sbin/swinstall -s /path/to/depot mysql.full
shell> /usr/sbin/swinstall -s /path/to/depot mysql.server
shell> /usr/sbin/swinstall -s /path/to/depot mysql.client
shell> /usr/sbin/swinstall -s /path/to/depot mysql.developer
The depot places binaries and libraries in `/opt/mysql' and data in
`/var/opt/mysql'. The depot also creates the appropriate entries in
`/sbin/init.d' and `/sbin/rc2.d' to start the server automatically
at boot time. Obviously, this entails being root to install.
You need the following tools to build and install MySQL from source:
gunzip to uncompress the distribution.
tar to unpack the distribution. GNU tar is
known to work.
gcc >= 2.8.1, egcs >=
1.0.2, SGI C++ and SunPro C++ are some of the compilers that are known to
work. libg++ is not needed when using gcc. gcc
2.7.x has a bug that makes it impossible to compile some perfectly legal
C++ files, such as `sql/sql_base.cc'. If you only have gcc 2.7.x,
you must upgrade your gcc to be able to compile MySQL.
make program. GNU make is always recommended and is
sometimes required. If you have problems, we recommend trying GNU
make 3.75 or newer.
If you run into problems, PLEASE ALWAYS USE mysqlbug when
posting questions to mysql@lists.mysql.com. Even if the problem
isn't a bug, mysqlbug gathers system information that will help others
solve your problem. By not using mysqlbug, you lessen the likelihood
of getting a solution to your problem! You will find mysqlbug in the
`scripts' directory after you unpack the distribution. See section 2.3 How to report bugs or problems.
The basic commands you must execute to install a MySQL source
distribution are (from an unpacked tar file):
shell> configure shell> make shell> make install shell> scripts/mysql_install_db shell> /usr/local/mysql/bin/safe_mysqld &
If you start from a source RPM, then do the following.
shell> rpm --rebuild MySQL-VERSION.src.rpm
This will make a binary RPM that you can install.
You can add new users using the bin/mysql_setpermission script if
you install the DBI and Msql-Mysql-modules Perl modules.
Here follows a more detailed description:
To install a source distribution, follow the steps below, then proceed to section 4.15 Post-installation setup and testing, for post-installation initialization and testing.
tar
archives and have names like `mysql-VERSION.tar.gz', where
VERSION is a number like 3.22.21.
shell> gunzip < mysql-VERSION.tar.gz | tar xvf -This command creates a directory named `mysql-VERSION'.
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql shell> makeWhen you run
configure, you might want to specify some options.
Run ./configure --help for a list of options.
section 4.7.3 Typical configure options, discusses some of the
more useful options.
If configure fails, and you are going to send mail to
lines from `config.log' that you think can help solve the problem. Also
include the last couple of lines of output from configure if
configure aborts. Post the bug report using the mysqlbug
script. See section 2.3 How to report bugs or problems.
If the compile fails, see section 4.8 Problems compiling?, for help with
a number of common problems.
shell> make installYou might need to run this command as
root.
shell> scripts/mysql_install_db
DBI/DBD interface,
see section 4.10 Perl installation comments.
support-files/mysql.server to the location where
your system has its startup files. More information can be found in the
support-files/mysql.server script itself, and in section 4.15.3 Starting and stopping MySQL automatically.
After everything has been installed, you should initialize and test your distribution.
You can start the MySQL server with the following command,
where BINDIR is the directory in which safe_mysqld is
installed (`/usr/local/bin' by default):
shell> BINDIR/safe_mysqld &
If that command fails immediately with mysqld daemon ended then you can
find some information in the file
`mysql-data-directory/'hostname'.err'. The likely reason is that
you already have another mysqld server running. See section 17.3 Running multiple MySQL servers on the same machine.
Note that MySQL versions before 3.22.10 started the MySQL
server when you run mysql_install_db. This is no longer true!
See section 4.15 Post-installation setup and testing.
Sometimes patches appear on the mailing list or are placed in the patches area of the MySQL FTP site.
To apply a patch from the mailing list, save the message in which the patch appears in a file, change into the top-level directory of your MySQL source tree and run these commands:
shell> patch -p1 < patch-file-name shell> rm config.cache shell> make clean
Patches from the FTP site are distributed as plain text files or as files
compressed with gzip files. Apply a plain patch as shown above for
mailing list patches. To apply a compressed patch, change into the
top-level directory of your MySQL source tree and run these
commands:
shell> gunzip < patch-file-name.gz | patch -p1 shell> rm config.cache shell> make clean
After applying a patch, follow the instructions for a normal source install,
beginning with the ./configure step. After running the make
install step, restart your MySQL server.
You may need to bring down any currently running server before you run
make install. (Use mysqladmin shutdown to do this.) Some
systems do not allow you to install a new version of a program if it replaces
the version that is currently executing.
configure options
The configure script gives you a great deal of control over how you
configure your MySQL distribution. Typically you do this using
options on the configure command line. You can also affect
configure using certain environment variables. For a list of options
supported by configure, run this command:
shell> ./configure --help
Some of the more commonly-used configure options are described below:
--without-server option:
shell> ./configure --without-serverIf you don't have a C++ compiler,
mysql will not compile (it is the
one client program that requires C++). In this case,
you can remove the code in configure that tests for the C++ compiler
and then run ./configure with the --without-server option. The
compile step will still try to build mysql, but you can ignore any
warnings about `mysql.cc'. (If make stops, try make -k
to tell it to continue with the rest of the build even if errors occur.)
configure command something like one
of these:
shell> ./configure --prefix=/usr/local/mysql
shell> ./configure --prefix=/usr/local \
--localstatedir=/usr/local/mysql/data
The first command changes the installation prefix so that everything is
installed under `/usr/local/mysql' rather than the default of
`/usr/local'. The second command preserves the default installation
prefix, but overrides the default location for database directories
(normally `/usr/local/var') and changes it to
/usr/local/mysql/data.
configure command
like this:
shell> ./configure --with-unix-socket-path=/path/to/socket/dir`/path/to/socket/dir' must be an absolute pathname.
configure like this:
shell> ./configure --with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static
gcc and don't have libg++ or libstdc++
installed, you can tell configure to use gcc as your C++
compiler:
shell> CC=gcc CXX=gcc ./configureWhen you use
gcc as your C++ compiler, it will not attempt to link in
libg++ or libstdc++.
If the build fails and produces errors about your compiler or linker not
being able to create the shared library `libmysqlclient.so.#' (`#'
is a version number), you can work around this problem by giving the
--disable-shared option to configure. In th