Go to the first, previous, next, last section, table of contents.


2 ��������� MySQL

� ���� ������� ������� ��������� � ��������� MySQL:

2.1 ������� ����������� ��������� MySQL

2.1.1 ��������� MySQL �� Linux

��� ��������� MySQL �� Linux ������������� ��������� ������ RPM. � ��������� ����� RPM ��� MySQL ��������� �� ������������ ������� SuSE Linux 7.3, �� ��� ������ �������� ����� � ��� ������ ������ Linux, ������� ������������ rpm � ���������� glibc.

� ������ ������������� ������� � ������ RPM (��������, ���� �� �������� ������ ``Sorry, the host 'xxxx' could not be looked up''), ����������� � ������� See section 2.6.1.1 ���������� � �������� ������������� Linux.

�������� ��� ������������� ��������� RPM-�����:

��� ��������� ���� ������ � ������ RPM ��������� �������:

shell> rpm -qpl MySQL-VERSION.i386.rpm

��� ���������� ����������� ����������� ��������� ��������� �������:

shell> rpm -i MySQL-server-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm

��� ��������� ������ ����������� ������ ��������� �������:

shell> rpm -i MySQL-client-VERSION.i386.rpm

RPM �������� ������ � `/var/lib/mysql' � ������� ��������������� ��������� � `/etc/init.d/' ��� ��������������� ������� ������� �� ����� ��������� �������� (� ������, ���� � ��� ������� ���������� �����������, ����� ������� ����� ����� �������������� ����� ������� MySQL, ����� ��������� � ��� �� ���� �������.)

���� �� ������ ���������� MySQL RPM �� ������� ������� Linux, ������� �� ������������ init-������� � `/etc/init.d' (��������������� ��� ����������� ������������� ������), ��� ������� ������� ������������� ������ �� ������ ������������ ����� ���, ��� ������������� RPM:

shell> cd /etc ; ln -s rc.d/init.d .

������, ��� ����������� �������� Linux ������ ������������ ��� ����� ���������, �.�. ��� ���������� ��������� LSB (Linux Standard Base).

����� ��������� RPM, mysqld ������ ���������� � �� ������ ����� ���������� � ������������� MySQL.

See section 2.4 ����������������� ��������� � ������������.

���� ��� ��������� ��������� ��������, �� �� ����� ��������� ����������� ������� ���������� � �����, � ������� ����������� ��������� �� ��������� ������������. See section 2.2.10 ��������� ��������� ������������ MySQL.

2.1.2 ��������� MySQL �� Windows

������� ��� ��������� ���� ������������� ������� MySQL ��� Windows:

  1. �������� �����������, � ������ �������� ������ ��������� ���������; ��� ������������� ���, ��� �����, ��� ��� ����� ����� �� ��������� ������.
  2. ����������� ��������� ����, � ������� ���������� ���� ��� � ����� ��������� ��� �������� ����������� ������ � �������������� ����������� VC++ 6.0. See section 2.3.7 ����������� ��������� ���� ��� Windows.

� ����� ������ ������� �������� ������������ ��������� ������������.

��� �����������:

2.1.2.1 ��������� ��������� ����

  1. ���� �� ��������� �� ������� NT/2000/XP, ������� � ������� ��� ������������ � ������������ ��������������.
  2. ���� �� ����������� ������������ ����� ������ ��������� MySQL, �� ���������� ���������� ������. ���� ������ �������� ��� ������, �� ���������� ��������� �������:
    C:\> NET STOP MySQL
    
    � ��������� ������� �����������:
    C:\mysql\bin> mysqladmin -u root shutdown
    
  3. ���� �� ������ �������� ����������� ���� ������� (�.�. -max ��� -nt), ���������� ����� ������� ������:
    C:\mysql\bin> mysqld-max-nt --remove
    
  4. �������������� ���� ������������ �� ��������� ��������.
  5. ��������� ���� `setup.exe', ����� ������ ������� ���������. ���� �� ������ ���������� ��������� � ���� �������, ��� �������� �� ��������� `c:\mysql', �� ����������� ������ Browse ��� �������� ���������� ���� ��������.
  6. ��������� ������� ���������.

2.1.2.2 ���������� ������������ MySQL ��� Windows

������� � ������ MySQL 3.23.38, ����������� ��� Windows �������� � ���� ��� ������� �������� ���, ��� � �������� ��� ������� MySQL-Max. ���� ���������� ������ ��������� �������� MySQL, ������� ����� ������������:

�������� ��� ��������
mysqld ������������� � ������ ������� ������������ ������� � �������������� �������� ��������� ������, ������������� ������, ������ InnoDB � BDB.
mysqld-opt ���������������� �������� ��� ��� ��������� �������������� ������.
mysqld-nt ���������������� �������� ��� ��� NT/2000/XP � ���������� ����������� �������. ����� ��������� ��� ������ �� Windows 9x/Me, �� � ���� ������ �� ��������� ����������� ������ � ���������� ����� ������������� �������� TCP/IP.
mysqld-max ���������������� �������� ��� � ���������� ������������� ������ � ������ InnoDB � BDB.
mysqld-max-nt ������� mysqld-max, �� ������������� � ���������� ����������� �������.

������� � ������ 3.23.50, ����������� ������ �������� ������ ��� ������� mysqld � --enable-named-pipe.

��� �������� ���� �������������� ��� ��������� Pentium Pro, �� ������ �������� �� ����� ���������� Intel >= i386.

��� ��������� ��������������� ��� ���� ����� ������ ���� ������������ MySQL ����� ���������� ������������ ���� �����:

������ ��� �������������� ����� ����� `my.ini' ����� ������������ ���������� WinMySQLAdmin. � ���� ������ ��������� ����� ������� ������� �� ������ ����������.

���������� ��� ����� ����� � ����������� ���������: `my.cnf'`my.ini'. ������ �� ��������� ������������� ����� ����� ������������ ������ ���� �� ���. ��� ����� ������������ ����� ������� �����. ���� �� ����������� ������������ ���� `my.cnf', �� ��� ������� ������� � �������� �������� ����� C, ���� `my.ini' - �� � ��������� �������� Windows (��� ������ ���-���� ����� `C:\WINDOWS' ��� `C:\WINNT'; ��� ������ �������������� ����� ���������� �� �������� ���������� ��������� windir). MySQL ������� ���� ���� `my.ini', � ����� `my.cnf'.

���� �� ����� ���������� ������������ ��������� ���������, � ������� ���� C �� �������� ����������� ������, �� ������� �������� ������ � ������ `my.ini'. ���������������� ��������� WinMySQLAdmin, ���� ��� � ��� �����������, ����� ���������� ������ ���� `my.ini' (���� ������ � ������������ �� ������������� ����� ����������� ��������� � �������� `\mysql\bin').

��������� notepad.exe, �������� ���� ����� � �������������� ������ [mysqld], ������ �������� ���������� basedirdatadir:

[mysqld]
# set basedir to installation path, e.g., c:/mysql
basedir=the_install_path
# set datadir to location of data directory,
# e.g., c:/mysql/data or d:/mydata/data
datadir=the_data_path

������� ���������, ��� � Windows ����� ����� ������ ����������� � ����� ����� � �������������� ��������������� ������ ������, � �� ��������. ���� �� ���������� �������� �����, �� �� ���������� �����������.

����� ������������ ������� ������, �������� �� ��������� �� ��������� `c:\mysql\data', ���������� ����������� ��� ���������� �������� `c:\mysql\data' � ����� ��������������.

���� �� ������ �������� � ��������������� ��������� InnoDB, �� ���������� ������� ������� ��� ����� �������� ��� �������� ������ ������ InnoDB � ���������� ������ - �.�. `c:\ibdata'`c:\iblogs'. ������ ����� ����������� �������� ��������� �������������� ����� � ����� �����. ��. ������ See section 7.5.2 ��������� ������� InnoDB.

���� �� ������ � ��������� InnoDB �� �� ����������, ������� � ����� ����� �������� ����� skip-innodb.

������ �� ������ ����������� ������ �������.

2.1.2.3 ������ ������ �������

������������ ����� ����� ����������� �� ���� �������� DOS, ��������� ��������� � ���������, ������� ������� ������, ���������� � ���� DOS. ���� � ����� ������������� ���-������ �� ���, �� ��� ������ ���� ��������� ����� ����� ���������������� � ��������� ����� ��������.

���������, ��� ���������� � ��������, ��� ���������� ������, ����� ������� ��������� �������:

C:\mysql\bin> mysqld-max --standalone

��� ������� ������� �� ������ ������� ��������� ���������:

InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
InnoDB: a new database to be created!
InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
InnoDB: Database physically writes the file full: wait...
InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: creating foreign key constraint system tables
InnoDB: foreign key constraint system tables created
011024 10:58:25 InnoDB: Started

����� �������� ���������� ���������� � ������ MySQL ��� Windows, ����������� � ������� See section 2.6.2 ���������� � Windows.

2.1.3 ��������� MySQL �� MacOS X

������� � MySQL 4.0.11, �� ������ ��������� MySQL �� Mac OS X 10.2 ("Jaguar") ��������� ������ ������ ������� PKG ������ ��������� tar-������. �������� ��������, ��� ����� ������ ������ Mac OS X (������, 10.1.x) �� �������������� ���� �������.

����� ��������� ������ ����� ������ ����� (.dmg), ������� ��� ������� ������� ������������ ������� ������� ����� �� ��� ������ � Finder. ����� ������ ���� ����������� � �� ������� ��� ����������.

��������: ����� ��� ��� ���������� �����������, ���������, ��� ������ ������� MySQL �� �������� �� ���� ����������!

����������, ���������� ��� ���������� ����� MySQL ����� ���, ��� ����������. ��� ����� ����������� ��� ���������� MySQL Manager (�� Mac OS X Server) ��� � ������� mysqladmin shutdown � ��������� ������.

��� ���� ����� ��������� MySQL PKG, ������ �������� ������ �� ������ ������. ��� �������� �������� ����������� ������� Mac OS, ������� � �������� ��� ����� ������� ��������� MySQL.

����� �������� ���� � `/usr/local/mysql-<������>' � ����� �������� ������������� ������ `/usr/local/mysql', ����������� �� ����� �����������������. ���� ������� � ������ `/usr/local/mysql' ��� ����������, �� ����� ������� ������������ � `/usr/local/mysql.bak'. ����� ����, ����� ����������� ������� ���������� MySQL ����� ���������� mysql_install_db ����� �����������.

����� ����������� ������ �� ��, ������� ������������ � �������� ��������: ��� ����������� ����� MySQL ����� ����������� �� ���� `/usr/local/mysql/bin', ����� ����� ���������� � `/etc/mysql.sock'. See section 2.2.7 ����� ���������.

���������� ����� ����������� ������������ � ������ mysql (������� ������ ������������ �� ��������� � ������ �������� Mac OS X 10.2 � ����).

���� �� ����������� Mac OS X Server, � ��� ��� ���� ���������� ����� MySQL:

���� ������ ����������� ��������� ������� ����������� ������ ������������ ������ PKG ��� Mac OS X. ������� ���������� ����������� Apple �� ��������� MySQL, ���������� (��������� ���������� "Help View", �������� "Mac OS X Server", �������� ����� ����� "MySQL" � ���������� ������ ��� ��������� "Installing MySQL").

������, ��� ������������������� ������ MySQL �� Mac OS X Server ����������� � ������� ������� safe_mysqld ������ mysqld_safe!

���� �� ����� ������������ ������ MySQL ����� ������� (Marc Liyanage) � ����� http://www.entropy.ch, �� ������ ������ ��������� ����������� �� ���������� ������� ��������� ����� ������������, ��� ������� �� ��� ����������.

���� �� ���������� MySQL � ������, ��������� ������ ��� � ����������������� ������ �� �������� Mac OS X Server, �� ����������� ������ �� MySQL - ��� ������� ����� ������������� ������������ ������� ���������� MySQL. See section 2.5.2 ������������ � ������ 3.23 �� ������ 4.0.

����� ����������� �� ������ ��������� MySQL �������� ��������� ������� � ������������ ����. �������� ��������, ��� ��� ����� ���������� �������������� ��� ���������� ���� ������.

shell> cd /usr/local/mysql
shell> sudo ./bin/mysqld_safe
(������� ��� ������)
(������� CTRL+Z)
shell> bg
(������� CTRL+D ��� ������ �� ��������)

������ �� ������� ������������ � ������� MySQL, ������, �������� `/usr/local/mysql/bin/mysql'.

��� ����, ����� MySQL ������������� ���������� ��� ��������, �� ������ ����� MySQL StartupItem ����� �� ����� ������:

http://www2.entropy.ch/download/mysql-startupitem.pkg.tar.gz

�� ��������� � ��������� ����� �������� StartupItem � ����������� ����� MySQL � ��������� �����.

��������, ��� ����������� ������ ������ MySQL �� ������� ������� ����� ������ �����������. � ���������, ����������� � Mac OS X ��� �� ������������� ������ ���������������� ��� ����, ����� ��������� �������� ������������ � ������� ������.

����� ����, ��� �� ����������� ����� ������ MySQL � ����������� �����������������, � ������� ��������� ����� ������, �� ������ ������� ������ �����������. ����� ����, �� ������ ������� ������ �������� Package Receipt, ������������� �����: `/Library/Receipts/mysql-<version>.pkg'.

2.2 ����� ������� �����������

2.2.1 ��� �������� MySQL

