MySQL の最新ニュースを読むために、いつでも MySQL のホームページ をチェックでき ます。
しかし TcX のインターネット接続はそんなに速くないので、実際には下記のミ ラーの一つからダウンロードする方が良いでしょう。
ヨーロッパ:
北アメリカ:
アジア:
オーストラリア:
最初の決定は、あなたが最新の開発リリースを使用したいのか、または最新の安 定リリースを使用したいのかです。
通常は、あなたが開発を開始するのなら、開発リリースで行うことを勧めます。 開発リリースには普通は本当に悪いバグはなく、あなたのマシン上で、crash-me とベンチマークテストで簡単にテストできるからです。 「MySQL benchmark suite」節参照 。
2番目の決定は、ソースを欲しいかバイナリリリースを欲しいかです。
あなたが現在バイナリリリースがあるプラットフォーム上で MySQL の 実行を望むのなら、それを使用してください。MySQL のバイナリバー ジョンの方がインストールは簡単です。
MySQL を作る C と C++ コードを読みたい(そして/または変更したい) 場合は常にソース配布を入手するべきです。コードはいつでも究極のマニュアル です。ソース配布はまたバイナリ配布よりも多くのテストと例を含んでいます。
我々の名前付けの計画を明確にします:
MySQL の全てのバージョンは、我々の標準テストと、比較的安全な使 用を保証するベンチマークを通して実行されます。標準テストは以前に見つけら れた全てのバグをテストするため、whole time は大きくなります。そのためよ り良い whole time を得ます。
MySQL リリース番号は3つの数値と拡張子からなります。
そして mysql-3.21.17-alpha-beta
のようなリリース名は次の意味にな
ります。
全てのリリースは少なくても次のテストがされていることに注意してください:
他のテストは我々の内部製品です。我々は通常最新のバージョンを(少なくとも 一つのマシンで)このために使用し、動作のため 100Gbyte 以上のデータを持ち ます。
我々は MySQL の更新時には次のポリシーを使用しています:
それぞれのマイナーアップデートは、バージョン文字列中の最後の数値を増加さ せます。主要な新機能や前のバージョンとのマイナーな非互換があった時には、 バージョン文字列中の2番目の数値が増加されます。ファイル形式が変更した時、 最初の数値が増加します。
我々は GNU autoconf を使用していますので、MySQL は POSIX スレッ ドと C++ コンパイラが動作する全ての新しいシステムに移植可能です。クライ アントコードは C++ を必要としますが、スレッドは必要ではありません。我々 は自身のソフトウェアを、最初に Sun Solaris (現在は 2.5 & 2.6) 上で、いく つかは RedHat Linux 5.0 上で使用/開発しています。
次の OS/スレッドパッケージは、MySQL のコンパイル成功が報告され ています。多くの OS では、ネイティブスレッドは最新バージョンで働くことに 注意してください。
必要なもの:
gzip
。配布の伸張のため。
tar
。配布の展開のため。GNU tar
は働くことが知られて
います。
C++
コンパイラ。gcc >= 2.7, SGI C++, SunPro C++ は働くことが
知られています。libg++
は gcc
使用時には必要ではありません。
make
プログラム。問題があれば GNU make
を試すことをお
勧めします。
ディレクトリ内で tar アーカイブの展開。tar ファイルは mysql-VERSION.tar.gz (VERSION は 3.21.31 のような番号です) のような名前です。mysql-VERSION という名前のディレクトリが作成されます。
zcat mysql-VERSION.tar.gz | tar xvf -
cd mysql-VERSION
./configure
make
make install
./scripts/mysql_install_db
'installation_directory'/bin/mysqladmin version
mysqladmin Ver 6.3 Distrib 3.21.17, for pc-linux-gnu on i686 TCX Datakonsult AB, by Monty Server version 3.21.17-alpha Protocol version 10 Connection Localhost via UNIX socket TCP port 3306 UNIX socket /tmp/mysql.sock Uptime: 16 sec Running threads: 1 Questions: 20 Reloads: 2 Open tables: 3
MySQL をリコンフィグした場合は、新しい configure を行う前に
rm config.cache
または make distclean
を行う必要があること
を覚えていてください。
GNU make
は常に推奨され、時々は必要とされます。
--without-server
を使用
します。クライアントライブラリだけを持ちたくて C++ コンパイラを持ってい
ない場合、C++ コンパイラをテストする(ソース配布内の) configure 内のコー
ドを削除できます。そして --without-server でコンパイルします。この場合、
mysql.cc
(C++ を必要とする MySQL クライアント) に関する
warning は無視してください。
--prefix=/usr/local
または
--prefix=/usr/local --localstatedir=/usr/local/data/mysql
--with-unix-socket-path=absolute_file_name
を使用します。
Internal compiler error: program cc1plus got fatal signal 11
また
は Out of virtual memory
次の configure スイッチを試せます:
--with-low-memory
。これは gcc を使用する場合は -fno-inline
を、他のものを使用する場合は -O0 をコンパイル行に追加します。問題は、
sql_yacc.cc のインライン関数でのコンパイルに gcc が約 180M を要求するこ
とです。
LDFLAGS=-static ./configure
で configure してください。
CC=gcc CXX=gcc ./configure
DEFAULT
値を使用したくなくて、全ての NOT NULL
項目
を使用しない INSERT
についてエラーを得たい場合、
CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure
で configure して
ください。
--with-charset=charset
によっ
て変更できます。
[charset] は次の一つです: big5
, czech
, dec8
,
dos
, german1
, hp8
, koi8_ru
, latin1
,
latin2
, swe7
, usa7
ujis
または sjis
。
「データとソートに使用される文字セット」節参照
サーバとクライアント間で文字を変換したい場合は、SET OPTION
CHARACTER SET
を見てください。 「SET OPTION 構文」節参照 。
警告: テーブル生成後に文字セットを変更する場合、全てのテーブルに
isamchk -r -q
を行う必要があります。そうしなければ、いくつかの場
合(すべてではない!)、データは不正に格納されます。
時々メーリングリスト上にパッチが現れます。それらを適用するには次のような ことを行います:
cd 'old-mysql-source-distribution-path' gunzip < patch-file-name.gz | patch -p1 rm config.cache make clean
そしてそれから通常のソースインストール指示を ./configure
の段階か
ら追いします。
そしてあなたの MySQL サーバを再起動します。
コンパイルが次のように失敗した場合:
configure: error: installation or configuration problem: C++ compiler cannot create executables.
環境変数 CXX
を "gcc -O3"
に設定してみてください
(gcc
を使用している場合)。例えば CXX="gcc -O3" ./configure
。
これを使用する場合、libg++ をインストールしておく必要ありません。
g++, libg++, libstdc++ を使用して問題があった場合は、 上記の configure によっておそらくこれらをいつも解決できるでしょう!
libg++ をインストールすることもできます。デフォルトの `configure'
は c++
をコンパイラ名として使用し、そして GNU c++
は
-lg++
をリンクします。
making all in mit-pthreads make: Fatal error in reader: Makefile, line 18: Badly formed macro assignmentこれは、あなたの make を GNU
make
にアップグレードする必要がある
ことを意味します。
CC="gcc -O4" CXX="gcc -O4" export CC CXX
make
が Can't find Makefile.PL
で止まった場合、GNU
make
を使用してみるべきです。Solaris と FreeBSD は厄介な
make
プログラムを持っていることが知られています。
pthread.h: No such file or directory
これは make
を GNU make
にアップグレードする必要があること
を意味します (GNU make
versoin 3.75 は働くことが知られています)。
client/libmysql.c:273: parse
error before `__attribute__'
これは gcc コンパイラ (2.7.2 は働くことが知られています) をアップグレー
ドする必要があることを意味します。
mysqlbug
を使用してください。 「バグを見つけたと思う。私を助けるためにあなたが必要な情報は?」節参照 。
問題がバグでないとしても、mysqlbug はあなたの他の問題を解決するのを助け
るようないくつかのシステム情報を収集します!
configure --with-debug=yes
そしてあなたのクライアントを
新しいクライアントライブラリとリンクしてください。
クライアントを実行する前に、次を行います:
MYSQL_DEBUG=d:t:O,/tmp/client.trace export MYSQL_DEBUGこれでトレースファイル `/tmp/client.trace' が得られます。
cxx: Error: mysqld.cc, line 645: In this statement, the referenced type of the pointer value "&length" is "unsigned long", which is not compatible with "int". new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);それは configure が、
accept()
, getsockname()
そして
getpeername()
の最後の引数の型を決定できませんでした。次の行の後
を検索してください:
/* Define as the base type of the last arg to accept */ #define SOCKET_SIZE_TYPE ###そして ### を、あなたの OS に依存して size_t または int に変更してくださ い。
mysql --debug=d:t:o,/tmp/client.trace
でテストしてください。
「バグを見つけたと思う。私を助けるためにあなたが必要な情報は?」節参照 。
全ての MySQL プログラムは(gcc 使用の Solaris 上で)綺麗に(警告無 しで)コンパイルします。しかし異なるシステム include ファイルのため、警告 が現れることがあります。mit-pthreads 使用時に発生する警告については次を 見てください。
sql_yacc.yy をコンパイルするためには bison を使用する必要があるでしょう。 次のようなエラーを得た場合:
"sql_yacc.yy", line xxx fatal: default action causes potential...
bison (GNU yacc) をインストールする必要があります。MySQL は既に コンパイルされた sql_yacc.cc ファイル付きなので、通常はこれを行う必要は ありません。
スタティックリンクされたコードを持ちたい場合、(gcc で) 次を使用します:
LDFLAGS="-static" ./configure ...
You can on most systems force the usage of mit-pthreads with the configure
switch --with-mit-threads
.
Building in a non source directory is not supported when using MIT-threads. This is because we want to keep our changes to this code minimal.
MIT-pthreads doesn't support the AF_UNIX
protocol so we must use
the TCP/IP protocol for all connections (which is a little slower). If
you can't connect to a table, try using the host (-h
or
--host
) switch to mysql
. This must be done if you have
compiled the client code --without-server
because the default
connection is to use Unix sockets.
MySQL compiled with MIT threads has system locking disabled by
default for performance reasons. One can start the server with system
locking with the --use-locking
switch.
Sometimes (at least on Solaris) the pthread bind()
command fails
to bind to a socket without any error message. The result of this is
that all connections to server fails.
> mysqladmin ver mysqladmin: connect to server at '' failed; error: 'Can't connect to mysql server on localhost (146)'
The solution to this is to kill the mysqld
daemon and restart it.
This has only happened to us when we have forced the daemon down and done
a restart immediately.
sleep()
isn't interruptible with SIGINT
(break) with
MIT-threads. This is only notable in mysqladmin --sleep
. One must
wait for the end of the sleep()
before the interrupt is served
and the process stops.
We haven't got readline to work with MIT threads. (This isn't needed, but may be interesting for someone)
When linking (at least on Solaris) you will receive warning messages like:
ld: warning: symbol `_iob' has differing sizes: (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140); /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken ld: warning: symbol `__iob' has differing sizes: (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140); /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
Some other warnings which also can be ignored:
implicit declaration of function `int strtoll(...)' implicit declaration of function `int strtoul(...)'
The included perl client code requires perl5.004 or later.
If you got a the following error (from mysqlperl or DBD-mysql):
/usr/bin/perl: can't resolve symbol '__moddi3' /usr/bin/perl: can't resolve symbol '__divdi3'
You are probably using gcc (or using an old binary compiled with
gcc). Add -L/usr/lib/gcc-lib/... -lgcc
to the link command when
the mysql.so library gets build (check the output for mysql.so when you
compile the perl client).
-L/...
is the path to the directory where libgcc.a
exists.
Another problem may be that perl and MySQL isn't both compiled with gcc. In this case you can solve this by compile everything with gcc.
If you want to use the perl module on a system that doesn't support dynamic linking (like SCO) you can always make a static version of perl with DBI and DBD-mysql:
First you create a statically linked DBI by doing:
perl Makefile.PL LINKTYPE=static make make install make perl
After this you must install the new perl. The output of make perl
will
contain the exact make command! On SCO this is
make -f Makefile.aperl inst_perl MAP_TARGET=perl
Next you create a statically linked DBD::mysql:
perl Makefile.PL LINKTYPE=static make make install make perl
You should also install the new perl (see the DBI perl installation above).
Sun native threads only work on Solaris 2.5 and higher. For 2.4 and earlier versions, you can use MIT-pthreads. 「MIT-pthreads notes. (FreeBSD)」節参照 .
If there are too many processes that try to connect very rapidly to the
mysqld
one will get Error in accept : Protocol error
in
the mysql log.
If you have the Sun Workshop 4.2 compiler you can configure with:
CC=cc CFLAGS="-Xa -fast -xstrconst -mt" CXX=CC CXXFLAGS="-xsb -noex -fast -mt"
./configure
You may also have to change the row in configure:
#if !defined(__STDC__) || __STDC__ != 1
to #if
!defined(__STDC__)
because if you turn on __STDC__
with the
-Xc
switch, the Sun compiler can't compile with the Solaris
`pthread.h' header files anymore. This is a Sun bug (Broken
compiler or broken include file).
If the compiled mysqld
gives a error like: libc internal
error: _rmutex_unlock: rmutex not held
you have tried to compile
MySQL with the Sun compiler without enabling the multi thread switch
-mt
. Add -mt
to CFLAGS and CXXFLAGS and try again.
If you get the following error when compiling MySQL with gcc:
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'
This means that your gcc is not configured for your version of Solaris! The proper thing to do in this case is to get the newest egcs or gcc version and compile this with your current gcc compiler! At least for Solaris 2.5, almost all binary versions of gcc have old, unusable include files that will break all programs that use threads (and possible other programs!)
The tar in Solaris can't handle long file names; You may get the following error (or something similar) when unpacking the MySQL distribution:
x mysql-3.21.21a-beta-sun-solaris2.6-sparc/perl/Mysql-modules/blib/lib/auto/Msql-Mysql-modules, 0 bytes, 0 tape blocks tar: directory checksum error
In this case you have to use gnu tar to unpack the distribution. You can find copy of precompiled gnu tar (gtar) for Solaris at http://www.mysql.com/Downloads/
On SunOS 4, MIT-pthreads is needed. You must have GNU make
to compile
(because of MIT-pthreads).
In readline you may get warnings about duplicate defines. These may be ignored.
When compiling mysqld there will be some warnings about implicit
declaration of function
. These may be ignored.
On Linux you should use the --skip-locking
flag to mysqld
if you start it yourself. Normally the demon is started by safe_mysqld
and the flag is added automatically. This flag is needed because a bug
in Linux file locking calls. This bug is known to exist as recently as
Linux version 2.0.33.
If you can't start mysqld or if mysql_install_db doesn't work, please continue reading! This only happens on Linux system with problems in the Linuxthreads or libc/glibc library. There is a lot of simple workarounds to get MySQL to work! The simplest is to use the binary version (not the RPM) of MySQL for Linux x86; One nice aspect of this version is that it's probably 10% faster than any version you would compile yourself! 「MySQL の速度に影響するコンパイルとリンク方法」節参照
When using LinuxThreads you will see a minimum of three processes running. These are in fact threads. There will be one thread for the Linux Threads manager, one thread to handle connections, and one thread to handle alarms and signals.
if you are using RedHat you might get errors like:
/usr/bin/perl is needed... /usr/sh is needed... /usr/sh is needed...
If so upgrade rpm itself to rpm-2.4.11-1.i386.rpm & rpm-devel-2.4.11-1.i386.rpm (or later versions).
You can get the 4.2 updates from ftp://ftp.redhat.com/updates/4.2/i386. Or http://www.sunsite.unc.edu/pub/Linux/distributions/redhat/code/rpm/ for other distributions.
LinuxThreads should be installed before configuring MySQL!
MySQL requires libc version 5.4.12 or newer. glibc version 2.0.6 and later should also work. There has been some problems with the glibc rpms from RedHat so if you have problems, check if there are any updates!
On some older Linux distributions configure
may give a error
about: Syntax error in sched.h. Change _P to __P in the
/usr/include/sched.h file.\
See the Installation chapter in the Reference Manual
. Just do what the
error says and add a extra underscore to the _P
macro that only
has one underscore. Then try again.
You may get some warnings when compiling: (these can be ignored)
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'
If you want in Debian GNU/Linux to get MySQL to auto start when system boots, do the following:
> cp scripts/mysql.server /etc/init.d/mysql.server > /usr/sbin/update-rc.d mysql.server defaults 99
If mysqld always core dumps when starting, the problem may be that you have an old `/lib/libc.a'. Try renaming this, remove sql/mysqld and do a new make install and try again. This problem has been reported on some Slackware installations. RedHat 5.0 has also a similar problem with some new glibc versions. More about this later.
If you install all the official redhat patches (including glibc-2.0.6-9 and glibc-devel-2.0.6-9) it should work out of the box (se above for how to configure).
The updates are needed since there is a bug in glibc 2.0.5 in how pthread_key_create variables are freed. With glibc 2.0.5 you must use the static-linked MySQL binary distribution. If you want to compile from source you must install the corrected version of Linuxthreads from http://www.tcx.se/Downloads/Linux or upgrade your glibc.
If you have a wrong glibc or linuxthread version the symptom is that
mysqld crashes after each connections. For example mysqladmin version
will crash mysqld when it finishes!
Another symptom of wrong libraries is that mysqld crashes at once when it
starts. One some Linux systems this can be fixed by configuring with
LDFLAGS=-static ./configure
. On some RedHat 5.0 system it will only
work WITHOUT LDFLAGS=-static
. This is known to happen even with
new versions as glibc 2.0.7-4 !
For the source distribution of glibc 2.0.7 you can find a patch at
http://www.tcx.se/Download/Linux/glibc-2.0.7-total-patch.tgz
that is easy to apply and is tested with MySQL
!
If you experience crashes like these when you build MySQL, you can always download the newest binary version of MySQL. This is compiled staticly to avoid library conflicts and should work on all Linux systems!
If you want to compile this yourself, check how to debug mysqld! As MySQL comes with an internal debugger its very easy to get a trace file that probably will help solve your problem very quickly! 「MySQL のデバッグ」節参照
In some implementations readdir_r
is broken. This will be
noticed when SHOW DATABASES
always returns an empty set. This
can be fixed by removing HAVE_READDIR_R
from `config.h'.
Some problems will require patching your Linux installation. The patch can be found at http://www.tcx.se/patches/Linux-sparc-2.0.30.diff. This patch is against the Linux distribution `sparclinux-2.0.30.tar.gz', that is available at vger.rutgers.edu. This is a version Lf linux which was never merged with the official 2.0.30. You must also install linuxthreads 0.6 or newer.
Thanks to jacques@solucorp.qc.ca for the above information.
The first problem is linuxthreads. You must patch linuxthreads for alpha because the RedHat distribution uses an old (broken) linuxthreads version.
CC=gcc CCFLAGS="-Dalpha_linux_port" CXX=gcc CXXFLAGS="-O3 -Dalpha_linux_port" ./configure --prefix=/usr/local/mysql
Note that Alpha-Linux is still an alpha platform for MySQL. With RedHat 5.0 and the patched linuxthreads you have a very good chance of it working.
When compiling threaded programs under Digital UNIX using CC / CXX the
documentation recommends the switch to cc and cxx and the libraries
-lmach -lexc
(in addition to -lpthread
).
So you have to configure with something like this:
CC="cc -pthread" CXX="cxx -pthread -O" ./configure
-with-named-thread-libs="-lpthread -lmach -lexc -lc"
When compiling mysqld you will may this warning for mysqld for a couple of lines:
mysqld.cc: In function void handle_connections()': mysqld.cc:626: passing long unsigned int *' as argument 3 of accept(int,sockad ddr *, int *)'
You can safely ignore these. This is because configure can't detect warnings, only errors.
You may get problems with the server exiting directly. If so, try
starting it with nohup safe_mysqld [options]
nohup
is a command that ignores any SIGHUP
sent from the
terminal.
If you have problems compiling and have Dec CC and gcc installed you can try the following compile line (with sh or bash):
CC=cc CFLAGS=-O CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
On OSF1 V4.0D and compiler "DEC C V5.6-071 on Digital UNIX V4.0 (Rev. 878)" the compiler had some strange behaviour (One gets undefined 'asm' symbols). /bin/ld appears also to be broken (one gets _exit undefined when linking mysqld). On this we have managed to compile MySQL with the following configure line, after replacing /bin/ld from OSF 4.0C:
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
In some versions of OSF1, the alloca()
functions is broken. Fix
this by removing 'HAVE_ALLOCA'
from config.h.
The alloca()
function can also have a wrong prototype in
/usr/include/alloca.h
. This warning can be ignored.
Configure will automaticly use the following thread libraries:
-with-named-thread-libs="-lpthread -lmach -lexc -lc"
When using gcc you can also try to use:
CFLAGS=-D_PTHREAD_USE_D4 CXX=gcc CXXFLAGS=-O3 ./configure ....
You may have to undefine some things in `config.h' (generated by `./configure').
In some Irix implementations the alloca()
function is broken. If
the mysqld server dies on some selects, remove HAVE_ALLOC
&
HAVE_ALLOCA_H
from `config.h'. If mysqladmin create doesn't
work, remove HAVE_READDIR_R
from config.h. Also you may have to
remove HAVE_TERM_H
.
Irix 6.2 doesn't support POSIX threads out of of the box. You have install these patches, available from SGI if you have support:
1403, 1404, 1644, 1717, 1918, 2000, 2044
If you get the something like the following error when compiling mysql.cc:
"/usr/include/curses.h", line 82: error(1084): invalid combination of type
Type the following in the mysql installation directory:
> extra/replace bool curses_bool < /usr/include/curses.h > include/curses.h > make
There have also been reports about scheduling problems. This is because if only one thread is running, things go slow. Avoid this by starting another client. This may lead to a 2-10 fold increase in execution speed thereafter for the other thread.
This is a poorly-understood problem with IRIS threads, so you may have to improvise to find solutions until this can be fixed.
If you are compiling with gcc, you can use the following configure line:
CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-thread-safe-client
If you get a error on 'make install' that it can't find /usr/include/pthreads, configure didn't detect that one neads mit-threads on FreeBSD. This is fixed by doing:
rm config.cache ./configure --with-mit-threads
If you get link errors when compiling mysqlperl (Type
ient.a(my_getwd.o): RRS text relocation at 0x9a9f for
"__db_pargs_"
)
You must recompile the Perl code with -DPIC -fpic
.
Do the following:
CFLAGS = -g -O2
to
CFLAGS = -O2 -DPIC -fpic
cd client
rm *.o
make libmysqlclient.a
cd ../perl
make
This shall hopefully be handled automatically in the future.
The FreeBSD make
behaviour is slightly different from GNU
make
. If you have a problem that `perl/Makefile'
doesn't get generated, you should install GNU make
.
If mysql or mysqladmin takes a long time to respond, a user said the following:
Are you running the ppp user process? On ine FreeBSD box (2.2.5) MySQL clients takes a couple of seconds to connect to mysqld if the ppp process is running.
FreeBSD is also known to have a very low default file handle limit. 「File not found」節参照
If you have a problem that select NOW() returns GMT and not your local time,
you have to set the TZ
environment variable to your current timezone.
Make sure that you modify the /etc/hosts
file so that the
localhost
entry is correct (else you will have problems
connecting to the database).
If you are using FreeBSD 2.2.26:
Don't forget to apply the ttcp and mmap-22 patches to the OS (for security reasons). Please see http://www.freebsd.org for these CERT patches.
You have to configure with:
--with-named-thread-libs=-lc_r
The pthreads library for FreeBSD doesn't contain the sigwait
function and there is some bugs in it. To fix this, get the
`FreeBSD-3.0-libc_r-1.0.diff' file and apply this in the
`/usr/src/lib/libc_r/uthread' directory. Follow after this the
instructions that can be found with man pthread
about how to
recompile the libc_r
library.
You can test if you have a 'modern' libpthread.a
with:
> nm /usr/lib/libc_r.a | grep sigwait.
If the above doesn't find sigwait
you have to use the above patch
and recompile libc_r
.
From Jan Legenhausen jleg@csl-gmbh.net.
I finally got mysqlperl working on BSDI2.1.
What i did was almost nothing:
GCC="shlicc2"
per default;
perl5 automagically uses shlicc2 - you should use _one_ version (either
gcc
or shlicc2
) for both Mysql.c
and
libmysqlclient.a
!)
rm *.o
gmake libmysqlclient.a
cd ../perl/mysqlperl
make clean
$sysliblist=" -L$tmp -lgcc -lcompat";
to Makefile.PL line 45
(just to be sure - i didn't check if one could leave out this one)
perl Makefile.PL
libmysqlclient.a
's in /usr/lib
and
/usr/contrib/lib
make install
If you get the following error when compiling MySQL:
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
Then your ulimit for virtual memory is too low. Try using: ulimit
-v 80000
and do make
again.
If you are using gcc you can also add the flag '-fno-inline' to the compile line when compiling sql_yacc.cc.
If you have a problem that select NOW() returns GMT and not your local time,
you have to set the TZ
environment variable to your current timezone.
env CXX=shlicc++ CC=shlicc2 ./configure --prefix=/usr/local/mysql --localstatedir=/var/mysql --without-perl --with-unix-socket-path=/var/mysql/mysql.sockThe following is also known to work:
env CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/var/mysql/mysql.sock
You can change the directory locations if you wish, or just use their defaults by not specifying them.
The current port is only tested on a 'sco3.2v5.0.4' system. There has also been a lot of progress on a port to 'sco 3.2v4.2'.
as
.
make
when making MySQL.
CFLAGS="-D_XOPEN_XPG4" CXX=gcc CXXFLAGS="-D_XOPEN_XPG4" ./configure --with-debug=yes --prefix=/usr/local/mysql --with-named-thread-libs="-lgthreads -lsocket -lgen -lgthreads" --with-named-curses-libs="-lcurses" --without-perlYou may get some problems with some include files. In this case you can find new SCO specific include files at: ftp://www.tcx.se/pub/mysql/Downloads/SCO/SCO-3.2v4.2-includes.tar.gz. You should unpack this in the mysql-source-distributions/include directory!
SCO development notes:
-lgthreads -lsocket -lgthreads
When using the IBM compiler, something like this is needed:
CC="xlc_r -ma -O3 -qstrict" CXX="xlC_r -ma -O3 -qstrict" ./configure
Automatic detection of xlC is missing from autoconf.
There is a couple of 'small' problems when compiling mysql on HPUX. Below we describe some problems and workarounds when using the HPUX compiler and gcc 2.8.0 .
gcc 2.8.0 can't compile readline on HPUX (internal compiler error). mit-pthreads can't be compiled with HPUX compiler, because it can't compile .S (assembler) files.
We got MySQL to compile on HPUX 10.20 by doing the following:
CC=cc CFLAGS="+z +e -Dhp9000s800 -D__hpux__" CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory cd mit-pthreads rm config.cache CC=gcc CXX=gcc ./configure cd .. make make install scripts/mysql_install_db
The MySQL-win32 version has by now proven itself to be very stable. The MySQL-win32 version has all the features as the corresponding Unix version of MySQL with the following exceptions:
ALTER TABLE
ALTER TABLE
on file if it is hold open by another thread
or the table cache. On MySQL-win32 I have added code to close the
file owned by the thread that does ALTER TABLE
but MySQL
can't yet close the the file descriptors used by other threads. We have to do
a major recode of the file lock system to handle this. For now, when using
ALTER TABLE
, one must be sure that no other threads are using the table.
One can be sure of this by doing a 'mysqladmin refresh' before doing an
ALTER TABLE
.
Increasing the table cache
Win95 and threads
Other win32 specific issues are described in the README file that comes with the MySQL-win32 distribution.
Please always use the mysqlbug script when posting questions to the mailinglist (mysql@tcx.se). Even if the problem isn't a bug, mysqlbug gathers some system information that will help other solve your problem! 「バグを見つけたと思う。私を助けるためにあなたが必要な情報は?」節参照 .
> cd /usr/local > zcat /<where ever you put it>/mysql-3.20.0-SunOS5.tgz | tar xvf - > ln -s mysql-VERSION mysql
> scripts/mysql_install_db「mysql_install_db 実行時の問題」節参照 If you want to change things in the grant tables after installing you should use
mysql -u root mysql
to connect to the grant tables
as the 'root' user.
The mysql_install_db
script also starts the mysqld
daemon.
> bin/safe_mysqld --log &
> bin/mysqladmin verThat should print something like this. The exact output depends on you platfrom and use.
bin/mysqladmin Ver 6.3 Distrib 3.21.15-alpha, for SOLARIS 2.5 on SPARCstation TCX Datakonsult AB, by Monty Server version 3.21.15-alpha Protocol version 9 Connection Localhost via UNIX socket TCP port 3306 UNIX socket /tmp/mysql.sock Uptime: 2 days 1 hour 42 min 3 sec Running threads: 2 Questions: 450378 Reloads: 17 Open tables: 64
cd perl/DBI perl Makefile.PL make make install cd ../Mysql-modules perl Makefile.PL make make install
You should use the safe_mysqld
script to the server.
safe_mysqld
expects one of two conditions to be true:
/usr/local/mysql
)
/my/
. To get it to run correctly,
you should cd to /usr/local/mysql
and then execute
safe_mysqld
or modify the script so that it expects the base
mysql directory to be `/usr/local/mysql' rather than the default
`/my/'.
When you execute this:
> bin/mysqld --help
You will get the options for mysqld (and safe_mysqld) and the current
paths. Normally you only should need to change the
--basedir=path
. You can test the path switches by executing:
> bin/mysqld --basedir=/usr/local --help
If you would like to use mysqlaccess and have the mysql distribution in
some nonstandard place, you must change the path to mysql in
mysqlaccess. bin/mysqlaccess
about line 308:
$MYSQL = '/usr/local/bin/mysql --batch --unbuffered';
If you don't change the path, you will get a 'broken pipe' error when using mysqlaccess.
If you would like MySQL to start when you boot your machine,
you can copy bin/mysql.server
to where your system has it startup
files. More information can be bound in the bin/mysql.server script
itself.
CC=gcc CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS=-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors" LDFLAGS=-static ./configure --prefix=/usr/local/mysql -enable-assemblerAll of the above is typed as one long line!
The binary distribution of MySQL for HP/UX is distributed as an HP depot file. This means that you must be running at least HP/UX 10.x to have access to HP's software depot tools.
This version of MySQL was compiled on an HP 9000/8xx server under HP/UX 10.20, and uses MIT Pthreads. It is known to work well under this configuration. This version does not use HP's native thread package. It is highly unlikely that MySQL will use HP native threads on anything but HP/UX 10.30 or later.
Other configurations that may work:
9000/7xx - HP/UX 10.20+ 9000/8xx - HP/UX 10.30 (does not use HP native threads)
The following configurations almost definitely won't work:
9000/7xx or 8xx - HP/UX 10.x where x < 2 9000/7xx or 8xx - HP/UX 9.x
To install (everything, including server, client and development tools):
/usr/sbin/swinstall -s <full path to the depot file> mysql.full
To install server only:
/usr/sbin/swinstall -s <full path to the depot file> mysql.server
To install client pack only:
/usr/sbin/swinstall -s <full path to the depot file> mysql.client
To install development tools only:
/usr/sbin/swinstall -s <full path to the depot file> mysql.developer
The depot will place binaries/libraries in /opt/mysql and data in /var/opt/mysql. The depot will also create the appropriate entries in /sbin/init.d and /sbin/rc2.d to automatically start the server on boot. This obviously entails being root to install.
Clients have to be linked with: -lmysqlclient
デフォルト特権では、だれでも test
という名前、または test_
で始まる名前のデータベースを作成/使用できます。root
は全てを行え
ます。 「特権システムがどのように働くか?」節参照 。
デフォルトを変更するには、そのスクリプトを実行する前に編集します。これが
MySQL の初めてのインストールであれば、このコマンドを実行する必
要があります。これを行わなければ次のエラーを得るでしょう: Can't
find file: './mysql/host.frm'
。このスクリプトは、初回時には mysqld デー
モンも開始します。
インストール後に承認テーブル内を変更したい場合は、'root' ユーザとして承
認テーブルに接続するために mysql -u root mysql
を使用してください。
通常の MySQL サーバデーモンを開始する(初回時には必要ありません)
には: 'installation_directory'/bin/safe_mysqld --log
mysql_install_db
が特権テーブルをインストールせずに、次で終わるこ
とがあります:
Starting mysql server starting mysqld demon with databases from xxxxxx mysql demon ended
この場合、xxxxxx ディレクトリ内のログをかなり慎重に検査すべきです! これ は mysqld が開始しなかった理由を含んでいます。何が起こったかを理解できな い場合は、バグレポートを mysqlbug を使って投稿する時に、少なくともログを 含めるべきです。
mysql_install_db
実行時に起こりうる問題は:
既に動いている mysqld デーモンがある。
二番目の mysqld デーモンのインストールは、他のデーモンが実行中は働かない。
MYSQL_UNIX_PORT=/tmp/mysqld-new.sock MYSQL_TCP_PORT=3307 export MYSQL_UNIX_PORT MYSQL_TCP_PORT scripts/mysql_install_dbこの後、異なるソケットとポートでデーモンを開始するようにサーバのブートス クリプトを編集すべきです (safe_mysqld --socket=... --port=....)。
mysqld が突然クラッシュする。
MySQL
メールアーカイブ中にこれについての情報が多くあります。
「Linux notes for all versions」節参照
サーバに接続できない (mit-threads 使用時)
mysql_install_db
がサーバに接続できないときは、`/etc/hosts'
ファイル中に次のようなエントリがあることをチェックすべきです:
127.0.0.1 localhost上記はスレッドライブラリを持たないシステムで、MySQL が mit-threads を使用する必要がある時だけでの問題です。
(/tmp に?)ソケットファイルの生成するための書き込み権がない
mysqld --help
で mysqld が使用するパスと変更方法についての情報を
得ることができます。次を行うことで、safe_mysqld にパスを指定することもで
きます:
MYSQL_UNIX_PATH=/some_directory_for_tmp_files/mysqld.sock MYSQL_TCP_PORT=3306 TMPDIR=/some_directory_for_tmp_files/ export MYSQL_UNIX_PATH MYSQL_TCP_PORT TMPDIR scripts/mysql_install_db or bin/mysqld --skip-grant bin/mysql -u root mysqlこの後、mysql_install_db 内の sql コマンドを実行できます。
パスが mysqld が期待するものと異なる。
mysqld --help
を使用してください。bin/safe_mysqld を編集して、あ
なたのインストールのパスを反映できます。
全てが働くかを調べる簡単なテストは:
bin/mysqladmin version
mysqld が正常に開始したかどうかを見るには、ログファイルをチェックしてく ださい。
mysqld
デーモンは 'mysql-data-dir' へ cd して開始します。この後、
mysqld-data-dir が './' (カレントディレクトリ) に変更されます。全てのパ
ス (データベース, pid ファイル, そしてログファイル) はこのディレクトリを
ベースパス './' とします。何らかの正しくないパスの問題がある場合は、あな
たのカレントパスを見るために mysqld --help
を試して下さい。全ての
パスは、safe_mysqld
または mysqld
への開始オプションによっ
て変更できます。
cd <localstatedir default /usr/local/var> tail <your host name>.log
MySQL が動いていることを確かめるには、次のテストを実行してくだ さい:
> cd /usr/local/bin > ./mysqlshow +-----------+ | Databases | +-----------+ | mysql | +-----------+ > ./mysqlshow mysql Database: mysql +--------+ | Tables | +--------+ | db | | host | | user | +--------+ > ./mysql -e "select host,db,user from db" mysql +------+--------+------+ | host | db | user | +------+--------+------+ | % | test | | | % | test_% | | +------+--------+------+
ベンチマークスイートもあるので、異なるプラットフォーム上で MySQL 性能を比較できます。近い将来、MySQL を他の SQL データベースと比較できるようにもなります。
> cd bench > run-auto-increment-test
test サブディレクトリ内のテストを実行することもできます。 `auto_increment.tst' を実行するには:
./mysql -vf test < ./tests/auto_increment.tst
期待される結果はファイル `./tests/auto_increment.res' 内に見られま す。
safe_mysqld スクリプトは、わずかに異なるパスだったとしても、mysqld のソー スとバイナリバージョンを開始できるように書かれています!
インストールディレクトリから safe_mysqld を開始する限り、あなたはどこに でも MySQL のバイナリリリースをインストールできます:
cd mysql_installation_directory bin/safe_mysqld &
mysqld の開始オプションを変更したい場合は、いつでも safe_mysqld を編集で きます! この場合、いつか MySQL のアップグレードを決めるときに safe_mysqld を上書きしないように、どこか他の場所にコピーすべきです!
MySQL を起動または停止するには、次のコマンドを使用します:
scripts/mysql.server stop scripts/mysql.server start
MySQL を製品アプリケーションに使用するために起動する時は、この 起動と停止のコマンドを `/etc/rc*' ファイル内の適切な場所に追加しま す。固有の場所から、そして固有のユーザで safe_mysqld を開始するように mysql.server スクリプトを編集できます。またここで mysqld への開始オプショ ンを追加することもできます。
Go to the first, previous, next, last section, table of contents.