���������� � ������� ������ � ���������� �� �� �������� ����� �������� �� �������� �������� MySQL (http://www.mysql.com/).

��� ������� ���������� ���� - http://mirrors.sunsite.dk/mysql/

���� �� �������������� � ����������� ����������� ����� MySQL, �� ������ �������� ������������� ��� ���������� rsync � ������ rsync://sunsite.dk/ftp/mirrors/mysql/. ������� ��������� ��� ������ �� ������ webmaster@mysql.com, ����� ��������� ��� � ���, ��� ��� ���������� ���� ������� �������� � �������������� ���� ������.

���� ��������� �������� � ��������� � ������ �������� �����, �������� ������������ ���� �� ��������� ���������� ������.

� ���������������� ��� ���������� ���������� ������ ������� �������� �� ������ webmaster@mysql.com.

For a complete upto-date list of MySQL web/download mirrors, see http://www.mysql.com/downloads/mirrors.html. There you will also find information about becoming a MySQL mirror site and how to report a bad or out-of-date mirror.

2.2.2 �������� ����������� ������� � ������� MD5 Checksums ��� GnuPG

����� ����, ��� �� ��������� ������ ��� ����� MySQL, � ����� ��� ��� �� ������ ��� �������������, ��� ������� ��������� � ���, ��� �� � ����������� � �� ��� ���-���� �������.

MySQL AB ������������� ��� ������� ��������� �����: ����������� ����� MD5 � ����������������� ������� � ��������������� GnuPG, GNU Privacy Guard.

2.2.3 �������� ����������� ����� MD5

����� ���� ��� �� ��������� �����, �� ������ ���������, ������������� �� ����������� ����� MD5 ������������ ������ ���, ��� ������� �� ��������� �������� �������. � ������� ������ ���� ����������� �����, ������� �� ������ ��������� ����� ��������:

shell> md5sum <�����>

������ �� ��� ������������ ������� ������������ ������� md5sum - �� ��������� ��� ������ ���������� md5, � � ������ ��� ����� �� ������������. �� Linux ��� ������� �������� ������ GNU Text Utilities, ������� �������� ��� ��������� ������ ��������.

�� ������ ��������� �������� ��� �� ������ http://www.gnu.org/software/textutils/. ���� � ��� ��� ���������� OpenSSL, �� ����� ������ ������������ ������� openssl md5 <�����>. ���������� md5 ��� DOS/Windows �������� �� ������ http://www.fourmilab.ch/md5/.

������:

shell> md5sum mysql-standard-4.0.10-gamma-pc-linux-i686.tar.gz
155836a7ed8c93aee6728a827a6aa153
                mysql-standard-4.0.10-gamma-pc-linux-i686.tar.gz

�� ������ ��������������, ��� �������������� ����������� ����� ������������� ���, ��� ������� �� ��������� �������� ����� ���������������� ������.

��������� ���������� ������ ����� ������������� ���� � ������ `MD5SUMS', ������� ����� �������� MD5 ����������� ����� ���� ������ �� �������� `Downloads'. ������ ��������, ��� ���� ���� ���������� ����� �������� � ��� �� ����� �������� ����� �������� ����������� ������. ���� �� � ���������, �� ������ ���������� �� ������ ������� � �������� ���������.

2.2.4 �������� ������� � �������������� GnuPG

������� ����� �������� ����� �������� ����������� ������ ��� ������������� ���������������� ��������. MySQL AB ���������� �� GNU Privacy Guard (GnuPG), �������� ������������ ������ ���������� ������ Pretty Good Privacy (PGP) ���� ���������� (Phil Zimmermann). ��. http://www.gnupg.org/http://www.openpgp.org/ ��� ����� ��������� ���������� ��� OpenPGP/GnuPG � ��� ��� �������� � ��������� �� ����� �������. ����������� �������� Linux ��� ���� � GnuPG ����� � ��������.

������� � MySQL 4.0.10 (������� 2003), MySQL AB ������ ����������� ����������� ������ � ������� GnuPG. ����������������� ��������� �������� ������� ����� �������� ������� �������� ����������� � ������������� �����.

��� �������� ������� ����������� ������, ��� � ������ ������� ������� �������� ����� ���������� ����� GPG build@mysql.com. �� ������ ���� ����� ���� ���� ����� ������, ���� ����� ��� �� http://www.keyserver.net/.

Key ID:
pub  1024D/5072E1F5 2003-02-03
     MySQL Package signing key (www.mysql.com) <build@mysql.com>
Fingerprint: A4A9 4068 76FC BD3C 4567  70C8 8C71 8D3B 5072 E1F5

Public Key (ASCII-armored):

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3
RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ
fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3
BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW
hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV
K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE
kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI
QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep
rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q7TXlTUUwgUGFj
a2FnZSBzaWduaW5nIGtleSAod3d3Lm15c3FsLmNvbSkgPGJ1aWxkQG15c3FsLmNv
bT6IXQQTEQIAHQUCPj6jDAUJCWYBgAULBwoDBAMVAwIDFgIBAheAAAoJEIxxjTtQ
cuH1cY4AnilUwTXn8MatQOiG0a/bPxrvK/gCAJ4oinSNZRYTnblChwFaazt7PF3q
zIhMBBMRAgAMBQI+PqPRBYMJZgC7AAoJEElQ4SqycpHyJOEAn1mxHijft00bKXvu
cSo/pECUmppiAJ41M9MRVj5VcdH/KN/KjRtW6tHFPYhMBBMRAgAMBQI+QoIDBYMJ
YiKJAAoJELb1zU3GuiQ/lpEAoIhpp6BozKI8p6eaabzF5MlJH58pAKCu/ROofK8J
Eg2aLos+5zEYrB/LsrkCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWsEN/l
xaZoJYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLmRDRi
Rjd1DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hkAWzE
7zaD5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkbf4fm
Le11EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHbuE5p
/1oIDznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+Lwqq
a8CGrRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1ZaSaf
anFvwFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGoTbOW
I39EcyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev42Lmu
QT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkKHt92
6s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUOetdZ
Whe70YGNPw1yjWJT1IhMBBgRAgAMBQI+PqMdBQkJZgGAAAoJEIxxjTtQcuH17p4A
n3r1QpVC9yhnW2cSAjq+kr72GX0eAJ4295kl6NxYEuFApmr1+0uUq/SlsQ==
=YJkx
-----END PGP PUBLIC KEY BLOCK-----

�� ������ ������������� ���� ���� � ��� ��������� ����������� ������ (public keyring) ��������� gpg --import. ��. ������������ �� GPG ��� ����� ��������� ���������� � ���, ��� �������� � ���������� �������.

����� ����, ��� �� ��������� � ������������� ��������� ���� ������, �� ������ ��������� ��������� ���� ����� MySQL � ��������������� �������, ��������� �� ��� �� ��������� ��������.

���� ��������� ����� ���������� `.asc'. ��������, ��������� ��� `mysql-standard-4.0.10-gamma-pc-linux-i686.tar.gz' ����� `mysql-standard-4.0.10-gamma-pc-linux-i686.tar.gz.asc'. ��������������, ����� ��� ����� ��������� � ��� �� ����� �������� � ����� ��������� ����� ������� ��� �������� ��������� �����:

shell> gpg --verify <package>.asc

Example:

shell> gpg --verify mysql-standard-4.0.10-gamma-pc-linux-i686.tar.gz.asc
gpg: Warning: using insecure memory!
gpg: Signature made Mon 03 Feb 2003 08:50:39 PM MET using DSA key ID 5072E1F5
gpg: Good signature from
     "MySQL Package signing key (www.mysql.com) <build@mysql.com>"

��������� "Good signature" �������� ��� � ���, ��� ��� � �������.

��� ������� RPM, ���������� ����� ������� �� ��������������� - ������ RPM ��� ���� �� ���� ����� ���������� ��������� �������� GPG � ����������� ���� MD5. �� ������ ��������� �� ����� ��������:

shell> rpm --checksig <package>.rpm

������:

shell> rpm --checksig MySQL-server-4.0.10-0.i386.rpm
MySQL-server-4.0.10-0.i386.rpm: md5 gpg OK

��������: ���� �� ����������� RPM 4.1 � �� �������� ���������: (GPG) NOT OK (MISSING KEYS: GPG#5072e1f5) (���� �������� �� ��, ��� �� ������������� ���� � ��� ��������� ����������� ������ GPG, keyring) - ��� ������� ������������� ���� � ����������� ������ RPM. RPM 4.1 ������ �� ���������� ��� ����������� ������ GPG (� GPG ������), �� ������������ ���� �����������, ��������� RPM - ��� ������������� �������, � ����������� ������ GPG - ��� ����������� ��� ������������ ����). ����� ������������� ��������� ���� MySQL � RPM, ����������� ��� ����� �������:

shell> rpm --import <pubkey>

������:

shell> rpm --import mysql_pubkey.asc

���� ����� �� �������� ��� ����������� ����� MD5 ��� ������� GPG �� ���������, ���������� � ������ ������� ��������� ��������������� ����� ��� ���� ���, ����� ����, ���� � ������� �������. ���� �� �� ������� ������� �������������� � ����������� ������, ����������, �������� ��� � �������� ����������, ������� ������ ��� ������ � ����� �����, � �������� �� �������� ��������� �����, �� ����� webmaster@mysql.com ��� build@mysql.com.

2.2.5 ������������ �������, �������������� MySQL

�� ��������� GNU Autoconf, ��� ���� ����������� ���������� MySQL �� ��� ����������� ������� � ����������� �������� Posix � ������������ C++ (����� �������������� ������ ��� �������, ��������� ������ ���������� C++ ��� ������������� �������). ��� ���� �� ���������� � ������������� ����������� ����������� � �������� �� Sun Solaris (������ 2.5 - 2.7) � SuSE Linux ������ 7.x.

������� ���������, ��� ��� ������ ������������ ������ ��������� ����������� ������� �������� ������ � ����� ��������� �������. �������� ���������� ���� ����������, MySQL ������� ������������� �� ��������� ����������� ������������ ������ � ��������� �������:

������� ��������, ��� �� �� ���� ���������� MySQL ������������� ��������� ������. ��������� �������� ������������ ��������� ��� ������������������ ������������� ������� MySQL, ������������ ���������� ���������:

� ������������ � ����������� ���������� ���������� ����������� � ���� ����� ������ ��� ���������������� MySQL ��������: x86 ��� ����������� SuSE Linux 7.1, � ����� 2.4 � ReiserFS (��� ����� �������� ����������� Linux) � SPARC ��� ����������� Solaris 2.7 ��� 2.8. FreeBSD ����������� �������, �� �� � ����� ���� ��������, ��� ��� ��������� ������ � ����� ������, ��� ������ ������ ����������� ��������� ����������. �� ����� ��������, ���, � ���������� �������, �� ������ �������� � ������ ��������� ��� ��������� ���������, �� ������� MySQL ������������� � ������������� ���������, �� �� � ��� �� ������� ������������ � ������������������. ��� ��������� ��������� ������ � ����� ������� � �������������� � �������������� ����������� ������������ ������ � ���������, �� ������� ������� MySQL. ���� �� �������������� � ��������� ��� ��� ���� �����������, � ��� ���� ����������� ������� ������� �� �� ���������� � �� ���������� � ��������� ����������� �� ������ ����, ��� ����� MySQL, ����� �������� �����, ������� ������ �� ������ internals@lists.mysql.com.

������� � ���: �� ��������� ����������� ���� ������������� ������������� �� ������ ������� � ���, ��� �����-���� ������������ ������� ����� ��� ���� ������ � �����. �� ������� � ������ ������������ ������������ ������� ��� ���������� ���� - ��� ������ MySQL, � ���������� ��������� ������ � ����� ������. � ���� ����� ������ ��������� ������ ��������� ��� �� ������, ���� �� �� �������� � ���� ������ �������. � � ��������� ������� ������� ����, ��� ���� ������������ ������� �����, ��� ������, ����� ����������� ����� ���� � ���, ��� � ������������ � ����������� ���� ���������� ��������� ���� ������� ������� ������ ������. �� ������ ������������ ���� ����������, ����� ������ ��� ������� ������� - �� ����� ��������� ������������ MySQL � ����� �������.

2.2.6 ����� ������ MySQL ������������

��-������, ����� ������� ������� � ���, ��� ������ ��� ��������� - ����� ������ ����������������� ������ ��� ��������� ���������� ������:

��-������, ����� ������� �������, ������ �� �� ������������ ����������� ��������� ���� ��� �������� �����������. � ����������� ������� ����� ���������� ���� ����� �� �������� ������������, ���� ����� ���������� ��� ����� ���������, ��� ��� ������ ��� ����� ����������, ��� ����������� ��������� ����.

��������� �� ��������� ���� ����� ��������� ����� ���������������� � ��������� �������:

� ������� ������������ � MySQL ������������ ������ ��������, ��������� �� ���� ����� � ��������. ��������, ������ mysql-3.21.17-beta ���������������� ��������� �������:

��� ������ MySQL ������������ ����� ���� ����������� ����� � ����������� ������, ����� �������� ����������� � ���, ��� ��� ������� � ����������. ��� ��� ����������� ����� ������������ �����������, ����� �������� �������� ������������ ����� ������ � ��������, ������� ����� �� �������, �� ����� ������ �� �������� ���������� ����� � �����.

�������, ��� ��� ������� �������������� �� ������� ���� �� ���������� �������:

���������� ����� ������
����� �������� ������ ���������������� ������� ��� ���������. ���� ����� �������� ����� ������ � ������� �������� ������.
����� ������ ������������������ MySQL
��� ����� �������� � ������� ������������������� ��������. ����� ����, ��� ��������� �������, ������������� �� ��������� ����� ����������� ������ ��� �������. See section 5.1.4 ����� ������ MySQL (The MySQL Benchmark Suite).
���� crash-me
���� �������� ����������, ����� �������������� ����������� ������������ ���� ������ � ������ �� ����������� � �����������. See section 5.1.4 ����� ������ MySQL (The MySQL Benchmark Suite).

���������� ��� ���� ����. �� ����������� � ���, ��� �� ���������� ����� ����� ������ MySQL � ����� ���������� ���������������� ����� �� ������� ���� �� ����� ������. ��� ������ � ���� ������� � ��� ���� ����� ��� 100 �������� ������.

2.2.7 ����� ���������

� ���� ������� ����������� ������������ ���������, ����������� �� ��������� ��� ��������� ��������� ������������ � ������������ ��������� ����.

�������� ����������� ��������������� ����� ��� ���������� � ��������� ���� ����� ��������� (������ `/usr/local/mysql') � ������� ��������� ��������:

������� ���������� ��������
`bin' ���������� ��������� � ������ mysqld
`data' ����� ��������, ���� ������
`include' ���������� (������������) �����
`lib' ����������
`scripts' mysql_install_db
`share/mysql' ����� � �������� ��������� �� �������
`sql-bench' ����� ������������������

����������� ��������� ���� ��������������� ����� ����, ��� �� ��������������� � ������������� ���. �� ��������� �� ����� ��������� ����� �������������� � ������� `/usr/local' � ��������� �����������:

������� ���������� ��������
`bin' ���������� ��������� � �������
`include/mysql' ���������� (������������) �����
`info' ������������ � ������� Info
`lib/mysql' ����������
`libexec' ������ mysqld
`share/mysql' ����� � �������� ��������� �� �������
`sql-bench' ����� ������������������ � ���� crash-me
`var' ���� ������ � ����� ��������

������ �������� ��������� ����� ������������ ����������� ��������� ���� ���������� �� ����� ��������� ��������� ������������ � ��������� ����������:

����� ������� ����������� �������� ��������� �� ����������������� ������������ ��������� ����. ��� ����� ������� ��������� ������ `scripts/make_binary_distribution'.

2.2.8 ��� � ����� ����������� ����������

�������� MySQL � MySQL AB ���������� ����� �������� ������� � �� ��������� � ����, ����� ���������� ����� ������ ����� �������� � ������ ������������� MySQL. �� ��������� ������� ����� ������ ����� ��, ��� ������ � �������� ���������� ����� �������� ��������, �������, �� ������ ������, ���������� ������ �������������.

������ ����� �� ����������� �� ������� ����� �������������, ���� ��� ����� ��������� �������� � ������� ����� ����������� ��������. �� ��������� �� �������� ��������� ����� �������������, ������� ��������, � �������� - ��������� ��������� ����� �������������, ���������� ���������� ��� ������ ����������� �����, � ��������� ������ �� ������ �� ��������.

��������� ����� ������ �� �����������. ���������� � ���, ������������� �� ����� ������ ������������ ����� ������ ��, ��� ��� ���������, �� ���������� �� ������� ``�������'' (News). See section D ������� ��������� � ���������� MySQL.

���� �������� � �������� ���������� MySQL ����������� � ���������:

������� ���������� �������� ������ �������� ������ 3.23; ��� ������ �������� ���������� ������ 4.0. ������ � ���������� ������ ��-�������� ����� ������������. �� �� ����� � ������ ``�������������'', ��������� ��� ���� ���������� ����������� ������ � ����, ������� ``������ ���� �������''. ``������� ����������'' �������������, ��� �� ����� �������� ��������� ����, ������� ``����� ���������� �� ������ ������� �� �� ��� �� ����, ��� ��� ��������''.

� MySQL ����������� ��������� ������������ �� ����������� ������ ��������� ������� ����������. � ����� ������ ���������� ������� ������������ ����� ������, ����������������� � ������� ���� ������ ��� ������ �� ����� �������. See section 2.2.6 ����� ������ MySQL ������������.

2.2.9 �������� ���� MySQL, ���������������� � MySQL AB

�������� MySQL AB � �������� ������ ������������� ����� �������� (����������������) ������������� MySQL - ��� �������������� �� ����� ������������ ��� �� �������������� ��������, � ������� ��� ������� ������������ ������ ���������.

��� ������������ ������������� �������� Build-tools/Do-compile, ������� ����������� ������ �������� �����, � ������� ����� .tar.gz ��������� scripts/make_binary_distribution

��� ��������� ���������������� � ������� � ������� ��������� ������������ � �����.

Linux 2.4.xx i386 � gcc 2.95.3
CFLAGS="-O2 -mcpu=pentiumpro" CXX=gcc CXXFLAGS="-O2 -mcpu=pentiumpro -felide-constructors" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
Linux 2.4.xx ia64 � ecc (Intel C++ Itanium Compiler 7.0)
CC=ecc CFLAGS=-tpp1 CXX=ecc CXXFLAGS=-tpp1 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile
Linux 2.4.xx alpha � ccc (Compaq C V6.2-505 / Compaq C++ V6.3-006)
CC=ccc CFLAGS="-fast -arch generic" CXX=cxx CXXFLAGS="-fast -arch generic -noexceptions -nortti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shared --disable-shared
Linux 2.2.xx sparc � egcs 1.1.2
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared
Linux 2.4.xx s390 � gcc 2.95.3
CFLAGS="-O2" CXX=gcc CXXFLAGS="-O2 -felide-constructors" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
Sun Solaris 2.8 sparc � gcc 3.2
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-z-libs=no --with-named-curses-libs=-lcurses --disable-shared
Sun Solaris 2.9 sparc � gcc 2.95.3
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-curses-libs=-lcurses --disable-shared
Sun Solaris 2.9 sparc � cc-5.0 (Sun Forte 5.0)
CC=cc-5.0 CXX=CC ASFLAGS="-xarch=v9" CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -xarch=v9" CXXFLAGS="-noex -mt -D_FORTEC_ -xarch=v9" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-z-libs=no --enable-thread-safe-client --disable-shared
IBM AIX 4.3.2 ppc � gcc 3.2.1
CFLAGS="-O2 -mcpu=powerpc -Wa,-many " CXX=gcc CXXFLAGS="-O2 -mcpu=powerpc -Wa,-many -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no --disable-shared
IBM AIX 5.1.0 ppc � gcc 3.2.1
CFLAGS="-O2 -mcpu=powerpc -Wa,-many" CXX=gcc CXXFLAGS="-O2 -mcpu=powerpc -Wa,-many -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --with-server-suffix="-pro" --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no --disable-shared --with-innodb
HP-UX 10.20 pa-risc1.1 � gcc 3.1
CFLAGS="-DHPUX -I/opt/dce/include -O3 -fPIC" CXX=gcc CXXFLAGS="-DHPUX -I/opt/dce /include -felide-constructors -fno-exceptions -fno-rtti -O3 -fPIC" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-pthread --with-named-thread-libs=-ldce --with-lib-ccflags=-fPIC --disable-shared
HP-UX 11.11 pa-risc2.0 � aCC (HP ANSI C++ B3910B A.03.33)
CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared
Apple MacOS X 10.2 powerpc � gcc 3.1
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared
FreeBSD 4.7 i386 � gcc 2.95.4
CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-z-libs=not-used --disable-shared

��������� �������� �������� ������� �� ��������, ��������������� MySQL AB ��������������. ��������, ��� ��� �������� �������� ��������������� ������������� ��� ��������. ��������� � MySQL AB ��� ������� �������� ��� ����� ���������, �� ������ ����� ���� ������������ ��������� ���� �������� ��������.

SCO Unix 3.2v5.0.6 i386 � gcc 2.95.3
CFLAGS="-O3 -mpentium" LDFLAGS=-static CXX=gcc CXXFLAGS="-O3 -mpentium -felide-constructors" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no --enable-thread-safe-client --disable-shared
Caldera Open Unix 8.0.0 i386 � CC 3.2
CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no --enable-thread-safe-client --disable-shared
Compaq Tru64 OSF/1 V5.1 732 alpha � cc/cxx (Compaq C V6.3-029i / DIGITAL C++ V6.1-027)
CC="cc -pthread" CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed -speculate all" CXX="cxx -pthread" CXXFLAGS="-O4 -ansi_alias -fast -inline speed -speculate all -noexceptions -nortti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-prefix=/usr/local/mysql --with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-shared --with-mysqld-ldflags=-all-static
SGI Irix 6.5 IP32 � gcc 3.0.1
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared

����� ����� ���������� �������������� ��� �������� �������� MySQL AB � �������. ����� �������� �������� ����� �� �����������, �� ����� ���������� �� ��������� ����� ��� ������������ ����������.

Linux 2.2.x � x686 � gcc 2.95.2
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charsets=complex
SunOS 4.1.4 2 sun4c � gcc 2.7.2.1
CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-assembler
SunOS 5.5.1 (and above) sun4u � egcs 1.0.3a or 2.90.27 or gcc 2.95.2 and newer
CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex --enable-assembler
SunOS 5.6 i86pc � gcc 2.8.1
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex
BSDI BSD/OS 3.1 i386 � gcc 2.7.2.1
CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
BSDI BSD/OS 2.1 i386 � gcc 2.7.2
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex
AIX 2 4 � gcc 2.7.2.2
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex

������, ��� �������� ����� ������������ ������� ��� ����� �� ����������������� ������������, � ����� ����� ����� ������� �� � ������ �������� ������������� �� ������ internals@lists.mysql.com.

������������ RPM ��� ������ MySQL �� 3.22 ����������� ������ �������������. ������ ������� � ������ 3.22, ������ RPM ���������� � ��� � MySQL AB.

���� �� ������ �������������� ���������� ������ MySQL, �� ������� �������� --with-debug ��� --with-debug=full � ���������� ������� ������������ � ������� ����� ����� -fomit-frame-pointer.

�� ��������, ����������� � ������������ ��� Windows, ������� ���������� � ������� See section 2.1.2 ��������� MySQL �� Windows.

2.2.10 ��������� ��������� ������������ MySQL

��. ����� ������ See section 2.1.2.1 ��������� ��������� ����, ������ section 2.1.1 ��������� MySQL �� Linux � ������ See section 8.4.7 ������ ���������� ��������.

��� ��������� ��������� ������������ MySQL ���������� ��������� ���������������� ��������:

��� Linux ���������� �������������� ����� ��������� � �������������� ������������ RPM (RedHat Package Manager, �������� ������� RedHat). ��. ������ See section 2.1.1 ��������� MySQL �� Linux.

���� ��� �������� ����������� � ����������, ��, ����������, ��� �������� �������� �� mysql@lists.mysql.com ������ ����������� mysqlbug. ���� ���� ���� �������� �� ��������� � ����� ������, mysqlbug ������� ��������� ����������, ������� ������� ������ ����� �������� � ������. ��� mysqlbug �� ���������� ����������� �������� ������� ����� ��������! mysqlbug ����� ����� � �������� `scripts' ����� ���������� ������������. See section 1.8.1.3 ��� ���������� ������ �� ������� ��� ���������.

��� ��������� ��������� ������������ MySQL ���������� ��������� ��������� �������� �������:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/safe_mysqld --user=mysql &

���

shell> bin/mysqld_safe --user=mysql &

���� �� ��������� � MySQL 4.x

����� ������������� ����� ��������, ��������� ������ bin/mysql_setpermission, ���� ���������� ������ Perl DBIMsql-Mysql-modules.

����� ������� ����� ��������� ��������.

��� ��������� ��������� ������������ ��������� ����������� ���� ��������, � ����� ��������� � ������� section 2.4 ����������������� ��������� � ������������ ��� ����������������� ��������� � ��������:

  1. �������� �������, � ������� �� ������ ����������� �����������, � �������� ���. � ����������� �������� �� ������������� ����������� ��� `/usr/local' � ������� ������� `/usr/local/mysql', � ������� ��������������� MySQL. (��� ���������� ���������� ����������, �������������, ��������������, ��� �� ��������� ������� �������� ������ � `/usr/local'. ���� ���� ������� �������, �� �� ������ ����������� ��������� ��� ������������ root.)
  2. �������� ���� ������������ � ������ �� ������, ������������� � ������� See section 2.2.1 ��� �������� MySQL. �������� ������������ MySQL ������������ ��� ������ ������ tar � ������� ����� `mysql-VERSION-OS.tar.gz', ��� VERSION ������������ ����� ����� (�������� 4.1.1-alpha), � OS ��������� ��� ������������ �������, ��� ������� ������������ ������ ����������� (�������� pc-linux-gnu-i586).
  3. ���� �������� ����������� ���������� ��������� -max, �� ��� ��������, ��� ������ �������� ��� ������������ �������������� ������� � ������ ��������. See section 4.7.5 mysqld-max, ����������� ������ mysqld. �������, ��� ��� �������� ������������ ������� �� ������ � ���� �� ������������ ��������� ���� MySQL.
  4. �������� ������������ � ������ ��� ������� mysqld ���:
    shell> groupadd mysql
    shell> useradd -g mysql mysql
    
    ����������� ������� ��������� ������ mysql � ������������ mysql. ������ ��������� ��� useraddgroupadd ��� ��������� ������� Unix ����� ����� ��������� ��������. ��� ������� ����� ����� ���������� adduseraddgroup. ��� ������� ����� ���� ������������ � ������ ������ mysql ������ �����.
  5. ������� ��������������� ��� ��������� �������:
    shell> cd /usr/local
    
  6. ���������� ����������� � �������� ������� ���������:
    shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
    shell> ln -s full-path-to-mysql-VERSION-OS mysql
    
    ������ ������� ������� ������� � ������ mysql-VERSION-OS, � ������ - ������������� ������������� ������ �� ������ �������. ��� ��������� ����� ������ ��������� �� ������� ��������� - ��� �� `/usr/local/mysql'.
  7. �������� � �������� ���������:
    shell> cd mysql
    
    � �������� mysql �� ������� ��������� ������ � ������������. �������� ������� ��� ����� ��������� �������� ����������� `bin'`scripts'.
    `bin'
    ���� ������� �������� ���������� ��������� � ������. ���������� �������� ������ ���� � ����� �������� � ���������� ��������� PATH, ����� �������� ������������ ������� ��������� �������� ��������� MySQL. See section F ���������� ���������.
    `scripts'
    ���� ������� �������� ������ mysql_install_db, ������������ ��� ������������� ���� ������ mysql, ���������� ������� ����������, � ������� �������� ����� ������� � �������.
  8. ���� �� ������������� ������������ mysqlaccess � ���������� ����������� MySQL � �����-���� ������������� �����, �� ���������� �������� �����, ��� mysqlaccess ������� ����� ������� mysql. �������������� ������ `bin/mysqlaccess' �������� �� 18-� ������. ������� ������, ���������� �������� ���:
    $MYSQL = '/usr/local/bin/mysql'; # ���� � ������������ ������� mysql
    
    �������� ���� ��� �������� ���� ����� � �������, ��� ������������� ��������� mysql. ���� ����� �� �������, �� ��������� ������ Broken pipe ��� ������� mysqlaccess.
  9. �������� ������� ���������� MySQL (���������� ������ � ��� ������, ���� ����� MySQL �� ��������������):
    shell> scripts/mysql_install_db
    
    �������, ��� � ������� MySQL ������, ��� 3.22.10, ������ MySQL ���������� ��� ������� mysql_install_db. ������ ��� �� ���!
  10. �������� �������������� ��������� ���� ������������ root � �������������� �������� ������ ������������, ��� ������� ����� ����������� mysqld, ��������� �������:
    shell> chown -R root /usr/local/mysql/.
    shell> chown -R mysql /usr/local/mysql/data
    shell> chgrp -R mysql /usr/local/mysql/.
    
    ������ ������� �������� ��������� ������� ����� �� ������������ root, ������ - ��������� �������� ������ �� ������������ mysql, � ������ - ������ �� ������ mysql.
  11. ���� �� ������ ���������� ��������� ���������� Perl DBI/DBD, See section 2.7 ��������� �� ��������� Perl.
  12. ���� �� ������ ��, ����� ������ MySQL ���������� ������������� ��� ��������� �������� ����������, �� ����� ����������� `support-files/mysql.server' � �� �����, ��� ��������� ����� ������� ����� �������. ����� ��������� ���������� ����� ����� � ����� ������� `support-files/mysql.server' � � ������� See section 2.4.3 �������������� ������ � ��������� MySQL.

����� ����, ��� ��� ��� ����� �����������, ���������� ���������������� � �������������� ������ �����������.

��������� ������ MySQL ����� � ������� ��������� �������:

shell> bin/safe_mysqld --user=mysql &

� ������ ������� ������� � ������� section 4.7.2 safe_mysqld, �������� mysqld � ����������� ������ See section 2.4 ����������������� ��������� � ������������.

2.3 ��������� ��������� ������������ MySQL

����� ��� ��� ���������� � ��������� ��������� ����, ������� ���������, ��� ��� �������� ����������� �������� ��� ����� ��������� � ��� �� ����� �������� �� ����� �������. �� ��������� ����� ������ ��� ����, ����� �������� ���� �������� ������������ ���������� ���������� �� ���������.

��� ������ � ��������� MySQL �� ��������� ���� ���������� ��������� �����������:

����� �����, ����� �� ������������ ��������� ������ gcc, ���������� �����, ����� ``��������'' ����� -fno-exceptions. � ��������� ������ �� ��������� ���������� ��������� ����, ������� ����� ���������� �������� � ������. �� ����� ����������� ������������ -felide-constructors-fno-rtti ������ � -fno-exceptions. ���� �� ������������, �� ��������� ��������� ��������:

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions \
       -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler \
       --with-mysqld-ldflags=-all-static

�� ����������� ������������ ������ ��� ���� ������� � ���������� �������� ���.

���� ��� �������� ����������� � ����������, �� ��� �������� �������� �� mysql@lists.mysql.com, ����������, ������ ����������� mysqlbug. ���� ���� ���� �������� �� ������� �����-���� �������, mysqlbug ������� ��������� ����������, ������� � ������� ������� ���� �������� ������ �������������. ��� mysqlbug ����������� ����������� ����, ��� �� �������� ������� ����� ��������! mysqlbug ����� ����� � �������� `scripts' ����� ���������� ������������. See section 1.8.1.3 ��� ���������� ������ �� ������� ��� ���������.

2.3.1 ����� ������� ���������

��� ��������� MySQL �� ��������� ���� ���������� ��������� ��������� �������� �������:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> scripts/mysql_install_db
shell> chown -R root /usr/local/mysql
shell> chown -R mysql /usr/local/mysql/var
shell> chgrp -R mysql /usr/local/mysql
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> /usr/local/mysql/bin/safe_mysqld --user=mysql &
���
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &

���� ����������� ������ MySQL 4.x.

����� ���������� ��������� ������ InnoDB, ������� ��������������� ���� `/etc/my.cnf', ������ ������ # ����� ���� �����������, ������� ���������� � innodb_.... See section 4.1.2 ����� ���������� `my.cnf'. See section 7.5.2 ��������� ������� InnoDB.

���� �� ����������� �������� ��� RPM, ��������� ��������� �������:

shell> rpm --rebuild --clean MySQL-VERSION.src.rpm

��� ������� ������� �������� ��� RPM, ������� �� ������ ����������.

����� ������������� ����� ��������, ��������� ������ bin/mysql_setpermission, ���� ���������� ������ Perl DBIMsql-Mysql-modules.

���� ������� ����� ��������� �������� ���������.

��� ��������� ��������� ���� ����� ��������� ����������� ���� ��������, � ����� ������� � ������� section 2.4 ����������������� ��������� � ������������ ��� ������������� � ����������������� ��������:

  1. �������� �������, � ������� �� ������ ����������� �����������, � �������� ���. �������� ���� ������������ � ������ �� ������, ������������� � ������� See section 2.2.1 ��� �������� MySQL.
  2. ���� �� �������������� � ���, ����� ������������ � MySQL ������� Berkeley DB, �� ���������� �������� ������ ��������� ���� ������ Berkeley DB � �������. ����� ����, ������ ��� ������������� �����-���� ��������, ������������, ����������, � ��������, ����������� �������� Berkeley DB (see section 7.6 ������� BDB ��� BerkeleyDB). ������������ ��������� ���� MySQL ������������ � ���� ������ ������� tar � ������� ��������� `mysql-VERSION.tar.gz', ��� VERSION ������������ ����� �����.
  3. �������� ������������ � ������ ��� ������� mysqld ��������� �������:
    shell> groupadd mysql
    shell> useradd -g mysql mysql
    
    ��� ������� ��������� ������ mysql � ������������ mysql. ������ ��������� ��� useraddgroupadd � ��������� ������� Unix ����� ����� ��������� �������. ����������� ���� ������� ����� ����� ����� ������ �������� - adduseraddgroup ��������������. ������������ � ������ ����� ��������� �����-������ ����, �������� �� mysql �����.
  4. ���������� ����������� � ������� ��������:
    shell> gunzip < /path/to/mysql-VERSION.tar.gz | tar xvf -
    
    ��� ������� ������� ������� � ������ `mysql-VERSION'.
  5. ��������� �� �������� �������������� ������������ � ������� ������� ������:
    shell> cd mysql-VERSION
    
    ������, ��� ������ ���������� ��������������� � ����������� MySQL �� ����� �������� ������� ������. ��������� MySQL � ������ �������� ������.
  6. ����������� ����� � ������������� ���� ���:
    shell> ./configure --prefix=/usr/local/mysql
    shell> make
    
    ��� ������� configure ���, ��������, ����������� ������� ��������� �����. ����� �������� ������ �����, ��������� ./configure --help. ��������� �������� �������� ����� ����������� � ������� See section 2.3.3 �������� ����� configure. ���� configure �� �������� � �� ����������� �������� ������ � �������� � ������ �� mysql@lists.mysql.com, �� ������� �������� � ���� �� ������ �� `config.log', �������, �� ������ ������, ����� ������ ������ ������ ��������. ����� ����, ���� ���������� configure �������������� ������������, � ������ ������� �������� ��������� ��������� ����� ������ �� configure. ��� ������� ������ �� ������ ����������� ������ mysqlbug (see section 1.8.1.3 ��� ���������� ������ �� ������� ��� ���������). ���� ���������� �� �����������, �� ����������� � ������� See section 2.3.5 �������� � �����������?, � ������� ���������� ������������ �� ������� ���� ����� ������������� �������.
  7. ���������� ���� ���:
    shell> make install
    
    ��������, ���������� ��������� ��� ������� ��� root.
  8. �������� ������� ���������� MySQL (��� ���������� ������ � ������, ���� ��� ����� ������������� ������ MySQL ):
    shell> scripts/mysql_install_db
    
    ������, ��� � ������� MySQL �� 3.22.10 ������ ������� MySQL ���������� ��� ������� mysql_install_db. ������ ��� �� ���!
  9. �������� �������������� ��������� ���� root � �������������� �������� ������, �������� �� ������������, ��� ������ �������� ����� ����������� mysqld. ��� �������� ��������� �������:
    shell> chown -R root /usr/local/mysql
    shell> chown -R mysql /usr/local/mysql/var
    shell> chgrp -R mysql /usr/local/mysql
    
    ������ ������� �������� ������� owner ������� ����� �� ������������ root, ������ - ������� owner �������� ������ �� ������������ mysql, � ������ - ������� group �� ������ mysql.
  10. ���� �� ������ ���������� ��������� ���������� Perl DBI/DBD, ����������� � ������� See section 2.7 ��������� �� ��������� Perl.
  11. ���� �� ������ ��, ����� ������ MySQL ���������� ������������� ��� ��������� �������� ����������, �� ����� ����������� `support-files/mysql.server' � �� �����, ��� ��������� ����� ������� ����� �������. ����� ��������� ���������� ����� ����� � ����� ������� `support-files/mysql.server' � � ������� See section 2.4.3 �������������� ������ � ��������� MySQL.

����� ���������� ��������� ������ ����������� ���������� ������������������� � ��������������:

shell> /usr/local/mysql/bin/safe_mysqld --user=mysql &

���� ��� ������� ���������� ������ ���������� ����� �������� ������ mysqld, �� ��������� ���������� ����� ����� � ����� `mysql-data-directory/'hostname'.err'. �������, ��������, ����������� � ���, ��� ��� ������� ������ ������ mysqld (see section 4.1.4 ������ ���������� �������� MySQL �� ����� ����������).

������ ����������� � ������� See section 2.4 ����������������� ��������� � ������������.

2.3.2 ���������� ������

����� ������ ������������ � ������ �������� ��� ���������� � ����� ������ �� ���-����� MySQL (http://www.mysql.com/downloads/patches.html).

��� ���������� ����� �� ������ �������� ��������� ���������, ���������� ����, � �����, ��������� ��� � ������� ������� ������, � ������� ��������� ������ �������� ����� MySQL, � ��������� ��������� �������:

shell> patch -p1 < patch-file-name
shell> rm config.cache
shell> make clean

����� � FTP-����� ���������������� ��� ����� � ������� ������� ��� ��� �����, ������ � ������� gzip. ���� � ���� �������� ������ ������� ���������, ��� �������� ���� ��� ������ �� ������ ��������. ����� ��������� ������ ����, ��������� ��� � ������� ������� ������, � ������� ��������� ������ �������� ����� MySQL, � ��������� ��������� �������:

shell> gunzip < patch-file-name.gz | patch -p1
shell> rm config.cache
shell> make clean

����� ���������� ����� �������� ����������� ��� ������� ��������� ��������� ����, ������� � ����� ./configure. ����� ������� ����� make install ������������� ���� ������ MySQL.

��������, ����� �������� make install ����������� ���������� ����� ���������� � ��� ����� ������� (����������� ��� ����� mysqladmin shutdown). � ��������� ������� �� ����������� ������������� ����� ������ �����-���� ���������, ���� ��� �������� ���������� � ������ ����� ������.

2.3.3 �������� ����� configure

������ configure ������������ ������� ����������� ���������� ������������� ������������ MySQL. ������ ����� ���������� �������������� ����� ������������� ����� � ��������� ������ configure. �� ������ configure ����� ����� �������������� ��� ������ ��������������� ���������� ��������� (see section F ���������� ���������). ����� �������� ������ �������������� configure �����, ��������� ��������� �������:

shell> ./configure --help

���� ������� ��������� �� �������� ����� ������������ ����� configure:

2.3.4 ��������� �� ������������������ ������ �������� �����

��������������: ���� ������ ���������� ������ ������ � ��� ������, ���� �� ������ ������ ��� � ������������ ������ ����. ������������, ������� ������ ����� ���������� MySQL � ��������� ��� �� ����� �������, ������ ������������ ����������� ������ ������������ (���� �������� ���, ���� �������� �����������).

����� �������� ����� ��������� �� ������������� ������� �������� �����, ����������� ��������� ����������:

  1. ��������� ��������� BitKeeperhttp://www.bitmover.com/cgi-bin/download.cgi. ��� ������� � ������ ��������� ��� ����������� ������ Bitkeeper 3.0 ��� ����� �����.
  2. ��������� ���������� �� ��������� ���� ���������.
  3. ����� ��������� BitKeeper ������� ��������� � �������, �� �������� ����������� ��������, ����� ����������� ���� �� ����������� ���� ������, ��� ��������� �������� ����� ����� MySQL. ����� ����������� ����� 3.23:
    shell> bk clone bk://mysql.bkbits.net/mysql-3.23 mysql-3.23
    
    ����� ����������� ����� 4.0:
    shell> bk clone bk://mysql.bkbits.net/mysql-4.0 mysql-4.0
    
    ����� ����������� ����� 4.1:
    shell> bk clone bk://mysql.bkbits.net/mysql-4.1 mysql-4.1
    
    � ���������� �������� ����� �������� ����� ����� ���������� � ������������ `mysql-3-23/', `mysql-4.0/' ��� `mysql-4.1/' ������ �������� ��������. ���� �� ���������� �� ������������, � ������ ������ ������ HTTP-�������, �� ������ ����� ������������ BitKeeper �� HTTP. ���� �� ����������� ������-������, ������ ���������� ���������� ��������� http_proxy:
    shell> export http_proxy="http://your.proxy.server:8080/"
    
    � ������ ������ �������� bk:// �� http:// ����� ������ ������ ������������. ��������:
    shell> bk clone http://mysql.bkbits.net/mysql-4.1 mysql-4.1
    
    �������������� �������� ������ �������� ����� ����� ����������� ������� � ����������� �� �������� ������ ����������; ������ ���������.
  4. ����� ��������� ��������� ����� ������, ��� ����������� ��������� GNU make, autoconf 2.53 (��� �����), automake 1.5, libtool 1.4m4. ��������� automake 1.7 (��� �����) ��� �� ��������. ���� �� ������ ��������� MySQL 4.1, ��� ����� ����������� bison 1.75. ����� ������ ������ bison ����� ������ ����� ������: sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded. �� ����� ���� ������������ ������ ������ �� �����������, ��� ���������� ��� ���������, �� ������-�������� ����� ��������� ���� ��������� ������ � ����� ������ ������� bison. �������� ������� � ���������� � ��������:
    cd mysql-4.0
    bk -r get -Sq
    aclocal; autoheader; autoconf; automake
    (cd innobase ; aclocal; autoheader; autoconf; automake) # ��� InnoDB
    (cd bdb/dist ; sh s_all ) # ��� Berkeley DB
    ./configure  # ���� ������� ����� �����
    make
    
    ���� �� ��������� ����� �������� ��������� �� ���� ����� - ��������������, ��� � ��� ������������� ����� libtool! �������� ����� ����������� ���������������� �������� ��������� � ����������� `BUILD/'. ���� �� ������������� �������� ������ ����, ����� ������������ ������ `BUILD/compile-pentium-debug'. ��� �������������� � �������������� ������ ����������� ������������� ���� ������ ����� �������� ������, ����������� � Pentium.
  5. ����� ���������� ���������� ��������� make install. ������� ��������� ������������ ��� ������ �� ������, ����������� � ������������; ������ ������� ����� ��������� ��������� ������ ����� ������������ ������������� ������. ���� � ��� ��� ����������� ���� ������ MySQL, �� ����������� ��������� ./configure �� ���������� ��� ����� prefix, with-tcp-portunix-socket-path, ��������� �� ���, ��� ���� ������������ ��� �������, ������������ � ������������.
  6. �������� �������� ���� ����� �����������, ����������� �������� ������ ����� ������������. ��������� � ������� make test (see section 9.1.2 ����� ������������ MySQL).
  7. ���� ��� ������� ����� �� ����� make � ����������� �� ����� ���������������, ������� �������� ��� �� ���� �� ������ bugs@lists.mysql.com. ������� ������������� ��� � � ��� ������, ���� �� ���������� ��������� ������ ��������� ���������������� ������� GNU � ��� ������ ���� ��� ������� ���������� ��� ���������������� ����. ������ ���� ��� ���������� aclocal �� �������� ������ command not found ��� ��������� ����������� ��������, �� ���� �������� �� ����. � ����� ������ ������� ���������, ��� � ��� ����������� ��� ����������� ���������������� ��������� � ��� ���� ���������� PATH ������� ���������, ����� �������� ����� ����� ��.
  8. ��� ���� ����� �������� ����� �������� ����� ����� ��������� �������� bk clone, ���������� ������������ ��������� bk pull ��� ��������� ����������.
  9. �� ������ ������� ������� ��������� ������ �������� �����, ����� ������� ��� ������� � ��� - ��� ����� ������� ������������ bk sccstool. ��� ����������� �����-���� �������, ������� ��������� ��� ���������, ��� ����, �� �������� ��������� �������, �� ������������ - ��������� ������ �� internals@lists.mysql.com. ����� ����, ���� �� ��������, ��� � ��� ���� ������ ���� �� ����������, ��������� �� ���� �� ������ ��������� �� ����� ������. bk diffs ������� ���� ����� �������� ��������� � �������� ���. ���� � ��� ��� ������� �������� ���, ����������� ���� ����, ������ �������� �� ��������.
  10. BitKeeper ����� ������� ��������������� ���������, ������� �������� ����������� bk helptool.
  11. ��������: ����� commit (bk ci ��� bk citool) ���������� ������� ��������� � ����������� � ��� ���������� ������ �������� (internals). � ����� ������, ��� �� ����� ������������ commit (��������� ��������-��������� ������ �� �������� bk push), �� ������, ����� bk diffs, ��������� �����.

�� ����� ������ ������������� ���������, ����������� � �������� ��� � ������, ��������, �� ������ http://mysql.bkbits.net:8080/mysql-4.1 ��� MySQL 4.1.

����������� ��������� � ��������� ������, ������� ����� ����������� ���:

shell> bk clone bk://mysql.bkbits.net/mysqldoc mysqldoc

2.3.5 �������� � �����������?

�� Solaris ��� Linux � �������������� ����������� gcc ��� ��������� MySQL � ��� ������������� ����� � ��� �����-���� ��������������. � ������ �������� ����� ��������� �������������� ��-�� �������� ���������� ��������� ������ (�� ������ ��������������, ������� ����� ��������� ��� ������������� ������� MIT-pthreads, ����������� � ������� see section 2.3.6 ��������� �� ������� MIT-pthreads). ������������ ������ ������� ��������� � ����������� ���� �������.

������� ������ ������� ������������ ���������� ��������������������. � �������, ����� �������������������� ������������� ����������, ������� ��������� ���������:

2.3.6 ��������� �� ������� MIT-pthreads

� ���� ������� ����������� ��������� ������� ������������� ������� MIT-pthreads.

������� ����� � ����, ��� ��� Linux ������������ ������ MIT-pthreads ������, ��� ����� ���������� ���������� LinuxThreads! See section 2.6.1 ���������� � Linux (��� ������ Linux).

���� ���� ������� ���� �� ���� �� ������������ ��������� �������, �� ���������� ������������ MySQL, ��������� ����� ��������� MIT-pthreads. � ����� �������� ��������� ������ ������� FreeBSD, SunOS 4.x, Solaris 2.4 � ����� ������, � ����� ��������� ������ (see section 2.2.5 ������������ �������, �������������� MySQL).

��������, � ������ MySQL 4.0.2 ������ MIT ����� �� ������������ � �������� �������� �������. ���� ��� ������������� ����� ���� �����, �� ������ ��� ������� � http://www.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-mysql.tar.gz

����� ��������, ���������� ���� ����� � ������� �������� ������� MySQL. ��������� ����� ������� mit-pthreads.

2.3.7 ����������� ��������� ���� ��� Windows

��� ����������� ��������� ��������:

������ MySQL

  1. �������� ������� ������� (�.�. workdir).
  2. ���������� ����������� ��������� ���� � �������������� ��������.
  3. ��������� ���������� VC++ 6.0.
  4. � ���� File �������� Open Workspace.
  5. �������� ������� ������� mysql.dsw, ����������� � ������� ��������.
  6. � ���� Build �������� ������� Set Active Configuration.
  7. �������� � ����������� ���� mysqld - Win32 Debug � ������� OK.
  8. ������� ������� F7, ����� ������ ������� ���������� ���������� ������ �������, ��������� � ��������� ���������� ����������.
  9. �� ��������� ���������� ���������� ���������� � ����������� ����� � ��������� �������.
  10. ��� �� �������� ������������� ������� ������ (������), ������� ��� �����.
  11. �������� ������� ��� �����, ��� ����� MySQL, �.�. `c:\mysql'
  12. �� �������� workdir ���������� � ������� `c:\mysql' ��������� �����������:
  13. �������� ������� `c:\mysql\bin' � ���������� � ���� ��� ���������������� ����� ���� ������� � �������.
  14. ��� ������� ������ ����� ������� ������� `lib' � ����������� � ���� ���������������� ����� ����������.
  15. ����������� �������, ��������� Visual Studio. ���������� � ��������� ������ ��� �� ��������, ��� � ��� ��������� ������������ ��� Windows (see section 2.1.2.2 ���������� ������������ MySQL ��� Windows).

2.4 ����������������� ��������� � ������������

����� ��������� MySQL (�� ��������� ������������ ��� ��������� ����) ���������� ������������������� ������� ����������, ��������� ������ � ���������, ��� ������ �������� ���������. ����� ����� ������������ �������������� ������ � ��������� �������, ����� ������������ ������� �������������� �������� � ���������� ������.

������ ��� ��������� �� ��������� ���� ��� ��������� ������ ���������� � ������� ������� ����� ��������� ��������� �������:

shell> ./scripts/mysql_install_db
shell> cd mysql_installation_directory
shell> ./bin/safe_mysqld --user=mysql &

��� ��������� ������������ (�� �� ��� ������� RPM ��� pkg) �������� ���:

shell> cd mysql_installation_directory
shell> ./scripts/mysql_install_db
shell> ./bin/safe_mysqld --user=mysql &

���

shell> ./bin/mysqld_safe --user=mysql &

���� �� ����������� MySQL 4.x.

��� �������� ������� ���� ������ mysql, ������� ����� ������������ ��� ���������� ������� � ���� ������, ���� ������ test, ������� ����� ������������ ��� ������������ MySQL, � ����� ������ ���������� ��� ������������, ������� ��������� mysql_install_db � ��� ������������ root (��� �����-���� �������). ��� ���� ����� ����������� ������ mysqld.

mysql_install_db �� �������������� ������ ������� ����������, ��� ��� �� ������ ����� ���������� � ����� ������. ���� ��� �� ����� ���� ������ test, �� ����� ������� � ������� mysqladmin -u root drop test.

������������ ����� ����� ��������� �� �������� ���������� ������ ������������ MySQL. ��� ��������� ������������ ������� �������� ��� ������� ����������� (������ ���-������ ����� `/usr/local/mysql'). ��� ������������ � ���� ��������� ���� ��� - ������� ������� ������ ������ �������� ����� MySQL.

� ��������, �������������� � ��������� ������� � ����������� �����������, BINDIR ������������ ����� ���� � ���� ��������������, ��� ��������������� ��������� ����� mysqladminsafe_mysqld. ��� ��������� ������������ ��� ������� `bin' ������ ������������. ��� ������������ � ���� ��������� ���� BINDIR ����� ������������ ����� `/usr/local/bin', ���� ��� ������� configure �� ������ ����, ��� `/usr/local' ��������������� �������. EXECDIR - �����, ��� ��������������� ������ mysqld. ��� ��������� ������������ ��� �� �� �����, ��� � BINDIR. ��� ������������ � ���� ��������� ���� EXECDIR ����� ������������ ����� `/usr/local/libexec'.

��������� �������� ������������:

  1. ���� ����������, ��������� ������ mysqld � ���������� �������� ������� ���������� MySQL, ���������� �� ����������, ������� ����������, ����� �������� ������������� ��������� ������������ � �������. ������ ��� �������� � ������� ������� mysql_install_db:
    shell> scripts/mysql_install_db
    
    ��� �������, mysql_install_db ������� ������� ������ ������ ��� ��� ��������� MySQL. ����� �������, ���� ������������ ������������ ������������ ���������, �� ������ ���� ����� ���������� (������ ������ mysql_install_db ���������� ��������� ��� ������������� � �� ��������� ������� ��� ������������ �������; ������� ���� � ��� ��� ����������� � ���, ��� ���������, �� ������ ����� ��������� mysql_install_db). ������ mysql_install_db ������� ����� ������ (user, db, host, tables_priv, columns_priv, and func) � ���� ������ mysql. �������� �������� ���������� ������ � ������� See section 4.3.4 ������� ����������� ���������� MySQL. ���� � ���� ������, �� ��� ���������� ��������� ������������ root MySQL ������ ���, ��� ������, � ������ ������������ ��������� ��������� ��� ������������ ���� ������ � ������ test ��� ������������ � test_. ���� ������� ���������� �� �����������, �� � ��������� ������� ��� ������� ������� �������� ��������� ������:
    mysqld: Can't find file: 'host.frm'
    
    ����� ������ ����� ��������� � � ������ ��������� ������������ MySQL, ���� �� �� ������ ������ MySQL � ������� ���������� ������� `./bin/safe_mysqld'! See section 4.7.2 safe_mysqld, �������� mysqld. ��������, ��� ����������� ��������� mysql_install_db ��� root. ������ ��� ������� �� ������ ��������� ������ MySQL ��� ������������������� (��-root) ������������, ��� �������, ��� ���� ������������ ����� ������ ������ ����� �� �������� ���� ������ � ���������� � ���� �����. ���������� �� ������� MySQL � �������� �������������������� ������������ ������ � ������� See section A.3.2 ������ MySQL �� �������� ������������. ���� ��������� �������� � mysql_install_db, ����������� � ������� See section 2.4.1 �������� ��� ������� mysql_install_db. ����������� MySQL ������������ ��������� ��������� ������� ������� mysql_install_db: ����� ��������� ���������� � ����������� ���� ������������� ��������� � ������� See section 4.3.4 ������� ����������� ���������� MySQL.
  2. ��������� ������ MySQL ��� �������� ����:
    shell> cd mysql_installation_directory
    shell> bin/safe_mysqld &
    
    ���� ��������� �������� � �������� �������, See section 2.4.2 �������� ��� ������� ������� MySQL.
  3. ����������� mysqladmin ��� ��������, ��� ������ ��������. ������� �������� ����, ��� ������ ������������� � �������� �� �����������, ������������ ��������� �������:
    shell> BINDIR/mysqladmin version
    shell> BINDIR/mysqladmin variables
    
    ����� �� mysqladmin version ����� ����� ��������� �������� � ����������� �� ������������ ��������� � ������ MySQL, �� ������ ���� ����� �� ����������� ����:
    shell> BINDIR/mysqladmin version
    mysqladmin  Ver 8.14 Distrib 3.23.32, for linux on i586
    Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license.
    
    Server version          3.23.32-debug
    Protocol version        10
    Connection              Localhost via Unix socket
    TCP port                3306
    UNIX socket             /tmp/mysql.sock
    Uptime:                 16 sec
    
    Threads: 1  Questions: 9  Slow queries: 0
    Opens: 7  Flush tables: 2  Open tables: 0
    Queries per second avg: 0.000
    Memory in use: 132K  Max memory used: 16773K
    
    ����� �������� ������������� � ���, ��� ��� ����� ������ � ������� BINDIR/mysqladmin, ��������� ��� ������� � ������ --help.
  4. ���������, ��� ������ ���������� ������:
    shell> BINDIR/mysqladmin -u root shutdown
    
  5. ���������, ��� ������ ������������� ������. ������� ���, ��������� safe_mysqld ��� ����� ������� ������ mysqld. ��������:
    shell> BINDIR/safe_mysqld --log &
    
    ���� safe_mysqld ������ �������, ����������� ��������� ������� �� �������� ��������� MySQL (���� �� ��� �� ���). ���� ������� ��-�������� �� ��������, ��. ������ See section 2.4.2 �������� ��� ������� ������� MySQL.
  6. ��������� ��������� ������� ������, ����� ���������, ��� ������ ��������. ����� ������ ���� ����� �� ����������� ����:
    shell> BINDIR/mysqlshow
    +-----------+
    | Databases |
    +-----------+
    | mysql     |
    +-----------+
    
    shell> BINDIR/mysqlshow mysql
    Database: mysql
    +--------------+
    |    Tables    |
    +--------------+
    | columns_priv |
    | db           |
    | func         |
    | host         |
    | tables_priv  |
    | user         |
    +--------------+
    
    shell> BINDIR/mysql -e "SELECT host,db,user FROM db" mysql
    +------+--------+------+
    | host | db     | user |
    +------+--------+------+
    | %    | test   |      |
    | %    | test_% |      |
    +------+--------+------+
    
    � ����������� `sql-bench' �������� ��������� MySQL ��������� ����� ������ ������������������, ������� ����� ������������ ��� ��������� ������ MySQL �� ��������� ����������. ������� `sql-bench/Results' �������� ���������� �������� ���������� �������� ��� ��������� ��� ������ � ��������. ����� ��������� ��� �����, ��������� ��������� �������:
    shell> cd sql-bench
    shell> run-all-tests
    
    ���� � ��� ����������� ������� `sql-bench', ��, ��������, �� ��������� � ������� RPM ��� ��������� ������������ (� ������ RPM � �������������� ��������� ���� ���������� ������� ������ ������������������). � ���� ������ ������ ��� ������������ ����� ������ ������������������, ���������� ��� ����������. ������� � ������ MySQL 3.22, ���������� RPM-����� ������ ������������������, `mysql-bench-VERSION-i386.rpm', ������� �������� ��� ������ ������������������ � ������. ���� ����������� ��������� ����, ����� ����� ��������� ��� ����� � ����������� `tests'. ��������, ����� ��������� `auto_increment.tst', �������� ���������:
    shell> BINDIR/mysql -vvf test < ./tests/auto_increment.tst
    
    ���������� ����� ���������� � ���� `./tests/auto_increment.res'.

2.4.1 �������� ��� ������� mysql_install_db

������ mysql_install_db ������������ ������ ��� �������� ����� ������ ���������� MySQL. �� �� ������ �� �� ����� ������ ������! � ���� ������� ���������� MySQL ��� �����������, ���� ������ ������ �� ����� ������!

��� ���� ����� ������� ������� ���������� ������, ���������� ���������� ������ mysqld, ���� �� ��������, � ����� ��������� ���-������ �����:

mv mysql-data-directory/mysql mysql-data-directory/mysql-old
mysql_install_db

� ���� ������� ����������� ��������, � �������� ����� ����������� ��� ������� mysql_install_db:

mysql_install_db �� ������������� ������� ����������
����� ���������, ��� mysql_install_db �� � ��������� ���������� ������� ���������� � ����������� ���� ������ ����� ������ ��������� ���������:
starting mysqld daemon with databases from XXXXXX
mysql daemon ended
� ����� ������ ���������� ����� ��������� ������� ��������� ������! ���� ������ ������ ���������� � �������� `XXXXXX', ��������� � ������ ��������� �� ������. � ��� ���������� ���������� � ���, ������ �� ���������� mysqld. ���� ��� �� ������� ����������� � ���, ��� ���������, ��� ������� ������ �� ������ �������� � ���� ������ ������, ��������� mysqlbug! ��.������ See section 1.8.1.3 ��� ���������� ������ �� ������� ��� ���������.
��� ���������� ���������� ����� mysqld
� ����� ������ ��� ������ �� ������� ��������� mysql_install_db. ������ mysql_install_db ������ ����������� ������ ������� ��� ��������� MySQL ������ ���.
��� ���������� ������ mysqld ��������� ������� ������ �� ��������
��� ����� ���������, ����� ��� ���������� ������������� ������ MySQL, �� �� ������ ���������� ����� ����������� � ������ ����� (��������, ��� ������������ ���, ��������, ��� ������ ��������� ��������� ��� ����������� � ���� � �� �� �����). ������ ������, ����� ��������, ������� ��������� ��� ������� ��������� ������ ������, ����������� � ���, ��� ������ ������ �������� ������������ ��� �� ����� � ����, ��� � ������. � ���� ������ �� ������ �������� ��������� ��������� �� ������: Can't start server: Bind on TCP/IP port: Address already in use ��� Can't start server: Bind on unix socket.... See section 4.1.3 ��������� ���������� �������� �� ���� ���������.
��� ������� ��� ������ � `/tmp'
���� � ��� ��� ������� ��� �������� ����� ������ � �������� �� ��������� ����� (� `/tmp') ��� ���������� ��������� ��������� ����� � �������� `/tmp', �� �� �������� ������ ��� ������� mysql_install_db ��� ��� ������� ��� ������������� mysqld. ���������� ������� ������ ������� ��� ������ � ��������� ������ ��������� �������:
shell> TMPDIR=/some_tmp_dir/
shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysqld.sock
shell> export TMPDIR MYSQL_UNIX_PORT
See section A.4.5 ��� �������� ��� �������� �����-���� MySQL `/tmp/mysql.sock'. ���� `some_tmp_dir' ������ ��������� �� ��������� �������, ��� �������� � ��� ���� ������ ��� ������. See section F ���������� ���������. ����� ����� � ��� ������ ��������� ����������� ��������� mysql_install_db � ������ ������ ������� � ������� ��������� ������:
shell> scripts/mysql_install_db
shell> BINDIR/safe_mysqld &
����������� ��������� ����� mysqld
���� �� ��������� �� ������ RedHat 5.0 � ������� glibc ����� ������, ��� 2.0.7-5, ������� ������������ � ���, ����� ���������� ��� ����� ��� glibc! � ������� �������� MySQL ������� ������� ���������� ����� �� ����. ������ �� ������ ����� �������� � ���������� ������ �� http://lists.mysql.com/. ����������� ����� � ������� See section 2.6.1 ���������� � Linux (��� ������ Linux). ����� ����� ��������� mysqld �������, ��������� ����� --skip-grant-tables, � �������������� �������� ���������� � �����������, ��� ������ mysql:
shell> BINDIR/safe_mysqld --skip-grant-tables &
shell> BINDIR/mysql -u root mysql
�� mysql � ������ ������ ��������� ������� SQL � mysql_install_db. ��������������, ��� ����� ����� �� ��������� mysqladmin flush-privileges ��� mysqladmin reload, ����� ������ ���������� ������� ����������.

2.4.2 �������� ��� ������� ������� MySQL

���� �� ����������� ������������ �������, �������������� ���������� (InnoDB, BDB), ������� ������ ����� ������� ���� `my.cnf' � ���������� ����� ������� ��� ��� ����� ������, � �������� ����������� ��������. See section 7 ���� ������ MySQL.

� ����� ������ ������ mysqld ����������� ����� �� ��������� ��������:

��� ����� ������� ����� mysqld �������� ���� ������� �� ������� ������ (datadir). � ��� �� ������� ����� ���������� �����, ����� pid (ID ���������) � ���������� ���� ������.

�������������� �������� ������ ������ ��������������� ��� ���������� ������������. ������ ���� mysqld ������� ����� ������� ������ ���-���� � ������ �����, � �� ���, ��� �� ������������� ���������� � ����� �������, �� ����� mysqld �� ����� �������� ���������. ���� ���� �������� � ������������� ������, ��, ������� mysqld � ������ --help, �� ������ ����� ���������� � ���, ��� ��������� ����� mysqld � ����� ��������� ����� ������� �� ���������. ����� �������������� ��������� �� ��������� ��������� ���������� ���� ����� ��� ���������� mysqld � ��������� ������ (��� ����� ����� ����� ������������ � safe_mysqld).

������ ��������� ��������� mysqld ������ �������, � ������� ��������������� MySQL. ��� ����� ������� � ������� ����� --basedir. ����� ����� ������������ --help ��� �������� ������� �� ��������� ����� ����� (������, ��� --help ������ ���� ��������� ������ � ������� mysqld). ��������:

shell> EXECDIR/mysqld --basedir=/usr/local --help

����� ����������� ��������� ��������� ����� ���������� ������ ��� ����� --help.

����� �� ����� �� �� ������������ ��� ������� �������, ���� ��� ��������� ������ ����������� ���������, �� ��������� ���������� ����, ����� ������, ������ ������ ���������� ��������. ���������� ����� ��������� � �������� ������ (������ `/usr/local/mysql/data' ��� ��������� ������������, `/usr/local/var' ��� ������������ ��������� ���� � `\mysql\data\mysql.err' ��� Windows). � �������� ������ ������� ������ ����� � ������� � ���� `host_name.err'`host_name.log', ��� host_name - ��� ������ ���������� �����. ����� ��������� ��������� ��������� ����� ���� ������:

shell> tail host_name.err
shell> tail host_name.log

� ���������� ����� ����� ������ ���-������ ������� �� ���������:

000729 14:50:10 bdb: Recovery function for LSN 1 27595 failed
000729 14:50:10 bdb: warning: ./test/t1.db: No such file or directory
000729 14:50:10 Can't init databases

��� ��������, ��� �� �� ��������� mysqld--bdb-no-recover � ���� ������ Berkeley DB ����� ���-�� ��������� � ����� ���������� ������ ��� ������� ������������ ���� ���� ������. ����� ����� ����������� ����������, ���������� ����������� ������ ���������� ���� Berkeley DB �� �������� ��� ������ � ��������� ������ �����, ��� ����� ����� ����� ������� ���. ���������� ����� ����� ����� `log.0000000001' � �.�.; ����� ���������� ��� ������ �������.

���� �� ���������� mysqld �������� � ���������� ������ BDB � mysqld ��� ������ ������� ���� ����������� ������ (coredump), �� �������� ����� ��� ����� ���� �����-���� �������� � �������� �������������� BDB. � ���� ������ ����� ����������� ������ mysqld � --bdb-no-recover. ���� ��� ��������, �� ������� ������� ��� ����� `log.*' �� �������� ������ � ����������� ��������� mysqld �����.

���� �������� ����������� ���� ������, �� ��� ��������, ��� ��������� ������ ��������� (��� ������ ������ mysqld) ��� ���������� ������ TCP/IP ���� ��� �����, �� ������� mysqld �������� �������:

Can't start server: Bind on TCP/IP port: Address already in use
���
Can't start server : Bind on unix socket...

����� ���������, ��� ������� ����������� ������� mysqld ���, ����������� ps. ���� ������ ���������� ������ �� ������, �� ����� ����������� ��������� ������� telnet your-host-name tcp-ip-port-number � ������ ���� ��� ������� ``Enter''. ���� �� �� ��������� ��������� �� ������ ����� ���������� telnet: Unable to connect to remote host: Connection refused, ������, ��� ���� TCP/IP ����, ������� mysqld �������� ������������, ��� ����� ������ ����������. section 2.4.1 �������� ��� ������� mysql_install_db � ������ See section 4.1.4 ������ ���������� �������� MySQL �� ����� ����������.

���� mysqld � ��������� ����� ��������, �� ����� ����� ������������ �� ��������� ����� ��� ������ ��������� �������:

shell> mysqladmin variables
���
shell> mysqladmin -h 'your-host-name' variables

���� ��� ������� mysqld �� �������� ������ Errcode 13, ��� ������ Permission denied, ��� ��������, ��� � ��� �� ���� ���� ������/��������� ����� � ���� ������ MySQL ��� � ���������� ��������. � ����� ������ ��� ������� ���� ��������� mysqld ��� ������������ root, ���� �������� ����� ������� � ���������� ������ � ���������, ����� ����� ����� ������������ ��.

���� safe_mysqld ��������� ������, �� �� �� ������ ������������ � ����, �� ������� ���������, ��� � `/etc/hosts' ���� ������, ������� �������� �������� ���:

127.0.0.1 localhost

��� �������� ��������� ������ � ��������, �� ������� ������� ���������� �������, � ��� ������� MySQL ������� ��������������� ��� ������������� ������� MIT-pthreads.

���� �� �� ������ ��������� mysqld, �� ����� ����������� ������� �������������� ����, ����� ���������� ������ ��������. See section E.1.2 �������� �������������� ������.

��� ������������� ������ InnoDB ������� ��������� ����� �������, ������������� ��� InnoDB. See section 7.5.2 ��������� ������� InnoDB.

��� ������������� ������ BDB (Berkeley DB) ���������� ������ ����� ��������� ������������� ��� BDB ����� �������. See section 7.6.3 ��������� ������� BDB.

2.4.3 �������������� ������ � ��������� MySQL

������� mysql.serversafe_mysqld ����� ����������� ��� ��������������� ������� ������� �� ����� �������� ������������ �������. ������ mysql.server ����� ����� ������������ ��� ��������� �������.

����� ��������� ������ mysql.server ��� ������� ��� ��������� �������, ��� ������� �������� � ����������� start ��� stop ��������������:

shell> mysql.server start
shell> mysql.server stop

mysql.server ����� ����� � ����������� `share/mysql' ���������������� �������� MySQL ��� � �������� `support-files' ������ �������� ����� MySQL.

����� ��� ��� ������ mysql.server �������� ������, �� �������� ������ ������� �� ��������������� ������� MySQL, ����� �������� safe_mysqld. ��������, ����������� ��������������� ������ mysql.server, ���� �������� ����������� ���������� ���� �� � ����������� �����. ������������� ���, ������ cd � ��������������� ������� ����� ���, ��� �� �������� safe_mysqld. ���� �� ������ ��������� ������ �� ������������� ������������, �� �������� ��������������� ������ user � ����� `/etc/my.cnf' ��� �������� ����� � ���� �������.

mysql.server stop ������������� ������ ����� ������� ��� �������. ����� ���������� ������ ������� - ��� ������ ������� mysqladmin shutdown.

��� ������� �������� ��� ������� ������� � ��������� � ��������������� ����� � ������ `/etc/rc*', ���� �� ������ ������������� ��������� MySQL �� ����� �������.

�� ����������� ��������� Linux, ���������� ����������� ���� mysql.server � ������� `/etc/init.d' (��� `/etc/rc.d/init.d' �� ����� ������� �������� Red Hat). ����� �����, ��������� ����� �������, ����� �������� �������������� ������ MySQL ��� �������� �������:

shell> chkconfig --add mysql.server

� �������� ������������, � ��������� �� ����� ������������ `/etc/rc.local' ��� `/etc/init.d/boot.local' ��� ������� �������������� �������� ��� ��������. ��� ����, ����� MySQL ��������� � �������������� ����� ������, �� ������ �������� ����� ����� ����� � ��������� ������:

/bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &'

����� ����� �������� ����� ��� ������� mysql.server � ���������� ���� `/etc/my.cnf'. ������� ���� `/etc/my.cnf' ����� ��������� ��������� �������:

[mysqld]
datadir=/usr/local/mysql/var
socket=/var/tmp/mysql.sock
port=3306
user=mysql

[mysql_server]
basedir=/usr/local/mysql

������ mysql.server �������� ��������� �����: datadir, basedirpid-file.

� ������� ������������ ������ �����, ������� ������ �� ������������� ����������� �������� ������ �� ������ �����:

������ ������ �����
mysqld mysqldserver
mysql.server mysql.server, mysqld, � server
safe_mysqld mysql.server, mysqld, � server

See section 4.1.2 ����� ���������� `my.cnf'.

2.5 �������/��������� MySQL

����� MySQL, ���������� ��������� � ������, ������ ����� ���������� ����� ���������� �������� ����� � ��� �� �����������, ���� ������������ ���� � �� �� ������� ������ MySQL. � ��������� ����� ������� �������� ������ � ������� 3. ��� ��������� ��������� �� ����� ������ MySQL (��� ���� ����� ����� ���������� ������� ����������) ���������� ��������� myisamchk -r -q --set-character-set=charset �� ���� ��������. � ��������� ������ ������� ����� ������������� �����������.

� ������ ��������� � ����� ������� ������ ����� ������������� ������ ������ mysqld, ������� �� ��� �� ���-������ ����� mysqld-old-version-number. ���� ����� ����� mysqld ����� ������ ������ ����� ���� �� ���, ��� ���������, �� ����� ������ ���������� ������ ����� ������ � ������������� ������!

�, ����������, ��� ������������ ������� ����� ������� ��������� ����� ������ ��� ������.

����� ������������ � ��� ����� ���������� �������� � �������������������� ����������� �����������, ������ ��� Commands out of sync, ��� ��������� ����������� ������ ���������� (coredump). ������� ����� ���� � ���, ��� ��� ���������� �������� ���� ������������ ������ ������������ ��� ������������ �����. � ���� ������ ������� ��������� ���� �������� ������ ����� `mysql.h' � ���������� `libmysqlclient.a', ����� ���������, ��� ��� �� ������ ������������ MySQL. ���� ��� �� ���, �� ��������� ����� �����������������!

���� ��������� �������� � �������� ������ ������� mysqld ��� ��������� � ������������ ��� ������, �� ����� ���������, ��� �� �� ����������� ������ ���� `my.cnf' �� ������ ���������! ��� ����� ��������� � ������� program-name --print-defaults. ���� ��� ��������� ������ ����� ��������� ������� ���-������ ����, �� ��� ���� `my.cnf' �������� �������� � ��������� ������� �� ��� �������!

������ ��� ��� ��������� ������ ������ MySQL ���� ����� ��������� ������ � ����������������� ����������� Msql-Mysql-modules, �������� ���� �� ��������� �������� ����, ��� ���� ������� DBI ������� ����� ������������ MySQL.

2.5.1 ������������ � ������ 4.0

� ����� ������, ����� ��������� ������� �� ������ 4.1 � ����� ������:

����� ���� ����� ��������� ������ �����, �� ������� ������� �������� �������� ��� �������� �� 4.1:

�������� �������� ��� ������ ����������� ������ (.frm) ��������� � 4.1. MySQL 4.0.11 ����� ������ ����� ���� �������, �� ����� ������ ������ �� �����. ���� ��� ����� ���������� ������� � 4.1 �� ����� ������� ������ MySQL, ��� ������� ������������ mysqldump. See section 4.8.5 mysqldump, ��������� ������ ������ � ��������� �������.

2.5.2 ������������ � ������ 3.23 �� ������ 4.0

� ����� ������, ��� ��� ��� ������� ������� ��� �������� � ������ 4.0 � ����� ������:

MySQL 4.0 ����� ��������, ���� ���� �� �� ��������� ��� ����, �� � ��� �� ����� ����������� ������������ ����� ����������, ������� ������������� MySQL 4.0, � � ��� ����� ���� �������� ��� ���������� �������� � 4.1 ��� ����� ����� ��������. ������ ISAM � MySQL 4.0 ��� ��� ��������, �� �� ��� �������� ������� � ����� �������� �� ������ MySQL 5.0.

������ ������� ������ �������� � ������� 4.0 ��� �����-���� �������.

� ���� ���� �� ��������� ��� ����, �� ������� ���������� ��������� � MySQL 3.23.52 ��� ����� �����, ���� � ��� ��������� �������� � MySQL 4.0. � ���� ������ ��� ����������� ��������� mysqldump �� ���� ��������, ������������ �������������� ������� � ������������ dump �� ������ 3.23. ������� ����������� � ���, ��� MySQL 4.0 ���������� ����� ������ �������������� ��������.

��� ��������� ������ ����, �� ��� ������� �������� �������� ��� �������� � 4.0:

2.5.3 ������������ � ������ 3.22 �� ������ 3.23

� ������ MySQL 3.23 �������������� ������� ������ ���� MyISAM � ������� ���� ISAM. ������ ������� �� ��������� � �������������� ��� ������������� �� � ������ 3.23. �� ��������� ��� ����� ������� ����� ����������� � ����� MyISAM (���� �� �� ���������� mysqld � ������ --default-table-type=isam). ����� ������������� ������� ISAM � ������� MyISAM ��� ������ ������� ALTER TABLE table_name TYPE=MyISAM ��� ��� ������ Perl-������� mysql_convert_table_format.

������� ������ 3.22 � 3.21 ������ �������� � �������� ������ 3.23 ��� �����-���� �������.

���� ����������� �������, �� ������� ������� �������� �������� ��� ������������ �� ������ 3.23:

2.5.4 ������������ � ������ 3.21 �� ������ 3.22

� ������ 3.21 �� ��������� � 3.22 �� ���� ������� ������� ���������, �������� �� �������������. ������������ ��������� ������ - ��� ��, ��� ��� ����� ������, ����������� �� ��������� ���� DATE, ����� ����������� ����� ������ �������� ����. ��� ������������� ������ ������ mysqld �������� ������ � ���� ����� ����� ����� ������.

����� ��������� ������ MySQL 3.22 ���������� ��������� ����� ������, � ����� ��������� ������ mysql_fix_privilege_tables. � ���������� ����� ��������� ����� ����������, ����������� ��� ������������� ������� GRANT. ���� �� �������� ��������� ��� ��������, �� �������� Access denied ��� ������� ������������ ALTER TABLE, CREATE INDEX ��� DROP INDEX. ���� ��� ������ ������������������ (root) ������������ MySQL ��������� ������, �� ������� ������� ��� ��� �������� � mysql_fix_privilege_tables.

������� ��������� C API � ������� mysql_real_connect().���� �� ������������ ������ ���������� ����������, ���������� ������ �������, �� ���������� ������ �������� 0 ��� ������ ��������� db (��� �������������� ������ ������, ����� �������� �������� �������� db ��� ����� ������� �����������). ���������� ����� �������� mysql_init() ����� ������� ������� mysql_real_connect()! ��� ��������� ���� ��������� ��� ����, ����� ���� ����������� ����� ������� mysql_options() ��������� ����� � ��������� ����������� MYSQL.

��� ����������� � mysqld ���������� key_buffer �������� �� key_buffer_size, ������ ������ ��� ����� ������������ ��-��������.

2.5.5 ������������ � ������ 3.20 �� ������ 3.21

���� �� ��������� � ������� ����, ��� 3.20.28, � ������ ������� � 3.21, �� ���������� ������� ���������:

����� ��������� ������ mysqld ������ 3.21 � ������ safe_mysqld --old-protocol, ����� ������������ ��� � ��������� �� ������������ ������ 3.20. � ���� ������ ������� mysql_errno() ������ ������� �� ���������� ������� ��������� ������, ����� CR_UNKNOWN_ERROR (��� ������������� ��� ���������� ������), ��� ���� ������ ���������� �� �����, � ������ ������� �������� password().

���� �� �� ����������� ������������ ����� --old-protocolmysqld, �� ���������� ����� ��������� ��������� ���������:

������ MySQL 3.20.28 � ���� ����� ������������ ����� ������ ������ user ���, ��� ��� �� ���������� �� ��������. � ����� ������, ��� 3.20.28, ������� MySQL ������ ������ �� ����� �������� � ���������, ���� ������� user �������������. ��� ����������� ������� ������ �������� ������� �� ������� ���� �� ������ 3.20.28 � ����� ��������������� �� ������ 3.21.

����� ��� ������� �������� � �������� mysqld ������ 3.20.x, ��� ��� � ������ �����-���� ������� � ������� 3.21.x ����� ������������ ������ ������ 3.20.x ��� ������������� ��������� �������������� ��������.

���� �� ��������� ����� --old-protocol ��� mysqld, �� ������ ������� ������� ��������� ��������� �� ������:

ERROR: Protocol mismatch. Server Version = 10 Client Version = 9

����� ��������� Perl DBI/DBD ����� ������������ ������ ��������� mysqlperl. ������������ ���������, ������� ������� ���������� ��� ������������� mysqlperl, �������������� ��������� � ������� connect(). ������ ����������� ��������: host, database, user, � password (��������� userpassword ���������� �������). See section 8.2.2 ��������� DBI.

���� ����������� ���������, ������� ����� �������� �� ������� � ������ �����������:

2.5.6 ������������ � ���� �����������

��� ������������� MySQL 3.23 ����� ���������� ����� `.frm', `.MYI'`.MYD' ����� ���������� �������������, ��������������� ���������� ������ ����� � ��������� ������ (��� ��������, ��������� � ������������� ������, ����� �� ���� MySQL).

��������� � MySQL ����� ������ � ��������� ����� ���� ISAM (`.ISD'`*.ISM' ��������������) �������� ������������-������������, � � ���� ������� - ���������� �� ������������ �������. ��� �������� ���������� �� ��������� � ������������ ��� ������������ ��������, ������� ���������� �� ������������ �� �������� ����������, �� ������� �������� ��������� ���� ������ ����� �������� ����������� ������ �� ������ ���������. ����������� ������ ����� mysqldump.

�� ��������� mysqldump ������� ���� �� ����� ��������� SQL. ����� ����� ������ ���� ����� ��������� �� ������ ��������� � ������ ��� �� ���� ������� mysql.

��������� mysqldump --help, ����������� ��� ��������� �����. ��� ����������� ������ �� ����� ����� ������ MySQL ������� ��������� mysqldump --opt ����� ����� ������, ����� �������� ������� � ���������� �����.

����� ������� (���� � �� ����� �������) ������ ����������� ���� ������ � ���������� �� ��������� - ��������� �� ����������, ��� ����������� �������� ���� ������, ��������� �������:

shell> mysqladmin -h 'other hostname' create db_name
shell> mysqldump --opt db_name \
      | mysql -h 'other hostname' db_name

���� �� ������ ����������� ���� ������ � ���������� ���������� ����� ��������� ����, �� ����� ������������:

shell> mysqladmin create db_name
shell> mysqldump -h 'other hostname' --opt --compress db_name \
      | mysql db_name

����� ����� ��������� ��������� � �����, ����� ���������� ���� ���� �� ��������� ��������� � ��������� ���� ���� � ������������� ��� ���� ������. ��������, ����� ����������� ���� ������ � ���� �� �������� ���������� ��� �������� ����:

shell> mysqldump --quick db_name | gzip > db_name.contents.gz

(��������� � ������ ������� ���� ���������). ��������� ���� ���� � ���������� ���� ������ �� ��������� ��������� � ��������� ��� ��� �������:

shell> mysqladmin create db_name
shell> gunzip < db_name.contents.gz | mysql db_name

��� ���������� �������� ���� ������ ����� ����� ������������ mysqldumpmysqlimport. � ������ ������� ������ ��� ������� ����� ������� ������, ��� ������� ���������� mysqldump. � ��������� �������� DUMPDIR ������������ ����� ������ ���� � ��������, ������������� ��� �������� ������ �� mysqldump.

��-������, �������� ������� ��� ������ ������ � ����� ���� ������:

shell> mkdir DUMPDIR
shell> mysqldump --tab=DUMPDIR db_name

����� ��������� ��� ����� � ������� DUMPDIR ���������� ���������������� �������� �� ��������� ���������� � ��������� ��� ������ ����� � MySQL:

shell> mysqladmin create db_name # ��������  ����  ������
shell> cat DUMPDIR/*.sql | mysql db_name # ��������  ������  �  ���� ������
shell> mysqlimport db_name DUMPDIR/*.txt # ��������  ������  �  �������

������ �����, �� �������� ����������� ���� ������ mysql, ��������� � ��� �������� ������� ���������� (user, db, host). ��������, �� ����� ���������� ����� ����� ��������� ������� � �������� ������������ root MySQL, ���� ���� ������ mysql �� ������ ���� �����.

����� ������� ���� ������ mysql �� ����� ��������� ��������� mysqladmin flush-privileges, ����� ������ ������������ ���������� � �������� ����������.

2.6 ������� �� ������������ ��������

2.6.1 ���������� � Linux (��� ������ Linux)

����������� ���� ��������� � glibc ����� ������� ������ ��� ������, ����� �� ��������� MySQL ��������������. �� ������, ���� Linux �������� �� ������ � ������������ x86, ������� ����� ������������ ���� �������� �����. ��� ��������� � glibc, � ������� ��������� �������� ������� �����, � � �������� �������� ������� ����������� - ��� ��� ������� ��� ����, ����� ��������� ���� ��������� ��� ������ �� ������ ����������� �������. ������� ���� ����� ��������� ������� ������� � ��� ��������� �������� ������������ ���������� ��������, ���������� ������� ������������ �������� ����� - ��������, ��� ������������ ����� �����������. ���� �� ��������, ��� �������� ����� ��� �� ����������, �� ����� ����������� �������� ���������������� �������. �� ����� ����� ������������ �� ��������� � ���, ������ ��� �������� ���������� �� ������ � ������ �����������, - ��� ������� ��� � ��������� ��� ������� ����� ������� ������ ���������. ��� �� �������� ������� �������������, �� ��� ��� ���� ��� ���������, ������������ �� ������� ���������� ������������ ���������� �/��� ������, ������������� �� ������ ����������� � 2 ��, ���� �������� ����� ����� ��������� ��������� ������.

� ������������ ������� Linux MySQL ���������� LinuxThreads. ���� � ��� ������ ������� Linux, � ������� ����������� glibc2, �� ������ ��� ������������� ������� ���������� MySQL, ���������� ���������� LinuxThreads. �������� LinuxThreads ����� �� ������ http://www.mysql.com/downloads/os-linux.html.

����������: �� Linux 2.2.14 � MySQL, ������������� �� ����������������� (SMP) ��������, ����� ��������� ��������� ���������� ��������. � ����� ������ �� ����������� ��� ����� ������� ������� ������� ������ ���� �� 2.4: ��� ������ ������� ����� ������� � ����������.

���������� ��������, ��� ������ glibc �� 2.1.1 ������������ �������� ��������� ������ � ��������� pthread_mutex_timedwait, ������� ����������� ��� ������������� INSERT DELAYED. ������� �� ����������� �� ������������ INSERT DELAYED, ���� �� ����� ������ ������� glibc.

���� ����������� ������������ ����� 1000 ������������� ����������, ���������� ������� ��������� ��������� � LinuxThreads, ����������� �� � ������������� MySQL � ����� `libpthread.a'. ������� ��������� PTHREAD_THREADS_MAX � ����� `sysdeps/unix/sysv/linux/bits/local_lim.h' �� 4096 � ��������� STACK_SIZE`linuxthreads/internals.h' �� 256 K�.

���� ������� ������������ ��������� �������� glibc. �������, ��� MySQL �� ����� ��������� �������� ��� 600-1000 �����������, ���� ������ STACK_SIZE ��������� �� ��������� 2 M�.

���� MySQL �� ����� ������� ����������� ���������� ������ ��� ������� ����������� ���������� ����������, �� ��� ������, ��� � Linux �� ���������������� ����������� �������� ������������ ���������� ������.

� Linux 2.2 � ����� ������ ������� ����� �������� �������� ������������� ���������� ������, ������� ����� ������� ������������. ��� ����� ���������� ���������:

cat /proc/sys/fs/file-max
cat /proc/sys/fs/dquot-max
cat /proc/sys/fs/super-max

� ������, ���� �� ������ ����������� ����� 16 M� ������, � ������������ ������� (`/etc/init.d/boot.local' �� SuSE) ���������� �������� ������ ��������� ���������:

echo 65536 > /proc/sys/fs/file-max
echo 8192 > /proc/sys/fs/dquot-max
echo 1024 > /proc/sys/fs/super-max

��� ������� ����� ����� ��������� �� ��������� ������ �� ����� ������������

root, �� � ����� ������ ��� ������������ ���������� ����� �������������� ������ �����������.

�������������, �� ������ ���������� ��� ��������� ��� ��������, ��������� ������� sysctl, ������� ������������ �� ��������� �������� Linux (SuSE ����� �������� ��, ������� � SuSE 8.0). ������ �������� ����� �������� � ���� `/etc/sysctl.conf':

# ��������� ��������� �������� ��� MySQL
fs.file-max = 65536
fs.dquot-max = 8192
fs.super-max = 1024

����� ����, ���������� �������� � `/etc/my.cnf':

[safe_mysqld]
open-files-limit=8192

���������� ����� ������ �������� MySQL ��������� �� 8192 ���������� � ������.

�������� ������ ������� � �������� ������������ ��������� ��������� STACK_SIZE � LinuxThreads. �� �������� ������ ���� ���������� �������, ����� ������� ����� ����� ������� ������, �� ���������� �����, ����� ������������� ��������� ������ ��������� ������� � ������� ����� ������ mysqld. � ���������, ������� ����� ��� ������� ����������, ��� ���������� mmap() �� Linux � ������ ����������� ������� �� ��������� ������, ������� ��� ������������, ������ ����������� ��������� �� ������ ������� ����������� ��� ����� ���������� ������� � �������� ������ �� ���� ��������. ������� ������������ ������������� mysqld ��� ������ ������� ���������� ���������� ������� �� "���������������" ��������� ����, ���������� ������. ������������ ������ ������� ���� ��� ����������� ���������� ������ ���������� ����������� ������� � ����� ������ �������, ����� ����� ������� �� ������������ � ����������� ���������� �������. � ������ mysqld ���������� �������� ��� "��������������" ��������� ���������� ���������� max_connection � �������� ��������.

���� �� ��������� MySQL �������������� � �� ������ ���������� ������� LinuxThreads, �� ���������� ���������� �������� max_connections ���, ����� ��� �� ��������� 500. ��� �������� ������ ���� ��� ������, ���� � ��� ���������� ����� ����� ������, ������� ������� ����������� ���������� ������ ��� ������� ������ �������, �� ������� mysqld �������� ������� ������ ������, � ����� � ������, ���� �� ����������� ���� 2.2 � ������� ��� 2 ��. ���� ������������ ���� �������� ����� ��� RPM ������ �� ������ 3.23.25, �� ����� ��������� ������������� max_connections ������ 1500 - ��� �������, ��� ����� ������ ��� ������� ����������� ���������� ������ ����� ��������� �������. ��� ������ STACK_SIZE � LinuxThreads, ��� ������ ������� ����� ��������� �������. ������������� ���� �������� ���������� �� 128K �� 256K.

��� ������������� ��������� ������������� ���������� �� ������ ���������� �� ����� "�����������" ���� 2.2. ������ ����������� ����������� � ���, ��� ������� ���������� �� ��������� ��� ���������� �������� ��������� - ����� ������������� ����� ����������. ��� �������� � ���������� ��������������� MySQL ��� ���������� ���������� ������������� ����������. �� ����� ������, �� ���������������� ������� ��-�� ������ ����������� �������� ������� ���������� ����� ��������, ��� ����� �������� � ������� �������� ������� �� ���������� � MySQL (�� 1 ������), � ������� �� ����� ������ ���������� ����������. ��� �� �������� ����������������� ������, �� �� ��� ����������� ����������� �������� �������� �� ���� ����� ����� ��������. ���� �� �������� ����� ������� ��������, ���� �� ������������� ������� ���� � ����, ���������, ��� ���� ������� ������� ������ ��� �����. ���� �������� �� ������ http://www.mysql.com/Downloads/Patches/linux-fork.patch. �� ������� ���������� �������� ������������ ����� ����� ��� �� �������������, ��� � �� ������������ ������� �������. ���������� ����� ������� �������� ������������������ MySQL, �� ������ ��� ���� ������� �������, ������� ������ �� ����������� ��� �������������, ������� �� ��� ��� ���������� ���� 2.2 �� ������ ����������� ��������. ����� ����, ��� �������� ���� ������ � ���� 2.4, ������� ���� ��� �� ���������� ������������������ �������, ��, ��-��������, ����� ������� �� ������� �� 2.4, ��� ������������ ����� � ���� 2.2. ��� ���������� �������, ������ ����������� ���� ������, �� ����� �������� ����������� ��������������� �������������� SMP.

��� ������������ MySQL �� ���������������� ������ � ����� 2.4 �� ����������, ��� MySQL �������������� ������� ����� - ���������� ������������� ���������� ��������� �������� ������ �� 1000 ����������, � ������ ���������������� MySQL (������� ����������� ��� ��������� ������������ ������������������ � ������������������ ��� ������ � ����� ��������) �������� 180%. �������� ���������� �� ��������� �� ������������������� ������� - ����������� ���������� ���������� ��� ����� ���������� ���������� �� 1000 ��� ������� ���������������� � 300%. ������� ��� ���������� ����������� �������� �� ������������ ����������� ���� 2.4. ��������� �����, ��� ��� ���������� ��������� ������������������ �� ���� 2.4 ������ ����� ��������� mysqld � ���������� ��������� �����������. ��� ����� ������� �������� � ������ safe_mysqld ������� renice -20 $$. � ����� ������ �� ������������������� ������ ���������� ���������� ������� � ��������� ������������������ �� 60% ��� ������ 400 ��������.

� ���������� � ����� �� ������ ���������� ������ ���������� � ������������������ MySQL � ����� 2.4 �� �������- � ������������������ ��������. ���� � ��� ���� ������ � ����� �������� � �� ����������� �� ������������������, ����������, ��������� ��������� � ������������ �� ������ docs@mysql.com - �� ������� ��� ���������� � ������������.

���������� ��� ���� �����, ������� �������� �� ������������������

MySQL, �������� �� ����������������� ��������. � LinuxThreads � glibc-2.1 ����� ����� ����������� mutex'� ��� �������� �� ���������� �������, � ������� mutex �������� ����������������� �����. �������������, �� ����: � ������, ���� �� ����������������� �������� ������� MySQL � ������������������� LinuxThreads, �� ��� �������� ���������� �� ����� ��� ������������� ������������������. ��� ������� ���� �������� �� ���������� ���� � glibc 2.1.3 http://www.mysql.com/Downloads/Linux/linuxthreads-2.1-patch.

glibc-2.2.2 MySQL ������ 3.23.36 ���������� ���������� mutex, ������� ������� ����� ���� ``����������'' � glibc-2.3.1. ������ �������������, ��� ��� ��������� �������� ��� mutex'� � glibc-2.2.2 "�������������" (overspin), � ��� �������� ������������������ MySQL. ����� ������������� ������ ������� ����� ��������, ���� �������� ��������� ���������� mysqld. ����� ����� ��������� "������������" � ������� �����, ���������� �� ������ http://www.mysql.com/Downloads/Linux/linuxthreads-2.2.2.patch. �� �������� � ���� ��������� "������������", ������������ ���������� ������� � ������� ����� - ��� ������. ���������� ��������� ��� � �������� linuxthreads �������� patch -p0 </tmp/linuxthreads-2.2.2.patch. �� ��������, ��� ������ ���� ����� � ��������� ���� ������� � ��������� ������� glibc-2.2. � ����� ������ - ���� �� �������� � �������������� ���������� glibc-2.2.2, �� ���� ��� ���������� ���������� STACK_SIZEPTHREAD_THREADS_MAX. �� �� ������ �������, ��� � ������� �������� �� ��������� ����� ��������� � ����� ���������� ��� ������ ���������� ������������ MySQL ���������, ��� ��� ��������������� ������ �������� � ���������� ./configure; make; make install.

�������������� ����� �� ����������� ������������ ������ ��� �������� ����������� ����������� ������ `libpthread.a', � ��������� - ��������� ������ ��� ������������ ���������� MySQL. �� �������, ��� ��� MySQL ��� ����� ��������� � ������� �������� ��� ������������������, �� ������������ ������ ���������� ������ ���. ������ ������ ���������� � ``���������'' ������� ���������� ��� ������� �� ������������ ������ � ������������ �� �� ���� �������, �� ��������� ����� �� ���� �� ��������� � ������ �����������, ������������ LinuxThreads.

� ������, ���� ��� �������� ����������� � ����������� ���������� ��� ����������� MySQL ��� ��� ������ ������, �� �������, ��������� �����, ������� � ������������ ��� ������������. � ����� ������ �������� ������ ������ ������������� ����� �������� ������.

���������� ���� ��������� �������� � �������� �������������, ���������� ������ ������ Linux, � ������� ������������ libc (����� ��� RedHat 4.x ��� Slackware). ��� ����������� � ���� ��������� ����������� ������� � ����������� ���� (see section 2.6.1.1 ���������� � �������� ������������� Linux).

��� ������������� LinuxThreads ������������ �������� ��� ������� ��� ��������. �� ���� ��� ������. ���� ����� ��������� LinuxThreads, ���� - ������������ ���������� � ��� ���� - ������������ ��������� �������.

�������, ��� ���� Linux � ���������� LinuxThreads �� ��������� ����� ������������ ������ 1024 ������. ��� ������, ��� ����� ������������ �� ����� 1021 ���������� � MySQL �� �������, � ������� �� ����������� �����. ���������� � ���, ��� ������ ��� �����������, ����� ����� �� �������� http://www.volano.com/linuxnotes.html.

���� �� ���������� ������ ������� ps �� ������, ��� mysqld ��������� ������,

�� ������ �������� ����� �������� ���� ����������� ������ � MySQL, ���� ����������� ������� (see section A.4.1 ��� ������, ���� ������ MySQL �������������� ����������� ������).

���� ��� ��������� ������� SIGSEGV mysqld ������ �������, �� ��� ��������� ������ ������ (core dump) �� Linux ����� ��������� mysqld � ������ --core-file. �������, ��� ��� ���� ���, ��������, �������� ��������� ������ ����������� ������ ����� ������ ������ ����� ���������� ������ ulimit -c 1000000safe_mysqld ��� �������� safe_mysqld � ������ --core-file-size=1000000 (see section 4.7.2 safe_mysqld, �������� mysqld).

���� ��� ���������� ������������ MySQL-������� �������� ������:

ld.so.1: ./my: fatal: libmysqlclient.so.4:
open failed: No such file or directory

�� �������� ����� ������ ����� �� ��������� ��������:

���� �� ����������� ���������� Fujitsu (fcc / FCC), �� �������� ��������� �������� ���������� MySQL ��������� ��������� � Linux � ������������ ������� ������������� �� gcc.

������ ������������ ������ �������� � fcc/FCC:

CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE \
-DCONST=const -DNO_STRTOLL_PROTO" CXX=FCC CXXFLAGS="-O -K fast -K lib \
-K omitfp -K preex --no_exceptions --no_rtti -D_GNU_SOURCE -DCONST=const \
-Dalloca=__builtin_alloca -DNO_STRTOLL_PROTO \
'-D_EXTERN_INLINE=static __inline'" ./configure --prefix=/usr/local/mysql\
--enable-assembler --with-mysqld-ldflags=-all-static --disable-shared \
--with-low-memory

2.6.1.1 ���������� � �������� ������������� Linux

��� ������ MySQL ��������� Linux ������ �� ���� 2.0.

��������������: �� ������, ���������� ���� �� ��������� ������������� MySQL, �� Linux � ����� 2.2.14 ������� ��������� �������� � ������������� ������ MySQL. ���� �� ����������� ��� ����, ���������� �������� ��� �� ������ 2.2.19 ��� ����, ���� �� ���� ������ 2.4. ��������� � ������ 2.4 ���������� ��� ����� �������� ��� ������������� ����������������� �������, ��������� ������� �� ��� ������ ���� �������� � ��������� ���������� ��������.

��� �������, �������� ����������� ��������� � ������ -static, � ��� ������, ��� ������ ��� ������������� ������������ � ���, ����� ������ ��������� ��������� � ��� �����������. �� ��������� ����� ������������� LinuxThreads. ������ ���������, ������������ � ������ -static, ������ ������ � ��������� � �������, ��������� �����������, ������ �������� ������ � ��� ���� (3-5%). ����������, ������, ���� ��������. ��� ����������� � ���, ��� �� ���������� ������������� ����������� ���������� ������������ ������������ ������������� ������� (user-definable function, UDF). ���� �� ����������� ������ ��� ������������ UDF'� (��� ����������, ���������� ������ ������������� �� C ��� C++), ��� ������� ��������������� ������� MySQL � �������������� ������������� ����������.

��� ������������� ������, ������������ �� libc (� ������� �� glibc2-������), ����� ��������� ��������� �������� � ����������� ���� ��������� ����������� � �������������� getpwnam() � �������� ������� (��� ���������� ��-�� ����, ���, � ���������, glibc ������� �� ��������� ������� ��������� ��� ���������� ���� � ������������� getpwent(), ���� ��� ������ � ������ -static). � ����� ������ ��� ������� mysql_install_db �������� ��������� ���������� ��������� �� ������:

Sorry, the host 'xxxx' could not be looked up

��� �� - ��� ������� mysqld � ������ --user - ��������� �� ������ ����� ���� �����:

getpwnam: No such file or directory

��� �������� ����� ������ ����� �� ��������� ��������:

RPM � �������� ����� MySQL ��� Linux �� ����������� Intel �������������� ��� ���������� ���������� ��������� �������� ������. �� ������ ��������� ������������ �����������, ������� ���� �������� ������� � ���������� ���.

��������� Perl � MySQL ������� Perl ������ �� ���� 5.004_03.

�� ��������� Linux ������ 2.2 ��� ������� ������� ������� ���������� ����� ���������� � �������� mysqld ����� TCP/IP �� ������ �������� ��������� �� ������ Resource temporarily unavailable (������ �������� ����������).

�������� ����������� � �������� ����� ��������� ������ TCP/IP � �������� ��� ������������� �������� � Linux. ��������� ���������� ������������ ���������� �������� ��� ��������� TCP/IP, �� �������� ������������� ������, ���� ����������� ������� ������� ����� ����� ���������� TCP/IP �� ���������� ��������� ������� ������� (����� �������� ���������� ��� ������� ����� �� ������������������ MySQL `test-connect' ������ TCP/IP).

�� ���� �������� �� ��������� ��� �������� � ��������� ������ �������� �� Linux, ������ �������� ������� �������� �� �������.

������������ ��������� '�������' ������ �������� ����������� � ���, ��� ���� ������� ������ �������� � ����������� ������������ ��� ������������ ������ (� ������, ���� ���������� � ��������� ����� ��������� �� ����� ������). �������� ���������, ��� ��� �������� ����� ������ � ���� Linux 2.4.

2.6.1.2 ������� �� ������ Linux x86

��� MySQL ���������� ������� libc ������ 5.4.12 ��� ����. ��������, ��� MySQL �������� � libc 5.4.46, � ����� � glibc ������ 2.0.6 � ����� ������. ���������� ��������� �������� � glibc �� ������� � RedHat, ������� � ������ ������������� ������� ������� ���������, ��� �� ���������� ������ ������! ��������, ��� glibc �� RPM ������ 2.0.7-19 � 2.0.7-29 ��������������.

���� �� ����������� Red Hat 8.0 ��� ����� glibc 2.2.x ��� ������� ��������� mysqld � ������ --thread-stack=192K. ���� �� ����� �� ��������, �� mysqld ����� ������� � gethostbyaddr() ������ ��� ����� glibc ������� > 128����� ������ ����� ��� ����� ������. ����� ������ ����� ���������� �� ��������� � MySQL 4.0.10 � ����� �����.

��� ������������� ��� ������ MySQL gcc 3.0 � ���� ���������� libstdc++v3 ���������� ���������� �� ������; ���� �� �� �������� �����, �� �������� ��������� �� ���������� ������� __cxa_pure_virtual �� ����� ����������!

�� ��������� ������ ������� Linux configure ����� ��������� � ������� ������ ����:

Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file.
See the Installation chapter in the Reference Manual.

�������� ������ ��, � ��� ��������� � ��������� �� ������ - �������� �������������� ������ ������������� � ����� ������� _P, ������� ����� ������ ���� ������ ������������� � ������, � ���������� ��������� �� �� �������� ��� ���.

��� ���������� ����� ���������� ��������� ��������������. ���� ��������� �� �� ���, ������� ����� ���������������:

mysqld.cc -o objs-thread/mysqld.o
mysqld.cc: In function `void init_signals()':
mysqld.cc:315: warning: assignment of negative value `-1' to `long unsigned int'
mysqld.cc: In function `void * signal_hand(void *)':
mysqld.cc:346: warning: assignment of negative value `-1' to `long unsigned int'

mysql.server ��������� ���� � �������� `share/mysql' �������� ����������� MySQL, ���� � �������� `support-files' �������� ������ �������� ������� MySQL.

������������� ��������� ������ ��� ���������� mysqld ������� � ������������ ��������� libg++.a:

/usr/lib/libc.a(putc.o): In function `_IO_putc':
putc.o(.text+0x0): multiple definition of `_IO_putc'

������������� libg++.a ����� �������� ����� ������� configure ��������� �������:

shell> CXX=gcc ./configure

2.6.1.3 ���������� � Linux SPARC

� ��������� ������� Linux SPARC ��������� ������� readdir_r(). ��� ����������� � ���, ��� SHOW DATABASES ������ ���������� ������ �����. �������� ����� ���� ������ ��������� HAVE_READDIR_R �� `config.h' - ��� ����� ������ ����� ����������������, �� �� ����������.

2.6.1.4 ���������� � Linux Alpha

MySQL ������ 3.23.12 - ������ ������ MySQL, ���������������� �� Linux-Alpha. ������� ���� �� ����������� ������������ MySQL �� Linux-Alpha, ������� ������ ����� ���������, ��� �� ����������� ���� ��� ������, ���� ����� ������.

�� ����������� MySQL �� Alpha ��� ������ ����� ������ �� ������������������ � ��� �������� �����������.

��� ���������� ����������� �������� ������ MySQL �� ������������ SuSE 7.0 ��� AXP � ����� 2.4.4-SMP, ���������� Compaq C (6.2-505) � ���������� Compaq C++ (6.3-006) �� ���������� Compaq DS20 � ����������� Alpha EV6.

�������������� ���������� ����� ����� �� http://www.support.compaq.com/alpha-tools/. ������������� ����� ����������� ������ gcc ������� � ��������� ������������������ MySQL �� 9-14%.

�������, ��� �� ������ MySQL 3.23.52 � 4.0.2 �� �������������� ����������� ����� ������ ��� ������������ ������ ���������� (��������� ����� ���������� -fast); ��� �������� ��� �� ������ ������������ ���� �������� ����� ������ ���� � ��� ��������� Alpha EV6.

��� ���� ��������� ������ �� �������� ���� -arch generic � ����� ������ ����������, ��� ��������� �������� ��������� ����� �� ���� ����������� Alpha. �� ����� �������� MySQL ���������� - �� ��������� �������.

CC=ccc CFLAGS="-fast -arch generic" CXX=cxx \
CXXFLAGS="-fast -arch generic -noexceptions -nortti" \
./configure --prefix=/usr/local/mysql --disable-shared \
--with-extra-charsets=complex --enable-thread-safe-client \
--with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shared

���� �� ������ ������������ egcs, �� � ��� ����������� ��������� ��������� ������ ����������������:

CFLAGS="-O3 -fomit-frame-pointer" CXX=gcc \
CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors \
-fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql \
--disable-shared

��������� ��������� �������� ��� ������� MySQL �� Linux-Alpha:

2.6.1.5 ���������� � Linux PowerPC

MySQL ������ �������� �� MkLinux ��� ������� ������ ������� ������ glibc (��������� � glibc 2.0.7).

2.6.1.6 ���������� � Linux MIPS

��� ���� ����� MySQL ������� �� Qube2 (Linux Mips), ���������� ����� ������ ������ ���������� glibc (��������, ��� MySQL �������� � glibc-2.0.7-29C2). ������ �����, ������� ������������ ���������� egcs C++ (egcs-1.0.2-9, gcc 2.95.2 ��� ����).

2.6.1.7 ���������� � Linux IA64

��� ���������� MySQL �� Linux IA64 �� ��������� ��������� �������

����������������: ������������ gcc-2.96:

CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc \
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors \
-fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql \
"--with-comment=Official MySQL binary" --with-extra-charsets=complex

�� IA64 �������� ����� MySQL-������� ���������� ������������ ����������. ��� ������, ��� ��� ��������� ������ ��������� ������������ ����-����, ����� `/usr/local/mysql', ���������� ���� �������������� `/etc/ld.so.conf', ���� �������� ���� � ��������, � ������� ��������� `libmysqlclient.so', � ���������� ��������� LD_LIBRARY_PATH.

See section A.3.1 �������� ��� ���������� � ���������� ����������� MySQL.

2.6.2 ���������� � Windows

� ������ ������� ����������� ������������� MySQL � ����� Windows. ��� ���������� ����� ��������� � ����� `README', ������������ � ������������� MySQL Windows. See section 2.1.2 ��������� MySQL �� Windows.

2.6.2.1 ������ MySQL �� Windows 95, 98 ��� Me

� MySQL ��� ���������� ������� � �������� ������������ TCP/IP (��� ������������ ��� ������ ���������� � ���� ����������� ����������� � ����� MySQL-��������). ������� TCP/IP ���������� ���������� �� ������ �� ������� MySQL. TCP/IP, � ���������, ������� �� CD-����� � ������������� Windows.

�������� ��������: ���� �� ����������� ���� �� ������ �������� Windows 95 (�������� OSR2), �� ������ ��������, ��� � ��� ���������� ������ ����� Winsock; � ��� ������ MySQL ��������� Winsock 2! ����� ������ ������ Winsock ����� �������� �� ������ http://www.microsoft.com/. Windows 98 �������� ����� ���������� Winsock 2, ������� ������ ��������� � ��� �� ���������.

��� ������� mysqld ���������� ������� ���� MS-DOS � ���������:

C:\> C:\mysql\bin\mysqld

��� �������� ��������� mysqld � ������� ������ ��� ����.

������ MySQL-������� ����� ���������� ��������:

C:\> C:\mysql\bin\mysqladmin -u root shutdown

��� ����� ��������� ����������������� MySQL �� ����� ������������ root, ������� �� ��������� ������������� ������������ Administrator � ������� ���������� MySQL. �������� ��������: ������� ���������� MySQL ��������� ���������� �� �����-���� ��������� ������������� � ����� Windows.

�������, ��� � Windows 95/98/Me �� �������������� �������� ����������� �������. ����� �������, ����������� ������ �� ������ ������������ ��� ���������� � MySQL-��������, ���������� � ������� Windows NT/2000/XP. (����������, MySQL-������ ����� ������ ������������ ����������� ������. ��������, ��� ������ mysqld-opt � ������� NT/2000/XP ������ ��������� ���������� � �������������� ����������� �������; ������� ��������� ���� mysqld-nt, ���� mysqld-max-nt.)

���� mysqld �� �����������, ������� ��������� ���� `\mysql\data\mysql.err', �� ������� �������, ��������� ��������, - ��� �������� ���������� ������, ��������� ��������. ����� ����� ����������� ��������� ������ �������� mysqld --standalone; � ���� ������ �� ����� ����� ���������� ��������� �������� ����������, ������� ����� ������ ������ ��������.

� �������� ��������� ������� ����� ����������� ��������� mysqld � ������� --standalone --debug. � ���� ������ mysqld ����� �������� ������ � ���� ������� `C:\mysqld.trace'. ��������, �� ����������� ����� ����� �� ������� ���������� �������, �� ������� �� ����������� mysqld. See section E.1.2 �������� �������������� ������.

��� ������ ���� ������, ������� ``��������'' mysqld, ����������� ������� mysqld --help.

2.6.2.2 ������ MySQL �� Windows NT, 2000 ��� XP

��� ���� ����� MySQL ������� � TCP/IP �� Windows NT 4, ���������� ���������� Service Pack 3 (��� ����)!

������ MySQL ��������������� �� Windows NT/2000/XP ��� ������. � ������, ���� ������ ��� ��������, ���������� ������� ��������� ��� ������ ��� ������ ��������� �������:

C:\mysql\bin> mysqladmin -u root shutdown

��� ����� ��������� ����������������� MySQL �� ����� ������������ root, ������� �� ��������� ������������� ������������ Administrator � ������� ���������� MySQL. �������� ��������: ������� ���������� MySQL ��������� ���������� �� �����-���� ��������� ������������� � ������� Windows.

������ ��������� ������ �������:

C:\mysql\bin> mysqld-max-nt --install

���� ��������� �����-���� �����, ��� ������ ���� ����������, ��� ``Start parameters'' � ���������������� ��������� Services ������� Windows ����� �������� ������� MySQL.

������ � ���������������� ��������� Services (Windows Service Control Manager) ����� �������� � Control Panel (� Administrative Tools � Windows 2000). ������������� ��������� Services ��� ���������� �������� --instal ��� --remove - ��� ������������ ������������� ��������� ������ ����������� �������.

�� ����������� � ���, ����� �������� ����� ������� ������������ ��� ������� �������, ����������� � ������� See section 2.1.2.2 ���������� ������������ MySQL ��� Windows.

�������, ��� ������� � ������ 3.23.44 MySQL ������� ����������� �������������� ��������� ������� - � ������ Manual (���� ��� �� ��������� �������������� ������ ������� ��� �������� ������������ �������):

C:\mysql\bin> mysqld-max-nt --install-manual

������ ��������������� ��� ������ MySQL. ����� �� ����� ��������� �� ����� ���� ������� ��� ������ ���������������� ��������� Services ��� �������� NET START MySQL.

����� ������� ������ mysqld-max-nt ����� ���� ��������� ��� ������ mysqladmin �� ���������������� ��������� Services ��� �������� NET STOP MySQL.

���� MySQL ������������� � �������� �������, �� ������������ ������� ������������� ��������� ������ MySQL-������� ��� ����������� ���������� ������ ����������. � ������� MySQL < 3.23.47 Windows ������� ����� ���� ��������� ������ ���������� ���������, ����� ���� ���������� ������� ������� ���� ������, ���� ��������� ����� �������� (��� ����� ���� ������������� �������� ������������� �������). ��������, ��� ��������� ������� ���������� ������� InnoDB ������ ��������� �������������� ����� ���������� ����������. ������� � MySQL ������ 3.23.48, Windows ������� ���������� �������� MySQL-������� ������. ���� �� ��������, ��� ����� ������� ��� ����� ������ ������������, ���������� ��������� MySQL-������ �� ��� ������, � �� ��������� ������ � ��������� ��� ������ �������� mysqladmin shutdown.

� Windows NT (�� �� � Windows 2000/XP) ���������� ��������, ������� ����������� � ���, ��� ������� �� ��������� ������� ��������� ������ ������� ������ 20 ������, ����� ���� ���������� ������� �������. ��� �������� �� ��������� �������� ����� ��������� � ������� ��������� Registry (�������), �������� `\winnt\system32\regedt32.exe' � �������������� �������� WaitToKillServiceTimeout � ������ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control. ������� ������ ������, ������� �������� � �������������, �������� 120000, ����� Windows NT ������� 120 ������.

���������� ��������, ��� ��� ������ � �������� ������� mysqld-max-nt �� ����� ������� � �������, � �������������, ���������� ������� ��� ���������. ���������� �� ������� ��������� � ����� `c:\mysql\data\mysql.err'.

���� �� ����������� � ���������� ��������� mysqld-max-nt � �������� �������, ���������� ��������� ��� � ��������� ������� ����:

C:\> C:\mysql\bin\mysqld-max-nt --install

���� ��� �� �������, ����� ��������� mysqld-max-nt ���������� ��������������� �������, �������� ���� � Registry!

���� �� �� ������ ��������� mysqld-max-nt � �������� �������, ��� ����� ��������� ��������� �������:

C:\> C:\mysql\bin\mysqld-max-nt --standalone
���
C:\> C:\mysql\bin\mysqld --standalone --debug

� ������ ���������� �������� �� �������� ���������� ���������� � `C:\mysqld.trace'. See section E.1.2 �������� �������������� ������.

2.6.2.3 ������ MySQL � ����� Windows

MySQL ������������ TCP/IP �� ���� Windows-�������� � ����������� ������ � ����� NT/2000/XP. �� ��������� MySQL ���������� ����������� ������ ��� ���������� � ��������� ������� � ����� NT/2000/XP � TCP/IP - �� ���� ��������� �������, ���� �� ���������� ������ ���������� TCP/IP. ��� ������ ���������� ������������ ��������:

��� ������ ��������
NULL(�����������) �� NT/2000/XP �������� ���������� ���������� ����� ����������� ������; ���� ��� �� ��������, ������������ TCP/IP. �� 9x/Me ������������ TCP/IP.
. ����������� ������.
localhost ���������� TCP/IP � ��������� �������
��� ��������� ������ TCP/IP

����� ��������� MySQL-������� ������������ ����������� ������, ������� �������� ����� --pipe ��� ������ . � �������� ����� ������ ��� ����������. ��� ����������� ����� ������ ����������� ����� --socket. � MySQL 4.1 ��� ������� ������������ ����� --protocol=PIPE.

�������, ��� ������� � ������ 3.23.50 ����������� ������ ����������� ������ � ������, ���� mysqld ������� � ������ --enable-named-pipe. ��� ������� ���, ��� � ��������� ������������� ���������� ����������� ������� ��������� � ����������� ������ ������� MySQL.

��� �������� ����������������� MySQL ����� ��������� ��������� �������:

C:\> C:\mysql\bin\mysqlshow
C:\> C:\mysql\bin\mysqlshow -u root mysql
C:\> C:\mysql\bin\mysqladmin version status proc
C:\> C:\mysql\bin\mysql test

���� ��� ������ mysqld �� �������� ���������� ��� Windows 9x/Me ��������� ��������, �� ���, ������ �����, ������� ���������� � ����� DNS. � ����� ������ ������� ��������� mysqld � ������ --skip-name-resolve � � �������� ���������� MySQL ������������ ������ localhost � IP-������. �������� ������ � DNS ��� ���������� � MySQL-�������� mysqld-nt, ���������� ��� NT/2000/XP, ����� ����� ���������� ����� --pipe, ������� ������ ������������� ����������� �������. ��������� ���� ����������� ��� ����������� �������� MySQL.

���������� ��� ������ ��������� ������ � MySQL �� ��������� ������:

�������� ���� ��������
mysql ������ ``�������'' ���������� Windows, ������������ ������ ������������ ����������� �������������� ������.
mysqlc ������ � �������������� ����������� � ��������� Cygnus GNU, ������� ������������ �������� readline.

���� �� ������ ������������ `mysqlc.exe', ������� ���������� ����������� `C:\mysql\lib\cygwinb19.dll' � ��������� ������� Windows (`\windows\system' ��� � ������ ����������� �����).

�� ��������� ���� ������������� Windows ��������������� ������ ����� ������� �� ���� ����� ������ ��� ����� ������. ����� ���������� ������� ������������ MySQL, ���������� ������ ������ ��� ������� ������������ � ������� ������ � ������� mysql.user, ���������� Host='localhost'User=' `.

���������� ����� ���������� ������ ��� ������������ root. ����������� ���� ������ ���������� � �������� ����������� ���������� �������, ������� ����� ���� ����������� ����� ������������� ��� ��������� ������ ��� ������������ root:

C:\> C:\mysql\bin\mysql mysql
mysql> DELETE FROM user WHERE Host='localhost' AND User=' ';
mysql> QUIT
C:\> C:\mysql\bin\mysqladmin reload
C:\> C:\mysql\bin\mysqladmin -u root password your_password

���� �� ������ ���������� ������ mysqld ����� ����, ��� ���������� ������ ��� ������������ root, ����� ������������ �������:

C:\> mysqladmin --user=root --password=your_password shutdown

���� � ��� �������� ������ ������������� ������ MySQL 3.21 ��� Windows, ��������������� ������� �� ���������� � �������� � ��������� �� ������: parse error near `SET password'. ��� ������� ���� �������� ������� ��������� �������� � ���������� �� ��������� ��������� ��������� ������ MySQL.

� ������� ������ MySQL �� ������ ����� ��������� ����� ������������� � �������� �� ���������� ��� ������ ������ GRANTREVOKE (see section 4.3.1 ��������� ������ GRANTREVOKE).

2.6.2.4 ���������� � MySQL �� ��������� ������ ��� Windows � �������������� SSH

� ���� ������� ��������� ��������� ������������ ��������� ����������� ���������� � ��������� MySQL-�������� � �������������� SSH. ������� ���� ��������� �������� ����� ������� (David Carlson) - dcarlson@mplcomm.com:

� ���������� ���� �������� �� ������ �������� ODBC-���������� �� ����� MySQL-��������, ���������� ��� ������ SSH-�����������.

2.6.2.5 ������������� ������ � Windows ����� ����������� ���������� �������

������� � MySQL ������ 3.23.16 ������� mysqld-maxmysql-max-nt � ������������ MySQL ������������� � ������ -DUSE_SYMDIR. ��� ������������ ����������� ������������� ���� ������ �� ������ ����� ����� ���������� ������������� ������ �� ��� (������� ����, ��� �������� ������������� ������ � Unix).

� Windows ��� �������� ������������� ������ �� ���� ������ ��������� ����, ���������� ���� � ��������, �� ������� ��������� ������. ���� ���� ����������� � �������� `mysql_data' ��� ������ `database.sym'. �������, ��� ����� ������������� ������ ����� �������� ������ � ������ ���������� �������� `mysql_data_dir\database'.

��������, ���� ������� ������ MySQL ��������� � `C:\mysql\data', � �� ������ ���������� ���� ������ foo � �������� `D:\data\foo', ���������� ������� ���� `C:\mysql\data\foo.sym', ���������� ����� `D:\data\foo\'. ����� ����� ��� �������, ����������� � ���� ������ foo, ����� ����������� � `D:\data\foo'.

�������, ��� ��-�� ������ � �������� ��� �������� ������ ������� � MySQL �� ���������� ������������� ������������� ������ �� ���������, ���� ���� �� ������� MySQL � ���������� ������ �����������. ����� ���������� ����������� ���������� ������������� ������, �� ������ ��������� � ���� ���� `my.cnf' ��� `my.ini' ��������� ������:

[mysqld]
use-symbolic-links

� MySQL 4.0 ������������� ������������� ������ �� ��������� ����� ��������. ���� �� ������ ��������� ��� �����������, �� ��� ������ ������ MySQL ���������� ������������ ����� skip-symlink.

2.6.2.6 ���������� MySQL-�������� � ����� Windows

� ������ �������� ������� ������� ����� `mysql.h' �������� `windows.h':

#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#endif
#include <mysql.h>

��������� ���� ��������� ����� ���� � �������������� ������������ ���������� `libmysql.lib', ������� �������� ������ ��������� ��� �������� `libmysql.dll' �� ����������, ���� �� ����������� ����������� `mysqlclient.lib'.

�������, ��� ��������� ���������� mysqlclient ������������� ��� ��������� ����������, ������� �������������� ���� ��������� ���, ����� ���� ��������� �������������!

2.6.2.7 ������������� �������������� MySQL ��� Windows � ��� Unix

�� ��������� ������ ������ MySQL ��� Windows ��������������� ���� ��� ������ ����������. ����������� ���� ������ � ������ ��� Unix ����������, �� ����������� ��������� ��������:

Windows 95 � ������
��� �������� ������� ������ � Windows 95 �������� �������������� 200 ������ �������� ������. � ��������� ������ ���������� � MySQL ������� ����� �����, �� Windows 95 �� ������� ��������� mysqld �� ��������������� �����, ���� ��� ������ ������������ ����� ����������! ������ ������ Windows �� ���������� ���� ������.
������������ ������
��� ��������� ��������� �������� SELECTINSERT � MySQL ������������ ������� pread()pwrite(). � ��������� ����� ��� �������� pread()/pwrite() �� ��������� mutex'�. ������ � ���� ����� �� ������� ������ ������ ���������� ��������� ������ ����������� �����������, ����� ����� ����������� ������������ ��������� readfile()/writefile() �� NT/2000/XP - � ����� ��������� ������. � ������� ���������� ����� ������������ �������� � MySQL ������ �� ����� ���� ������ 1024; ��� ��������, ��� �� �� ������� ������� ����� �� ���������� ������������� ���������� � MySQL � NT/2000/XP, ��� � Unix.
������ � �����������
� MySQL ��� ������� ���������� ������������ ������ � �����������. ��� ��������, ���: ������������� �������� �� ��������� ������, ����� ���� ������������ ��� Windows ��������� ������� ������ �� �������.
DROP DATABASE
������ ������� ���� ������, ���� ��� ������������ �����-���� �������.
��������� MySQL �� ���������� �����
� Windows 95 ������ ���������� MySQL �� ���������� ����� ��� � ������� ���������������� ��������� shutdown; ��� ����� ������� � ������� mysqladmin shutdown.
�����, �� ��������� �� �������� ��������
����� ������ � Windows �� ������� �� �������� ��������, ������� ����� ������ � ��� ������ � MySQL ��� Windows ����� �� �������� �� ��������. ������������ ����������� ����������� � ���, ��� ����� ��� ������ � ������ � �������� ������ ��������� ������ ���������� � �������������� ����������� �������� �������� (see section 6.1.3 ���������������� ���� � ��������).
������ ��������� `\'
���������� ����� � Windows 95 ����������� �������� `\', ������� ����� �������� �������� ������������� � MySQL. ���� �� ����������� LOAD DATA INFILE ��� SELECT ... INTO OUTFILE, ������ `\' ���������� ������� ������:
mysql> LOAD DATA INFILE "C:\\tmp\\skr.txt" INTO TABLE skr;
mysql> SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
� �������� ������������ ����� ������������ ����� ������ Unix-�����:
mysql> LOAD DATA INFILE "C:/tmp/skr.txt" INTO TABLE skr;
mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
������ can't open named pipe (���������� ������� ����������� �����)
��� ������������� MySQL ������ 3.22 �� NT � ����� ������ �������� mysql ����� �������� ��������� ��������� �� ������:
error 2017: can't open named pipe to host: . pipe...
��� ���������� ��-�� ����, ��� � ������ ������ MySQL �� NT ����������� ������ ����������� �� ���������. ����� �������� ����� ������, ������� ������������ � ����� �������� MySQL ���� --host=localhost ��� ������� ���� ������ `C:\my.cnf', ���������� ��������� ������:
[client]
host = localhost
������� � ������ 3.23.50 ����������� ������ ������������ ������ � ������, ���� mysqld ������� � ������ --enable-named-pipe.
������ access denied for user (������ ������������ ��������)
���� �� �������� ��������� �� ������ Access denied for user: `some-user@unknown' to database `mysql' ��� ������� ������� � MySQL-�������, ������������ �� ��� �� ������, � ������� ���������� ������, ��� ������, ��� MySQL �� ����� ��������� ���������� ����� ����� ������. ��� ������� ������ �������� ������� ������� ���� `\windows\hosts', ����������:
127.0.0.1 localhost
ALTER TABLE
��� ���������� ��������� ALTER TABLE ������ � ������� ��� ������ ������� �����������. ������ ������� Windows �� ����� ������� ����, ������� ������������ ������ ������� (��������, � ������� �� ������ �����-������ ������ ������ ��� ��������). ���������� DROP TABLE ��� ��������, �������� � ������ ������� ������� MERGE, �� ����� �������� � Windows, ��� ��� ����������� �������, ������� ��������� ���������� MERGE, ������ �� �������� ������ MySQL. ��������� � Windows ������ ������� �������� �����, ������� ������� �������� ��� MERGE-������� (��������� FLUSH TABLES) ��� ������� ��� MERGE-������� ����� ��������� �������. �� �������� ��� ������ ������������ � ��������� ��������� VIEW. ��������� DATA DIRECTORYINDEX DIRECTORYCREATE TABLE � Windows ������������, ��������� Windows �� ������������ ������������� ������.

���� ��������� ��������� �������� ������� ��� ����, ��� ������� ������ ��� � ������ ��� ��������� ��� Windows:

2.6.3 ���������� � Solaris

� ������� Solaris �������� ������������ ��� ��� �� ���������� ������������ MySQL! ��������� tar � Solaris ``�� �����'' �������� � �������� ������� ������, ������� ��� ������� ����������� MySQL �� ������ ������� ��������� �� ������, �������� ����������:

x mysql-3.22.12-beta/bench/Results/ATIS-mysql_odbc-NT_4.0-cmp-db2,\
informix,ms-sql,mysql,oracle,solid,sybase, 0 bytes, 0 tape blocks
tar: directory checksum error

� ���� ������ ��� ���������� ������������ ���������� ������������ GNU-������ ��������� tar (gtar). ���������������� ������ ������ ��������� ��� Solaris ����� ��������� � http://www.mysql.com/downloads/os-solaris.html.

����������� ������ Sun �������� ������ ������� � ������ Solaris 2.5. ��� ������ 2.4 � ����� ������ MySQL ������������� ���������� MIT-pthreads (see section 2.3.6 ��������� �� ������� MIT-pthreads).

��������� ��������� �� ������ ������������:

checking for restartable system calls... configure: error can not run test
programs while cross compiling

��������, ��� ����� ����� �����-�� ������ � ��������� �����������! � ���� ������ ���������� �������� ��� ���������� �� ����� ������ ������. ��� �������� ����� ����� ������, ������� � ���� `config.cache' ��������� ������:

ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'}

��� ������������� Solaris �� SPARC �� ����������� ���������� gcc 2.95.2. ��� ����� �������� �� ������ http://gcc.gnu.org/. �������, ��� egcs 1.1.1 � gcc 2.8.1 �������� �� SPARC ���������!

������������� ������ ��� configure ��� ������������� gcc 2.95.2:

CC=gcc CFLAGS="-O3" \
CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler

���� ������������ UltraSPARC, �� ��� ���������� ������ "-mcpu=v8 -Wa,-xarch=v8plusa" � ���������� CFLAGS � CXXFLAGS ����� �������� ��������� ������������������ �� 4%.

��� ������������� ����������� Sun Fortre ������ 5.0 (��� ����) ����� ��������� configure ��������� �������:

CC=cc CFLAGS="-Xa -fast -xO4 -native -xstrconst -mt" \
CXX=CC CXXFLAGS="-noex -xO4 -mt" \
./configure --prefix=/usr/local/mysql --enable-assembler

����� ������� 64-��������� ����������� ��� � �������:

CC=cc CFLAGS="-Xa -fast -native -xstrconst -mt -xarch=v9" \
CXX=CC CXXFLAGS="-noex -mt -xarch=v9" ASFLAGS="-xarch=v9" \
./configure --prefix=/usr/local/mysql --enable-assembler

� ������ �� ������������������ MySQL � Sun Fortre 5.0 �� �������� 4%-��� ��������� �� UltraSPARC �� ��������� � gcc 3.2 � ������ -mcpu.

���� �� �������� 64-��������� ���, �� �� 4% ��������� ��� 32-���������, �� mysqld ����� ����������� ������ ������� � ������������ ������ ������.

� ������ ������������� ������� � fdatasync ��� sched_yield �� ����� ������ ����� ���������� LIBS=-lrt � ��������� ������ ������� ����������������.

����������� ����� ��������� ������ � ����� ������, ��� WorkShop 5.3, ������������:

��������������� ������ configure �����, ������� ������:

#if !defined(__STDC__) || __STDC__ != 1

�������:

#if !defined(__STDC__)

��� ��������� __STDC__ � ������� ����� -Xc ���������� Sun �� ������ ��������������� ��������� � ������ `pthread.h' �� ������� Solaris. ��� ������ Sun (����������� ���������� ��� ����������� ���������� ����).

���� ��� ������� mysqld ������ ����������� ���� ��������� �� ������:

libc internal error: _rmutex_unlock: rmutex not held

���������� ����������� ������� MySQL, ��������� ���������� Sun � ������ ���������� ��������������� (-mt). �������� ����� -mtCFLAGSCXXFLAGS � ���������� ��������� mysqld ��� ���.

��� ������������� SFW ������ gcc (������������ � Solaris 8) ���������� � ���������� ��������� LD_LIBRARY_PATH ����� ����������������� �������� `/opt/sfw/lib'.

��� ������ � gcc �� sunfreeware.com ����� ���������� ��������� �������������. �� ��������� ������� ���������� ����������������� gcc � �������� ���������������� ��������� GNU � ��� �������, ��� �� ����������� �� ������������.

��������� ������������� ������ ��� ���������� MySQL ������������ gcc ��������, ��� gcc �� ��������������� ��� ���� ������ Solaris:

shell> gcc -O3 -g -O2 -DDBUG_OFF -o thr_alarm ...
./thr_alarm.c: In function `signal_hand':
./thr_alarm.c:556: too many arguments to function `sigwait'

� ���� ������ ����� ����� ����� ������ ������ gcc � �������������� �� ������������� gcc-������������! ����� ��� �������� ������ gcc (�� ������� ���� ��� Solaris 2.5) �������� ������, ����������� � ������������� ���������� �����, ������� ������ ��� ���������, ������������ ������ (� ��������, � ������ ���������)!

� Solaris �� �������������� ����������� ������ ���� ��������� ��������� (libpthreadslibdl), ������� ������������� MySQL � ������ -static ������. ��� ������� ����� ���������� �� �������� ���� �� ����������� ���� ��������� �� ������:

ld: fatal: library -ldl: not found
���
undefined reference to `dlopen'
���
cannot find -lrt

���� ������� ����� ��������� ������������ �������� ���������� ���������� � mysqld, �� � ����� ��������� MySQL �������� ��������� ��������� �� ������:

Error in accept: Protocol error

��� ������� ���� �������� ����� ���������� ��������� ������ � ������ --set-variable back_log=50. ��������: --set-variable �� ������������ � MySQL 4.0. ������ ����������� --back_log=50. See section 4.1.1 ��������� ��������� ������ mysqld.

���� �� �������� ����������� MySQL-������, �� ��� ������� ��� ��������� ����� ���������� ��������� ��������� �� ������:

ld.so.1: ./my: fatal: libmysqlclient.so.#:
open failed: No such file or directory

�������� ����� ������ ����� �� ��������� ��������:

���� �� ����������� � ���������� ����������������, ������� ��������� � ������ -lz � � ��� �� ����������� zlib, ���������� ��� ��������:

���� ��� ������������� gcc �� ����������� � ���������� �������� UDF-������� � MySQL, ���������� �������� -lgcc � ������, ���������� �� ���������� UDF-�������.

��� ���� ����� MySQL-������ ��������� �������������, ����� ����������� `support-files/mysql.server'`/etc/init.d' � ������� �� ���� ������������� ������ `/etc/rc3.d/S99mysql.server'.

��������� Solaris �� ������������ ����� ������ ������ ��� ����������, ������������ setuid(), ���������� �������� ���� ������ ������ ��������� mysqld ��� ������������� ����� --user.

2.6.3.1 ���������� � Solaris 2.7/2.8

�� Solaris 2.7 � 2.8 ����� ��������� ������������ �������� ����� ��� Solaris 2.6. ����������� �������� �� ������ � Solaris 2.6 ��������� ����� � � Solaris 2.7 � 2.8.

���������� ��������, ��� MySQL ������ 3.23.4 � ����������� ����� ������������� ���������� ����� ������ Solaris � �������� ��������� ���� �������!

� Solaris 2.7/2.8 ������� ��������� ������ �� ���������� ������. ��� ������������� gcc �� ������ �������� ��������� ��������� �� �������:

/usr/include/widec.h:42: warning: `getwc' redefined
/usr/include/wchar.h:326: warning: this is the location of the previous definition

� ���� ������ ��� ����������� ������ ����� ��������� ��������� ��������:

���������� /usr/include/widec.h.../lib/gcc-lib/os/gcc-version/include � �������� ������ � ������� 41, ����������:

#if !defined(lint) && !defined(__lint)

��

#if !defined(lint) && !defined(__lint) && !defined(getwc)

���� � �������������� ������� - ��������������� `/usr/include/widec.h' ��������������� �� �����. � ����� ������ ����� ����������� ���������� ������� `config.cache' � ��������� configure ��������!

���� ��� ������� make �������� ��������� �� ������� ��������� ���������� ����, ������� � ���, ��� ��������� configure �� ���������� ���� `curses.h' (��������, ��-�� ������ � `/usr/include/widec.h'):

In file included from mysql.cc:50:
/usr/include/term.h:1060: syntax error before `,'
/usr/include/term.h:1081: syntax error before `;'

������ ��� �������� ����� ����� �� ��������:

���� �������� ������ �� ����� ���������� -lz ��� ���������� ����� ���������� ���������, �� ��������, ��������, ����������� � ���, ��� ���� `libz.so' ���������� � `/usr/local/lib'. ������ �������� ����� ������ ����� �� ����������� ���� ��������:

2.6.3.2 ���������� � Solaris x86

�� Solaris 2.8 �� x86-� ����������� mysqld �������� ���������� � ����������� ������ ������ �� �����, ���� �� ��������� ���������� strip.

���� ��� ������������� gcc ��� egcs �� Solaris x86 ��� ������� �������� �� ����������� � ��������� ���������� ���������� ��������� � ����������� ������ ������ �� �����, ����������� ��� ������ ������� configure �� ���������� �����������:

CC=gcc CFLAGS="-O3 -fomit-frame-pointer -DHAVE_CURSES_H" \
CXX=gcc \
CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions \
-fno-rtti -DHAVE_CURSES_H" \
./configure --prefix=/usr/local/mysql

��� �������� �������� ������� � ����������� libstdc++ � ��������������� ���������� � C++.

���� ����������� ������������ �� ��������, �������� ������ � ���������� ����������� � ��������� ��������� � ��������� ��������������� ����� ��� � ��������� gdb (see section E.1.3 ������� mysqld ��� ������ gdb).

2.6.4 ���������� � BSD

� ���� ������� ��������� ���������� ������������ ��������� BSD-������, � ����� ���������� ������ ���� ������.

2.6.4.1 ���������� � FreeBSD

��� ������ Mysql ������������� FreeBSD ������ 3.x, ��������� ������ � �������� �������� ������� ����� ���������������.

����������, � ������� � ����� ���������������� �������� ��������� �������� ������������� ������ mysql-servermysql-client �� ��������� ������ FreeBSD, ������� �������� �� ������ http://www.freebsd.org/.

������������� ���� ������ ������������:

������������� ������������ MIT-pthreads �� FreeBSD ������ 2.x � ����������� ������ ��� 3.x � ����� ������� ������ FreeBSD. �� ��������� ��������� ������� 2.2.x �������� ���������� ����������� �������, �� ��� ���� �� ��������� �������� � ���������� mysqld.

��� ������ MySQL � ������������ � Makefile'�� ���������� ��������� GNU make (gmake). ������ ��� ��������� ������ MySQL, ������� ���������� GNU make.

��������������, ��� ������������ ���� ������ ���� �������� ���������. � ��������� ������ �������� �������� ��� ������ ��� ���������� � mysqld.

��������� � ������������ ������ localhost � ����� `/etc/hosts' (��� ���������� ��� ����������� ���� ������ ��������� �������� ���������� � �����). ���� `/etc/hosts' ������ ���������� � ������:

127.0.0.1 localhost localhost.your.domain

������������ ������ ������ � ��������� MySQL �� FreeBSD � �������������� gcc (������ 2.95.2 ��� ����� �������):

CC=gcc CFLAGS="-O2 -fno-strength-reduce" \
CXX=gcc CXXFLAGS="-O2 -fno-rtti -fno-exceptions -felide-constructors \
-fno-strength-reduce" \
./configure --prefix=/usr/local/mysql --enable-assembler
gmake
gmake install
./scripts/mysql_install_db
cd /usr/local/mysql
./bin/mysqld_safe &

���� ��������� configure ������ ������������ MIT-pthreads, ���������� ����������� � ������������ �� MIT-pthreads (see section 2.3.6 ��������� �� ������� MIT-pthreads).

���� ��� ���������� make install �������� ������, ���������� � ������������� ���������� `/usr/include/pthreads' (can't find `/usr/include/pthreads'), ��� ������, ��� configure �� ��������� ������������� ������������� MIT-pthreads. ��� ����������� ������ ������ ���������� ��������� ��������� �������:

shell> rm config.cache
shell> ./configure --with-mit-threads

��� ��������, � FreeBSD �� ��������� ����������� ����� ��������� �������� ��� ���������� ������������ �������� ������ (see section A.2.16 �� ������ ���� (File not found)). ����� ��������� ���������, ������� ����������������� ������ ulimit -n � ������� safe_mysqld ��� �������� ����������� ��� ������������ mysqld`/etc/login.conf' (�� �������� ����������� ��� �������� cap_mkdb `/etc/login.conf'). ������ �����, ����� ����� ��������� ��������� ����������� ������ ��� ����� ������������ � ����� �������, ���� �� ������������ �������� �� ��������� (��� ������ chpass mysqld-user-name). See section 4.7.2 safe_mysqld, �������� mysqld.

��� ������� ������������� ������ ����������� ������ ����� ����������� ������� ����������� ����, ����� ��������� MySQL ������������ ����� ��� 512M� ����������� ������. ����� �������� ������ ����������, ���������� � option MAXDSIZ � ���������������� ����� LINT.

� ������ ������������� ������� � ������� ����� � MySQL �������� ����� ��������� ���������� ��������� ���������� TZ. See section F ���������� ���������.

��� ��������� ���������� � ���������� ������� ������� ������������ ������ �� ���� ������� FreeBSD, ������� ���������� ��� -RELEASE.

2.6.4.2 ���������� � NetBSD

��� ���������� �� NetBSD ����������, ����� ���� ����������� ��������� GNU make. � ��������� ������ ���������� ���������� �������� ��� ������� make ��������� lint �� ������ C++.

2.6.4.3 ���������� � OpenBSD 2.5

�� OpenBSD ������ 2.5 ����� ������������� MySQL � �������������� ����������� �������. ���������� ������� ��������� �����:

CFLAGS=-pthread CXXFLAGS=-pthread ./configure -with-mit-threads=no

2.6.4.4 ���������� � OpenBSD 2.8

�� ���������� ����� �������������, OpenBSD 2.8 �������� ������ � ���������� �������, ������� �������� �������� � MySQL. ������������ OpenBSD ��������� ��� ������, �� � 25 ������ 2001 ���� ������������ ������ �������� ������ � ����� ``-current''. �������� ���� ������ ���������� ������� ���������: ��������� �����, ������� ��������, ������� �������� ���������� � ��������� ��������� ���������.

��������� ��������� �� ������ ����� Error in accept:: Bad file descriptor ��� ������ 9 ��� ������� ������� ������� ���� ������� ��������, ��� �� �� �������� ���������� ������������ ������ ��� MySQL.

� ���� ������ ���������� ��������� safe_mysqld �� ����� ������������ root � �������:

--user=mysql --open-files-limit=2048

2.6.4.5 ���������� � BSD/OS ������ 2.x

��������� ����������� ���� ������ ��� ���������� MySQL ��������, ��� ������������� � ������� ulimit �������� ������� ����������� ������ ������� ����:

item_func.h: In method `Item_func_ge::Item_func_ge(const Item_func_ge &)':
item_func.h:28: virtual memory exhausted
make[2]: *** [item_func.o] Error 1

���������� ��������� ulimit -v 80000 � ��������� make ��� ���. ���� ��� �� �������, � � �������� �������� ������������ bash, ���������� ������� �� csh ��� sh: ��������� ������������ BSDI �������� ��� � ��������� � bashulimit.

���� �� ����������� gcc, ��, ��������, ���������� �������� ���� --with-low-memory ��� ������� configure, ����� ���������� ����������� ���������� `sql_yacc.cc'.

��� ������������� ������� � ������� ����� � MySQL ����� ������ ��������� ���������� TZ (see section F ���������� ���������).

2.6.4.6 ���������� � BSD/OS ������ 3.x

��� ���������������� MySQL ������� ������������ ��������� �������:

shell> env CXX=shlicc++ CC=shlicc2 \
       ./configure \
           --prefix=/usr/local/mysql \
	   --localstatedir=/var/mysql \
	   --without-perl \
	   --with-unix-socket-path=/var/mysql/mysql.sock

��������� � ��������� ��������� ������:

shell> env CC=gcc CXX=gcc CXXFLAGS=-O3 \
       ./configure \
           --prefix=/usr/local/mysql \
	   --with-unix-socket-path=/var/mysql/mysql.sock

��� ������� �� ������ �������� �������������� ��������� ��� ������������ �������� �� ���������, �� ��������� ������� �����.

���� ��������� �������� � ������������������� ��� ������� ��������, ���������� ��� ������� mysqld ������������ ����� --skip-thread-priority! ���������� ������ ����� �������� � ����, ��� ��� ������ ����� �������� � ���������� �����������; �� BSDI ������ 3.1 ��� ������������ ��������� ������������������ (�� ������� ����, ���� �� ��� ��������� ����������� �������).

� ������ ��������� ��������� �� ������ virtual memory exhausted �� ����� ���������� ���������� ��������� ulimit -v 80000 � ��������� make ��������. ���� ��� �� �������, � � �������� �������� � ��� ������������ bash, ���������� ������� �� csh ��� sh: ��������� ������������ BSDI �������� � ��������� � bashulimit.

2.6.4.7 ���������� � BSD/OS ������ 4.x

BSDI ������ 4.x �������� ������, ������� ��������� � �������. ���� �� ���������� ������������ MySQL �� ���� �������, ���������� �������������� ���������� ��� �����, ����������� � ���������� �������. �� ������� ����, ������ ���� ���������� M400-023.

�� ��������� �������� BSDI ������ 4.x �� ������ ����������� � ���������� ��� ������������� ������������ ���������. ����������� ��� ��� ������������� ��������� �����-���� ���������� ���������, �������� mysqladmin. � ������ ������ ���������� ������������������� MySQL � �������� ������������ ������������ ����������, ������ ��� ������� configure ����� --disable-shared.

��������� ������������ �������� ��� � ��������� �� BSDI 4.0.1, ������� ����������� � ���, ��� ����� ��������� ����� ����� ������ ������ mysqld �� ����� ������� �������. ��� ���������� ������, ��� ��-�� �����-�� ��������� ��� ������������ ������ mysqld �������� ������� ������� ��� ������-���� �������!

��� ������� �������� ���������� ���� �������� MySQL �� ������ 3.23.34, ���� ����� ������� configure ������� ������ #define HAVE_REALPATH �� ����� `config.h' ����� �������� make.

�������, ��� ������������� �������� �������� � ������������� ������� ������������� ������ �� ����� ��������� ���� ������ �� ������ ������� ���� ������ ��� ������������� ������ �� ������� � ������ ���� ������ �� BSDI! (�������� ������������� ������ �� ������ ���� �����������.)

2.6.5 ���������� � Mac OS X

2.6.5.1 Mac OS X 10.x

�� Mac OS X 10.x MySQL ������ �������� ��� �����-���� �������. ��� ���� ������������ ������� ��� ������������� � ������ � pthread!

��� ����� �������� Mac OS X 10.x Server. ���������� ��� ��������� ��������� ����� �� ���������� �� ���������� ��� ���������� ������. ������ ������, ��� Mac OS X Server ������������ � ����������������� MySQL.

See section 2.1.3 ��������� MySQL �� MacOS X.

2.6.5.2 Mac OS X Server 1.2 (Rhapsody)

������ ��� ���������� ����������������� MySQL �� ������� Mac OS X, ���������� ���������� ����� pthread, ������� ��������� �� ������ http://www.prnet.de/RegEx/mysql.html.

���� �������� ����� ��� Mac OS X ������������� �� Rhapsody 6.3 �� ���������� ����������������� �����������:

CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc \
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors \
-fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql \
--with-extra-charsets=complex --enable-thread-safe-client \
--enable-local-infile --disable-shared

��������, ��� ����������� �������� ���������� � ���� �������� �������� - ��� ������� � mysqlmysqladmin �� ��������� ������:

alias mysql '/usr/local/mysql/bin/mysql'
alias mysqladmin '/usr/local/mysql/bin/mysqladmin'

��� �� �� ������ ������ �������� ���� /usr/local/mysql/bin � ���������� ��������� PATH, ������, ����� ���������� � ���� `$HOME/.tcshrc':

setenv PATH $PATH:/usr/local/bin

2.6.6 ���������� � ������ Unix-��������

2.6.6.1 ���������� � ��������� ������������ HP-UX

��������� �������� �������� MySQL ��� HP-UX ���������������� ��� ����� HP depot � tar. ��� ������������� ����� depot � ��� ������ ���� ����������� ������ HP-UX �� ���� 10.x - ��� ����, ����� ���������� ����������� ������ � HP-��������������� ������ � depot-�������.

������ MySQL ��� HP ���� �������������� �� ������� HP 9000/8xx � ������� HP-UX 10.20 � �������������� MIT-pthreads. ��������, ��� ��� ������ �������� � ���� ������������. MySQL ������ 3.22.26 � ���� ����� ����� ������� � �������������� ����������� ������� HP.

������ ������������, �� ������� �������� ������ MySQL:

�� ��������� ������������� MySQL, ������ �����, �������� �� �����:

��� ��������� ������������ ����������� ���� �� �������������� ���� ������; ����� /path/to/depot - ������ ���� � depot-�����:

depot �������� �������� ����������� ����� � ���������� � `/opt/mysql', � ������ - � `/var/opt/mysql'. depot ����� ������� ��������������� ������ � `/etc/init.d'`/etc/rc2.d' ��� ��������������� ������� ������� ��� �������� ������. ��������, ��� ��� ��������� ���������� �������� ������� ������������ root.

��� ��������� �� HP-UX ������������ tar.gz �� ������ ������ ���� ���������� GNU tar.

2.6.6.2 ���������� � HP-UX ������ 10.20

��� ���������� MySQL �� HP-UX ���������� ���� ��������� �������. �� ����������� ��������� ������ ������������ ����������� HP-UX gcc, ������ ��� ���, ��������� gcc, �����!

��� HP-UX ������������� ������������� gcc 2.95. �� ������� ��������� ������� ������ ����������� (��������� -O6), ��������� �� HP-UX ��� ����� ���� �����������.

������ �������� ��������� ������ ������������ ��� gcc 2.95:

CFLAGS="-DHPUX -I/opt/dce/include -fpic" \
CXXFLAGS="-DHPUX -I/opt/dce/include -felide-constructors -fno-exceptions \
-fno-rtti" CXX=gcc ./configure --with-pthread \
--with-named-thread-libs='-ldce' --prefix=/usr/local/mysql
--disable-shared

��������� ������ ������������ ������ �������� ��� gcc 3.1:

CFLAGS="-DHPUX -I/opt/dce/include -O3 -fPIC" CXX=gcc \
CXXFLAGS="-DHPUX -I/opt/dce/include -felide-constructors -fno-exceptions \
-fno-rtti -O3 -fPIC" ./configure --prefix=/usr/local/mysql \
--with-extra-charsets=complex --enable-thread-safe-client \
--enable-local-infile  --with-pthread \
--with-named-thread-libs=-ldce --with-lib-ccflags=-fPIC
--disable-shared

2.6.6.3 ���������� � HP-UX ������ 11.x

��� HP-UX ������ 11.x �� ����������� ������������ MySQL �� ���� 3.23.15.

��-�� ��������� ����������� ������ � ����������� ����������� HP-UX �� ������� ������� MySQL �� HP-UX 11.0 ���������� ���������� ��������� �����:

PHKL_22840 Streams cumulative
PHNE_22397 ARPA cumulative

���������� ������ ������ ����� �������� ��������� EWOULDBLOCK �� recv()EBADF �� accept() � ��������� �����������.

��� ������������� gcc 2.95.1 � �������, � ������� �� ���� ��������� �����, ��������� ������:

In file included from /usr/include/unistd.h:11,
		 from ../include/global.h:125,
		 from mysql_priv.h:15,
		 from item.cc:19:
/usr/include/sys/unistd.h:184: declaration of C function ...
/usr/include/sys/pthread.h:440: previous declaration ...
In file included from item.h:306,
		 from mysql_priv.h:158,
		 from item.cc:19:

�������� ����������� � ���, ��� HP-UX ���������� ������������� ����������� ������� pthreads_atfork(). ������������� ��������� ��������� � `/usr/include/sys/unistd.h':184 � � `/usr/include/sys/pthread.h':440 (����������� ��������� ����).

���� �� ��������� ������� ����������� � ���, ����� ����������� `/usr/include/sys/unistd.h'`mysql/include' � ��������������� `unistd.h' ���, ����� ����������� ��������� � ������������ �� `pthread.h'. ���� �������� ��������� ������ diff:

183,184c183,184
<      extern int pthread_atfork(void (*prepare)(), void (*parent)(),
<                                                void (*child)());
---
>      extern int pthread_atfork(void (*prepare)(void), void (*parent)(void),
>                                                void (*child)(void));

����� ����� ������ �������� ���������������� ��������� �� ���������� �����������:

CFLAGS="-fomit-frame-pointer -O3 -fpic" CXX=gcc \
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -O3" \
./configure --prefix=/usr/local/mysql --disable-shared

���� �� ����������� MySQL 4.0.5 � ������������ HP-UX, �� ��� �������� (��������� �� cc B.11.11.04):

CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure --with-extra-character-set=complex

�� ������ ������������ ������, �������� ����:

aCC: warning 901: unknown option: `-3': use +help for online documentation

��� ��������� ���������� ��������� �� ������ ��� ������ configure

checking for cc option to accept ANSI C... no
configure: error: MySQL requires a ANSI C compiler (and a C++ compiler).
Try gcc. See the Installation chapter in the Reference Manual.

������� ��������������, ��� ���� � ����������� K&R �� ������ ������, ��� ���� � ������������ HP-UX C � C++.

��� ���� �������, �� ������� �� �� ������� �������������� MySQL, ����������� � ���, ��� �� ������ ������� ���� +DD64, ��������� ����.

2.6.6.4 ���������� � IBM-AIX

� Autoconf ��������� �������������� ����������� xlC, ������� ��� ���������� MySQL ������� �������� ������� configure ��������� ��������� (� ���� ������� ������������ ���������� IBM):

export CC="xlc_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192 "
export CXX="xlC_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192"
export CFLAGS="-I /usr/local/include"
export LDFLAGS="-L /usr/local/lib"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS

./configure --prefix=/usr/local \
		--localstatedir=/var/mysql \
		--sysconfdir=/etc/mysql \
		--sbindir='/usr/local/bin' \
		--libexecdir='/usr/local/bin' \
		--enable-thread-safe-client \
		--enable-large-files

����� ������� �����, ������������ ��� ���������� ������������ MySQL, ������� ��������� �� ������ http://www-frec.bull.com/.

���� � ����������� ���� ������� ������������ �� ��������� -O3 �� -O2, ������� ����� ������� ����� -qstrict (��� ����������� ����������� IBM C).

��� ������������� gcc ��� egcs ��� ���������� MySQL ������� ��������� ���� -fno-exceptions, ������ ��� ���������� �������������� �������� � gcc/egcs �� ��������� � ���������� �������! (��� ��������� �� egcs 1.1.) ���������� ����� ��������� ��������� �������� � ����������� IBM, ������� ����� �������� � ��������� ���������� ���� ��� ������������� ��� � gcc.

��� ������������� egcs ��� gcc 2.95 �� AIX �� ����������� ��������� ������ ����������������:

CC="gcc -pipe -mcpu=power -Wa,-many" \
CXX="gcc -pipe -mcpu=power -Wa,-many" \
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory

��� ���� ����� ���������� ���� ��������, ����� ���������� ��������� ����� -Wa,-many. � IBM �������� � ������������� ������ ��������, �� �� ����������� �� ��������� ���������� ������, ��������� ���������� ������ ������. ��� ����������, ���������� �� ������������� -fno-exceptionsgcc 2.95, �� ��������� � MySQL ��� ����������� �������������� ��������, � ��� ����� ������������ �������� ����� �������� ����, �� ����������� ������ ������������ �� � egcs/gcc.

� ������ ������������� ������� � ���������� �� ���������� ���������� �������� -mcpu=xxx � ������������ �� ����� �����������. ������ ���������� ������������ power2, power ��� powerpc, ��, ��������, ���������� ����� ������� 604 ��� 604e. ���� ��� � �� ��������������, �� ������������� "power" ����� ���������� ����� ������, ���� �� power2-�������.

���� �� �� ������, ����� � ��� ���������, ������� ��������� uname -m. ������ ������� ���������� ������ ��������� "000514676700", ������ ������� xxyyyyyymmss, ��� xx � ss ������ 0, yyyyyy - ���������� ������������� ������� � mm - ������������� ���������� Planar. ����� ���� �������� ��������� �� ������ http://publib.boulder.ibm.com/doc_link/en_US/a_doc_lib/cmds/aixcmds5/uname.htm.

� ������������ � ������ ������ ����� ������ ��� � ������ ������, � ��� �� ��� -���������� ��� ����������.

������������� ������� � ��������� (MySQL ���������� ������� ��� ������� ��������) ����� ��������, ��� �� ����������� � ������� ������������ ������� � ������ � �������� � ���������. � ���� ������ ����� ��������� MySQL ������������ ������� ��� ������ ��������� ������ ������������:

shell> CFLAGS=-DDONT_USE_THR_ALARM CXX=gcc \
       CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti \
       -DDONT_USE_THR_ALARM" \
       ./configure --prefix=/usr/local/mysql --with-debug --with-low-memory

��� �� �������� �� ������������������ MySQL, �� �������� � ��������� �������, ���������� � ������������� �������� ������ ������� �� ������ ����������� ��� ������ ������ mysqladmin kill ��� mysqladmin shutdown. ������ ����� ������ �������� ������ ��� ������� ������� ��������� �������.

�� ��������� ������� AIX ���������� � libbind.a �������� � ����, ��� getservbyname �������� ��������� ��������� ��������� � ����������� ������ ������ �� ���� (core dump). ��� ������ AIX � � ��� ������� �������� � IBM.

��� AIX 4.2.1 � gcc ���������� ������� ��������� ���������:

����� ������������ ������� ��������������� ����� `config.h'`include/my_config.h', � ����� �������� ������, ����������

#define HAVE_SNPRINTF 1

��

#undef HAVE_SNPRINTF

� ���������� ���������� � ����� `mysqld.cc' �������� �������� ������� initgoups.

#ifdef _AIX41
extern "C" int initgroups(const char *,int);
#endif

���� ��� ����� �������� ����� ������ �������� mysqld, ������������ ������� ulimit -d unlimited. ��� ����� ����������� � mysqld_safe ���������� ���-�� �����:

export LDR_CNTRL='MAXDATA=0x80000000'

������ ���������� �� ������������� �������� ���������� ������ - �����: http://publib16.boulder.ibm.com/pseries/en_US/aixprggd/genprogc/lrg_prg_support.htm.

2.6.6.5 ���������� � SunOS 4

�� SunOS 4 ��� ���������� MySQL ���������� ������������ MIT-pthreads, ���, � ���� �������, ������ �� ����� ������������� � GNU make.

�� ��������� SunOS 4 ��������� �������� � ������������� ������������ � libtool. �� ��������� ���� ������� ����� ������������ ����������� ���� ������ configure:

shell> ./configure --disable-shared --with-mysqld-ldflags=-all-static

��� ���������� readline ����� ���������� �������������� � ������������� ������������. �� ��� ����� �� �������� ��������.

��� ���������� mysqld ��������� �������������� �� implicit declaration of function. �� ��� ����� ����� �� �������� ��������.

2.6.6.6 ���������� � Alpha-DEC-UNIX (Tru64)

��� ������������� egcs �� Digital Unix ���������� �������� ���� ������ �� gcc 2.95.2, ��������� �������� � ���������� ��������� ������� � egcs ��� DEC!

� ������������ ������������� ��� ���������� ��������� �������� ��� Digital Unix ������������ ����� -pthread ��� cccxx, � ����� ���������� -lmach -lexc (� ���������� � -lpthread). ��������� configure ����� � ��������� �����:

CC="cc -pthread" CXX="cxx -pthread -O" \
./configure --with-named-thread-libs="-lpthread -lmach -lexc -lc"

��� ���������� mysqld ����� ���� ������ ��������� �������������� ��������� ���������:

mysqld.cc: In function void handle_connections()':
mysqld.cc:626: passing long unsigned int *' as argument 3 of
accept(int,sockadddr *, int *)'

�� ��� ����� �� �������� ��������. ��� ��������� ��-�� ����, ��� configure ����� ������������ ������ ������, �� �� ��������������.

��� ������� ������� ��������������� �� ��������� ������ ����� ���������� �������� � ���, ��� �� ���������� ������ ��� ������ �� ������� (��� ������ �� ������� ��� ��������, ���������� ���� �� ����� ������, �������� ������ SIGHUP). ���� ����� ����������, ������� ��������� ������ ��������:

shell> nohup mysqld [options] &

��� �������� nohup ��������� �� ��� ������� ����� ������������ ��� ������� SIGHUP, ��������� ����������. � �������� ��������������� �������� ����� ��������� ������ �������� safe_mysqld, ������� ��� ������� mysqld �������� ����� nohup ������ ��� (see section 4.7.2 safe_mysqld, �������� mysqld).

���� �� ����������� � ���������� ���������� `mysys/get_opt.c', ������� ������ ������� ������ #define _NO_PROTO � ������ ����� �����!

��� ����������� CC �� Compaq ����������� ��������� ���:

CC="cc -pthread"
CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all -arch host"
CXX="cxx -pthread"
CXXFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all -arch host \
-noexceptions -nortti"
export CC CFLAGS CXX CXXFLAGS
./configure \
--prefix=/usr/local/mysql \
--with-low-memory \
--enable-large-files \
--enable-shared=yes \
--with-named-thread-libs="-lpthread -lmach -lexc -lc"
gnumake

� ������ ������������� ������� � libtool ��� ���������� � ������������� ������������ (��� �������� ����), ��� ���������� mysql �� ������ �������� ���� ������� � �������:

cd mysql
/bin/sh ../libtool --mode=link cxx -pthread -O3 -DDBUG_OFF \
-O4 -ansi_alias -ansi_args -fast -inline speed \
-speculate all \ -arch host -DUNDEF_HAVE_GETHOSTBYNAME_R \
-o mysql mysql.o readline.o sql_string.o completion_hash.o \
../readline/libreadline.a -lcurses \
../libmysql/.libs/libmysqlclient.so -lm
cd ..
gnumake
gnumake install
scripts/mysql_install_db

2.6.6.7 ���������� � Alpha-DEC-OSF/1

� ������ ������� ���������� ��� ������������� DEC CCgcc ���������� ��������� configure ��������� �������:

CC=cc CFLAGS=-O CXX=gcc CXXFLAGS=-O3 \
./configure --prefix=/usr/local/mysql

���� ��������� �������� � ������ `c_asm.h', ����� ������� � ������������ ``���������'' `c_asm.h' ��� ������ ��������� ������:

touch include/c_asm.h
CC=gcc CFLAGS=-I./include \
CXX=gcc CXXFLAGS=-O3 \
./configure --prefix=/usr/local/mysql

�������, ��� ������������� ���� �������� � ���������� ld ����� ���� ������ ����� �������� ���������� ������ ������ �� DEC (Compaq) � http://ftp.support.compaq.com/public/unix/.

��� ������������� OSF/1 4.0D � ����������� DEC C V5.6-071 �� Digital Unix V4.0 (Rev. 878) ���������� �������� ����� ���� ������� (�������������� asm-�������). ����� ����, /bin/ld �����, ������, �������� ������ (�������� � �������� _exit undefined ������������ ��� ���������� mysqld). �� ���� �������� ��� ������� ������������ ���������� MySQL � ������� ��������� ������ configure, ������� /bin/ld ����������� ������ �� ������ OSF 4.0C:

CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql

� Digital-������������ "C++ V6.1-029" ������ ��������:

CC=cc -pthread
CFLAGS=-O4 -ansi_alias -ansi_args -fast -inline speed -speculate all \
       -arch host
CXX=cxx -pthread
CXXFLAGS=-O4 -ansi_alias -ansi_args -fast -inline speed -speculate all \
         -arch host -noexceptions -nortti
export CC CFLAGS CXX CXXFLAGS
./configure --prefix=/usr/mysql/mysql
	    --with-mysqld-ldflags=-all-static \
            --disable-shared --with-named-thread-libs="-lmach -lexc -lc"

� ��������� ������� OSF/1 ��������� ������� alloca(). �������� ����� ��������� ��������� �� ����� `config.h' ������, � ������� ������������ HAVE_ALLOCA.

����� ����� ������������ ������������ �������� ��� ������� alloca()`/usr/include/alloca.h'. ��������������, ��������� ����, ����� ������������.

configure ����� ������������� ������������ ��������� ��������� ����������: --with-named-thread-libs="-lpthread -lmach -lexc -lc".

��� ������������� gcc ����� ����������� ��������� configure ��������� �������:

shell> CFLAGS=-D_PTHREAD_USE_D4 CXX=gcc CXXFLAGS=-O3 ./configure ...

������������� ������� � ��������� (MySQL ���������� �������� ��������� ������ ��� ������� ��������), ����� ��������, ��� �� ���������� ������ ��� ������ ������������ ������� � �������� � ���������. � ������ ������ ����� ��������� MySQL ������������ ������� ����� ������������ ��� ��������� �������:

shell> CFLAGS=-DDONT_USE_THR_ALARM \
       CXXFLAGS=-DDONT_USE_THR_ALARM \
       ./configure ...

��� �� �������� �� ������������������ MySQL, �� �������� � ��������� �������, ������� ����������� ��� ������������� �������� ������ ������� �� ������ ����������� ��������� mysqladmin kill ��� mysqladmin shutdown. ������ ����� ������ �������� ������ ��� ������� ������� ��������� �������.

��� ������������� gcc 2.95.2 ����� ��������� ��������� ������ ����������:

sql_acl.cc:1456: Internal compiler error in `scan_region', at except.c:2566
Please submit a full bug report.

����� ����� �� ��������� � ���� ������, ������� ������� � ������� `sql' � ��������� ��������� ������ gcc (������ �������� ��, ��������, ������ � �������� � ��������), ������� � ��� -O3 �� -O0 (��� �������� -O0 ��������������� ����� gcc, ���� � ��� � ������ ���������� ����������� �����-���� ����� -O). ����� ���������� ��������� �������� ��������� � ������� �������� ������ � ��������� make ��������.

2.6.6.8 ���������� � SGI Irix

��� ������������� Irix 6.5.3 ��� ���� mysqld ����� ��������� ������ ������ � ������, ���� �� ������� �� ����� ������������ � ������������ CAP_SCHED_MGT (��������� ���, ��� � root) ��� ���� ����� ���������� ������ ������� mysqld ��������� ��������:

shell> chcap "CAP_SCHED_MGT+epi" /opt/mysql/libexec/mysqld

��������, ��� �������� ������ ��������� ����������� �� `config.h'. ��� �������� ����� ���������� configure, �� �� ����������.

� ��������� ����������� Irix ����������� ����������� ������� alloca(). ���� ������ mysqld �������� ��������� ������ ��� ���������� ��������� ��������� SELECT, ������� �� `config.h' ������, � ������� ������������ HAVE_ALLOCHAVE_ALLOCA_H. ���� �� �������� mysqladmin create, ������� �� `config.h' ������, ������������ HAVE_READDIR_R. ����� ����� ������� ������, ���������� HAVE_TERM_H.

SGI ����������� ���������� ��� �����, ��� ������� �� ��������

http://support.sgi.com/surfzone/patches/patchset/6.2_indigo.rps.html.

��� �������, ��� �������, ���������� ��������� ���������� (rollup) ����, ��������� ���������� rld � ��������� ���������� libc.

��� ��������� pthreads ����������� ������� ���������� ��� ����� POSIX �� ��������:

http://support.sgi.com/surfzone/patches/patchset/6.2_posix.rps.html

���� ��� ���������� `mysql.cc' �� �������� ��������� �� ������ ���������:

"/usr/include/curses.h", line 82: error(1084): invalid combination of type

�� ���������� ��������� ��������� ������� � �������� �������� ������ ������ ��������� �������� ������� MySQL:

shell> extra/replace bool curses_bool < /usr/include/curses.h \
     > include/curses.h
shell> make

�� �������� ����� ��������� � ��������� ����������. ���� ����������� ������ ���� �����, �� ������ ���� ����� ��������. ������ ���� ��������� ��� ���� ���������-������, �� ����� �������� ��������� � ��������� ��� (�� ����������� �� �������������� ��������������) � ��� ������ �������. ������� ��������� �������� � �������� � Irix ���� ������; ��������, ��� ������� ����� ��������� �������, ���� ��� �� ����� ������.

��� ���������� � ������� gcc ����� ������������ ��������� ������� configure:

CC=gcc CXX=gcc CXXFLAGS=-O3 \
./configure --prefix=/usr/local/mysql --enable-thread-safe-client \
--with-named-thread-libs=-lpthread

��������, ��� ��� Irix 6.5.11 � ������������ Irix C � C++ ������������� ������ 7.3.1.2, ������ ��������:

CC=cc CXX=CC CFLAGS='-O3 -n32 -TARG:platform=IP22 -I/usr/local/include \
-L/usr/local/lib' CXXFLAGS='-O3 -n32 -TARG:platform=IP22 \
-I/usr/local/include -L/usr/local/lib' ./configure \
--prefix=/usr/local/mysql --with-innodb --with-berkeley-db \
--with-libwrap=/usr/local \
--with-named-curses-libs=/usr/local/lib/libncurses.a

2.6.6.9 ���������� � Caldera (SCO)

� ��������� ����� ����� ������������ ������ �� �������� ``sco3.2v5.0.4'' � ``sco3.2v5.0.5''. �������� �������� ���������� � ��������� ������ �� ``sco3.2v4.2''.

� ��������� ����� � �������� ����������� ��� OpenServer �� ����������� gcc 2.95.2. ��������� ���, ����� �������������� MySQL ��� ������ ��������� ������:

CC=gcc CXX=gcc ./configure ... (�����)
  1. �� OpenServer 5.0.X ���������� ������������ gcc-2.95.2p1 ��� ����� ������ ������ �� Skunkware - http://www.caldera.com/skunkware/ � ������� ����� ��� OpenServer ��� �������� ��� �� ftp �� ������ ftp2.caldera.com � �������� pub/skunkware/osr5/devtools/gcc.
  2. ������� ������������ ������������� ������ GCC 2.5.x ��� ����� �������� � ������� Development. ��� ���������� ��� ������ ������ Caldera (SCO) Unix. ������������ ������ ������� GCC Dev ������.
  3. ���������� ��������� ����� FSU Pthreads � ���������� ���. ��� ����� ����� �� ������ http://www.cs.wustl.edu/~schmidt/ACE_wrappers/FSU-threads.tar.gz. ����� ����� �������� ��� ���������������� ����� �� http://www.mysql.com/Downloads/SCO/FSU-threads-3.5c.tar.gz.
  4. FSU Pthreads ����� ���� �������������� �� Caldera (SCO) Unix 4.2 c tcpip. �� OpenServer 3.0 ��� Open Desktop 3.0 (OS 3.0 ODT 3.0) � �������������� Caldera (SCO) Development System ��� ����������� ������� ����� GCC 2.5.x ODT ��� OS 3.0. ������ ��� ���������� ������ ������������� ������ ��������� ����� �������. ��� ������������ ���� ��������� ��������� ������� SCO Unix Development. ��� ��� � ��� �� ����� ����������� ��������� � ��������� ������.
  5. ��� ������ FSU Pthreads � ����� ������� ����� ��������� ��������� ��������:
    1. ��������� ./configure � �������� threads/src � �������� ����� SCO OpenServer. ��� ������� ��������� Makefile.SCO5Makefile.
    2. ��������� make.
    3. ��� ��������� � ������� �� ��������� - `/usr/include' ������� � ������� � ������� ������������ root, ��������� � ������� thread/src � ��������� make install.
  6. �� �������� ������������ GNU make ��� ������ MySQL.
  7. ��� ������� safe_mysqld �� � ������� ������������ root �� �������� ���������� ��������� ������������ ������ 110 ������ �� ������� (��� �������� ����������� �� ���������). mysqld ������� �� ���� � ����� ���������.
  8. �� SCO 3.2V5.0.5 �� ������ ������������ FSU Pthreads ������ 3.5c ��� ����, � ����� gcc 2.95.2 ��� ����� ����� ������! ����������� ���� ������� configure ������ ����������� ���������:
    shell> ./configure --prefix=/usr/local/mysql --disable-shared
    
  9. �� SCO 3.2V4.2 ������� ������������ FSU Pthreads ������ 3.5c ��� ����. ����������� ���� ������� configure ������ ����������� ���������:
    shell> CFLAGS="-D_XOPEN_XPG4" CXX=gcc CXXFLAGS="-D_XOPEN_XPG4" \
           ./configure \
           --prefix=/usr/local/mysql \
           --with-named-thread-libs="-lgthreads -lsocket -lgen -lgthreads" \
           --with-named-curses-libs="-lcurses"
    
    � ��� ����� ���������� �������� � ���������� ����������� �������. � ����� ������ �����, ������������� ��� SCO ���������� ����� ����� ����� �� ������ http://www.mysql.com/Downloads/SCO/SCO-3.2v4.2-includes.tar.gz. ���� ����� ������� ����������� � ������� ������ �������� ������� MySQL � ������ include

��������� �� ���������� ��� Caldera (SCO):

���� ���������� ���������� DBI �� Caldera (SCO), ������� ��������������� Makefile � DBI-xxx � ������ �����������.

��� ������������ ���� ���� ��������������� ������������� gcc 2.95.2 ��� ����� ����� ������:

������:                               �����:
CC = cc                               CC = gcc
CCCDLFLAGS = -KPIC -W1,-Bexport       CCCDLFLAGS = -fpic
CCDLFLAGS = -wl,-Bexport              CCDLFLAGS =

LD = ld                               LD = gcc -G -fpic
LDDLFLAGS = -G -L/usr/local/lib       LDDLFLAGS = -L/usr/local/lib
LDFLAGS = -belf -L/usr/local/lib      LDFLAGS = -L/usr/local/lib

LD = ld                               LD = gcc -G -fpic
OPTIMISE = -Od                        OPTIMISE = -O1

OLD:
CCCFLAGS = -belf -dy -w0 -U M_XENIX -DPERL_SCO5 -I/usr/local/include

�����:
CCFLAGS = -U M_XENIX -DPERL_SCO5 -I/usr/local/include

��� ������� ���, ��� dynaloader �� Perl �� ��������� DBI-�������, ���� ��� �������������� ������������� icc ��� cc.

Perl ����� �������� �����, ���� ��� �������������� ������������ cc.

2.6.6.10 ���������� � Caldera (SCO) Unixware Version 7.0

�� ������ ������������ MySQL ������ �� ���� 3.22.13, ��������� � ���� ������ ���������� ��������� ��������, ��������� � �������������� ��� Unixware.

��� ������� �������������� MySQL ��������� �������� configure �� Unixware ������ 7.0.1:

CC=cc CXX=CC ./configure --prefix=/usr/local/mysql

���� �� ������ ������������ gcc, ���������� ������������ gcc ������ 2.95.2 ��� �����.

Caldera ���������� libsocket.so.2 � ftp://stage.caldera.com/pub/security/tools ��� ����������� ������������ � ����� ������, ��� OSR506, ��������. ����� ����, ����������� telnetd �� ftp://stage.caldera.com/pub/security/openserver/CSSA-2001-SCO.10/ ������������� � ��� libsocket.so.2, � ��� libresolv.so.1. ��� �� ��������� ���������� ��� ��������� �� ����� ������, ��� OSR506, �������.

������������� �������������� ����� ����� �� ������� ����������/������������� MySQL.

2.6.7 ���������� � OS/2

� MySQL ������������ ���������� ����� �������� ������. ������� � ���� ���� `CONFIG.SYS' ��� ����� �������� ��� ����� ������������ ����:

SET EMXOPT=-c -n -h1024

� ��������� ������ �� ������ ����������� �� ��������� �������:

File 'xxxx' not found (Errcode: 24)

��� ������������� MySQL � OS/2 Warp 3 ��������� FixPack 29 ��� ����, � � OS/2 Warp 4 -FixPack 4 ��� ����. ��� ��������� ��� ���������� Pthreads. MySQL ����� ���� ���������� �� �������� �������, �������������� ������� �����, ����� ��� HPFS, FAT32, � �.�.

������ `INSTALL.CMD' ������ ����������� �� ����������� �������� OS/2 - `CMD.EXE'; � ����� �� �������� � ���������� �� ���������, ����� ��� `4OS2.EXE'.

������ `scripts/mysql-install-db' ��� ������������. ������ �� ���������� `install'.cmd � �������� REXX-��������, ������� ������ ��������� ������������ MySQL �� ��������� � ������� ������ WorkPlace Shell ��� MySQL.

��������� ������������ ������� ��������������, �� ��������� �� ���������. ������������ ������ ������ ���� �������������� � �������������� ������������ ���������� Pthreads.

gcc -Zdll -Zmt -Zcrtdll=pthrdrtl -I../include -I../regex -I.. \
    -o example udf_example.cc -L../lib -lmysqlclient udf_example.def
mv example.dll example.udf

����������: � ������������ � ������������� OS/2 ������ �������� ����� ���� ������� UDF �� ������ ��������� 8-�� ��������. ������ �������� � �������� `/mysql2/udf'; ������ s`afe-mysqld.cmd' �������� ���� � ����� �������� � ���������� ��������� BEGINLIBPATH. ��� ������������� UDF-������� ������������ ���������� ������������ - ��� ��� ����������� ��� `.udf'. ��������, � Unix ������������ ������ ����� ����� ��� `example.so' � ������� �� ���� ����� ����������� ��������� �������:

mysql> CREATE FUNCTION metaphon RETURNS STRING SONAME "example.so";

� OS/2 ������ ����� ����� ��� `example.udf', �� �� �� ������ ���������� ���������� ������:

mysql> CREATE FUNCTION metaphon RETURNS STRING SONAME "example";

2.6.8 ���������� � BeOS

�� �������������� � ���, ����� MySQL ������� � BeOS, ��, � ���������, ����� ��� ��� ������, ��� ���� �� BeOS ��� ������� �������� ��� �������� ������������� ������.

���� �������� �������� ������� ������������� ������, �� �� ������ ������� �� ������ � ������� ����� ����������� ��������, ������� ����� ���������� ��� �������� ������������� ������.

� ��� ���� ��������������� ������� � ���������� �������������� BeOS, ������������, ��� �� 80% ������� ������������� ������ MySQL ��� BeOS, ������ ��� �� ���������� ����������� ������� �� �� �������� �� ��� ������� ��������.

2.6.9 ���������� � Novell NetWare

�� �������������� � ���, ����� MySQL ������� �� Novell NetWare, ��, � ���������, ����� ��� ��� ������, ��� ���������� ������ ���������� �� � NetWare ��� ������� �������� ��� �������� ������������� ������.

�� ������ �� ����� �������� ������� ������������� ������ � ������ ������ �� � ������� ����� ����������� ��������, ������� ����� ���������� ��� ������ ��� ���.

2.7 ��������� �� ��������� Perl

2.7.1 ��������� Perl �� Unix

��������� Perl ��� MySQL �������������� ���������� ����������� ���������� DBI/DBD. See section 8.2 ��������� Perl API ��� MySQL. ��� ����������� ���� Perl DBD/DBI ��������� ������ Perl 5.004 ��� ����. ��� ������������� ����� ������ ������ Perl ������ ��������� �� ����� ��������.

��� ��������� Perl � MySQL ����� ���������, ����� ���� ����������� ����������� ��������� �������� MySQL. ���� �� ���������� MySQL �� ������ RPM, �� ���������� ��������� ��������� � RPM-������ MySQL-client, � �� ����������� ��������� - � RPM-������ MySQL-devel. ���������, ��� � ��� ����������� ��������� ������ RPM.

� ������ 3.22.8 ��������� Perl ������������ �������� �� ��������� ������������ MySQL. ���� �� ������ ���������� ��������� Perl, �� ����������� ����� ����� �������� � http://www.mysql.com/downloads/api-dbi.html.

������������ Perl ������������ ��� ������ tar-������ � ������� ��������� `MODULE-VERSION.tar.gz', ��� MODULE - ��� ������ � VERSION - ����� ������. ���������� ����� ������������ Data-Dumper, DBIMsql-Mysql-modules � ���������� �� � ��������� �������. ��������� ��������� ��������� ����. ���������� ������ �������� ��� ������ Data-Dumper, �� ���� ��������� ��������� ��� ���� ���� �������������:

  1. ���������� ����������� � ������� ��������:
    shell> gunzip < Data-Dumper-VERSION.tar.gz | tar xvf -
    
    ��� ������� ������� ������� � ������ `Data-Dumper-VERSION'. ��������� � �������, ���� ������������ �����������:
    shell> cd Data-Dumper-VERSION
    
    �������� ����������� � �������������:
    shell> perl Makefile.PL
    shell> make
    shell> make test
    shell> make install
    

������� make test �������� ������, ��������� ��� ���������, �������� �� ������. ������� ���������, ��� ���� ��� ������� ����������� �� ����� ��������� Msql-Mysql-modules ��� �������� ���� ����������, �� ������ MySQL ��� ���� ������ ��������, ��� �� ������ ���� �������� �������.

������ ��� ��� ��������� ������ ������� MySQL ������� ������� ������ � �������������� ����������� Msql-Mysql-modules, �������� ���� ���������� ����� ��������, ��� ������ �������� DBI ����� ������������ MySQL (������� � ���� coredump).

���� �� �� ��������� ������� ��������� ������� Perl � ��������� �������� ��� ��������� ������� Perl, �� ��� ��� �������� �������� ��������� ������:

http://www.iserver.com/support/contrib/perl5/modules.html

������� �������� � ������� Installing New Modules that Require Locally Installed Modules.

2.7.2 ��������� ActiveState Perl �� Windows

��� ��������� ������ DBD ��� MySQL ��� ActiveState Perl �� Windows ���������� ��������� ��������� ��������:

��� ������� ������ �������� �� ������� ���� � ������� ActiveState Perl 5.6.

���� ����������� ���� ������� � ��� �� ��������, �� ������ ����� ���������� ���������� ������� MyODBC � ���������� ������ MySQL ����� ODBC:

use DBI;
$dbh= DBI->connect("DBI:ODBC:$dsn","$user","$password") ||
  die "Got error $DBI::errstr when connecting to $dsn\n";

2.7.3 ��������� ������������ Perl ��� MySQL �� Windows

����������� Perl ��� MySQL �������� DBI, DBD:MySQLDBD:ODBC.

2.7.4 �������� ������������� ���������� Perl DBI/DBD

���� Perl ��������, ��� �� ����� ����� ������ `../mysql/mysql.so', �� ��������, ��������, ����������� � ���, ��� Perl �� ����� ����� ������������ ���������� `libmysqlclient.so'.

��� �������� ����� ���������, ��������� ����� �� ��������� �������:

���� �� ��������� �� DBD-mysql �������������� ���� ������, ��, ������ �����, � ��� ������������ ���������� gcc (��� ������ �������� ���, ���������������� � gcc):

/usr/bin/perl: can't resolve symbol '__moddi3'
/usr/bin/perl: can't resolve symbol '__divdi3'

�������� � ������� ���������� ��� ������ ���������� `mysql.so', -L/usr/lib/gcc-lib/... -lgcc (����� ��������� ����� �� make ��� `mysql.so' ��� ���������� ������� Perl). ����� -L ������ ��������� ���� � ��������, ��� ��������� `libgcc.a' � ����� �������.

��� ���� ������� ��������� ������ ����� ����������� � ���, ��� ��� ������ - Perl � MySQL �� �������������� ������ ������������ gcc. � ���� ������ ������ �������������� ����� ���������, ������������� ��� ������ ������������ gcc.

���� ��� ���������� ������ �� ��������� �� ������ Msql-Mysql-modules ��������� ������:

t/00base............install_driver(mysql) failed:
Can't load '../blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
../blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:
uncompress at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm line 169,

�� ��� ��������, ��� � ������ ���������� ���������� �������� ���������� ������ -lz. ��� ����� ���������� ������ ��������� ��������� � ���� `lib/DBD/mysql/Install.pm':

$sysliblist .= " -lm";

��

$sysliblist .= " -lm -lz";

����� ����� ���������� ��������� ������� make realclean � ����� ��������� ������� ����������� �������.

���� �� ������ ������������ ��� ������ � �������, ������� �� ������������ ������������� ���������� (����� Caldera/SCO), �� ����� ������������� ����������� ������ Perl, ���������� DBIDBD-mysql. ��� ����� �������� ��������� �������: ����� ������� ������ Perl, ������������ � ����� DBI, � ���������� �� ������ �������� Perl. ����� ��� ������ ������������ ��� ������ ������ Perl, ������� ������������� �������� ������������ ��� DBD, ��������������� ��� ���.

� ������������ ������� Caldera (SCO) ���������� ����� ��������� ����� ���������� ���������:

shell> LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/progressive/lib
���
shell> LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:\
       /usr/progressive/lib:/usr/skunk/lib
shell> LIBPATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:\
       /usr/progressive/lib:/usr/skunk/lib
shell> MANPATH=scohelp:/usr/man:/usr/local1/man:/usr/local/man:\
       /usr/skunk/man:

������� ������� ������� ������ Perl, ���������� ���������� ������������ DBI. ��� �������� ����� ���������� ��������� ������ � ��������, ��� ������������� ����������� DBI:

shell> perl Makefile.PL -static -config
shell> make
shell> make install
shell> make perl

����� ���������� ���������� ����� ������ Perl. ����� ������� make perl ������ ������ ������� make, ������� ���������� ����� ��������� ��� ���������� ���������. ��� Caldera (SCO) ��� ����� ������� make -f Makefile.aperl inst_perl MAP_TARGET=perl.

����� ����� ������������ ������ ��� ��������� ������ Perl ��� �������� ��� ������ ������ Perl, ������� ����� �������� � ���� ���������� ������������ ������ DBD::mysql. ��� �������� ����� ���������� ��������� ������ � ��������, ��� ������������� ����������� Msql-Mysql-modules:

shell> perl Makefile.PL -static -config
shell> make
shell> make install
shell> make perl

� � ���������� �������� ���������� ���� ����� ������ Perl. ����� ������� ��� ����� ������������, �� ����� ������� �� ������ make perl.


Go to the first, previous, next, last section, table of contents.