UJP - 技術情報1

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

MySQL 5.0.24aをsennaを使うためにソースからインストール on Redhat ES3

MySQL 5.0.24aをsennaを使うためにソースからインストール on Redhat ES3


0.改訂履歴

  • 2006.12.21 新規作成
  • 2007.01.04 追記

1.はじめに

 このドキュメントでは,MySQLをソースコードからコンパイルしてインストールする手順を説明する. sennaによる全文検索の拡張を行う手順も入っているが,前提としてautomake, autoconf, libtool, bisonがインストールされている必要がある.

 なお,使用しているOSは,RedHat Linux ES 3上で稼働している.

2.モジュールの入手

  • 検索エンジンであるsennaが,MySQL5.0.24aで作成されているので,指定のバージョンを手に入れる.
  • MySQL5.0.24aを入手
  • 今回は,senna用のパッチを当てるので,ソースを取得する.
  • インストールする環境が,RedHat ES3なので,ダウンロードしたモジュールは,次の通り.
[root@venus5 InstallBin]# ls -la MySQL-standard-5.0.24a-0.rhel3.src.rpm
-rw-r--r--    1 admin  users    19826353 Dec 21 20:51 MySQL-standard-5.0.24a-0.rhel3.src.rpm
[root@venus5 InstallBin]# 

3.インストール

  • rpmなので,ソースをインストールする.
[root@venus5 InstallBin]# rpm -ihv MySQL-standard-5.0.24a-0.rhel3.src.rpm
warning: MySQL-standard-5.0.24a-0.rhel3.src.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
   1:MySQL-standard         warning: user mysqldev does not exist - using root
warning: group mysqldev does not exist - using root
warning: user mysqldev does not exist - using root
warning: group mysqldev does not exist - using root
########################################### [100%]
[root@venus5 InstallBin]# 
  • mysqldevユーザが無いので,エラーとなった.
  • mysqldevユーザを作成する.
[root@venus5 InstallBin]# /usr/sbin/useradd -u 801 mysqldev
[root@venus5 InstallBin]# 
  • 再度RPMをインストールする.
[root@venus5 InstallBin]# rpm -ihv MySQL-standard-5.0.24a-0.rhel3.src.rpm
warning: MySQL-standard-5.0.24a-0.rhel3.src.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
   1:MySQL-standard         ########################################### [100%]
[root@venus5 InstallBin]# 
  • 以下のようにソースが展開される.
[root@venus5 InstallBin]# ls -la /usr/src/redhat/SOURCES/mysql-5.0.24a.tar.gz
-rw-r--r--    1 mysqldev mysqldev 19993102 Aug 26 19:00 /usr/src/redhat/SOURCES/mysql-5.0
.24a.tar.gz
[root@venus5 InstallBin]# 
  • tarballを展開する.
[root@venus5 InstallBin]# tar xfz /usr/src/redhat/SOURCES/mysql-5.0.24a.tar.gz
[root@venus5 InstallBin]# 
  • 展開すると,次のようなディレクトリが作成される.
[root@venus5 InstallBin]# ls -la |grep mysql
drwxrwxrwx   38 503      users        4096 Aug 26 06:44 mysql-5.0.24a
-rw-r--r--    1 admin  users    46763021 Dec 21 19:54 mysql-standard-5.0.24a-linux-i686.tar.gz
[root@venus5 InstallBin]# 
  • 中身を確認する.
[root@venus5 InstallBin]# cd mysql-5.0.24a
[root@venus5 mysql-5.0.24a]# ls -la
total 2272
drwxrwxrwx   38 503      users        4096 Aug 26 06:44 .
drwxr-xr-x   12 root     root         4096 Dec 21 21:20 ..
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 BUILD
-rw-r--r--    1 503      users       19071 Aug 26 06:11 COPYING
-rw-r--r--    1 503      users        4316 Aug 26 06:12 ChangeLog
drwxrwxrwx    3 503      users        4096 Aug 26 06:42 Docs
-rw-r--r--    1 503      users        5712 Aug 26 06:18 EXCEPTIONS-CLIENT
-rw-r--r--    1 503      users       38656 Aug 26 06:18 INSTALL-SOURCE
-rw-r--r--    1 503      users       10570 Aug 26 06:18 INSTALL-WIN-SOURCE
-rw-r--r--    1 503      users        4226 Aug 26 06:11 Makefile.am
-rw-r--r--    1 503      users       29662 Aug 26 06:14 Makefile.in
-rw-r--r--    1 503      users        1380 Aug 26 06:11 README
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 SSL
-rw-r--r--    1 503      users      262272 Aug 26 06:13 aclocal.m4
drwxrwxrwx   48 503      users        4096 Aug 26 06:42 bdb
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 client
drwxrwxrwx    4 503      users        4096 Aug 26 06:42 cmd-line-utils
drwxrwxrwx    3 503      users        4096 Aug 26 06:42 config
-rwxr-xr-x    1 503      users       43420 Aug 26 06:14 config.guess
-rw-r--r--    1 503      users       28718 Aug 26 06:13 config.h.in
-rwxr-xr-x    1 503      users       31743 Aug 26 06:14 config.sub
-rwxr-xr-x    1 503      users     1312734 Aug 26 06:14 configure
-rw-r--r--    1 503      users       87821 Aug 26 06:11 configure.in
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 dbug
-rwxr-xr-x    1 503      users       15936 Aug 26 06:14 depcomp
drwxrwxrwx    3 503      users        4096 Aug 26 06:42 extra
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 heap
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 include
drwxrwxrwx   32 503      users        4096 Aug 26 06:43 innobase
-rwxr-xr-x    1 503      users        9233 Aug 26 06:13 install-sh
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 libmysql
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 libmysql_r
drwxrwxrwx    3 503      users        4096 Aug 26 06:44 libmysqld
-rw-r--r--    1 503      users      196440 May 26  2006 ltmain.sh
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 man
-rwxr-xr-x    1 503      users       11014 Aug 26 06:13 missing
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 myisam
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 myisammrg
drwxrwxrwx    8 503      users        4096 Aug 26 06:44 mysql-test
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 mysys
drwxrwxrwx    9 503      users        4096 Aug 26 06:43 ndb
drwxrwxrwx    3 503      users        4096 Aug 26 06:43 netware
drwxrwxrwx    3 503      users        4096 Aug 26 06:43 os2
drwxrwxrwx    3 503      users        4096 Aug 26 06:42 pstack
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 regex
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 scripts
drwxrwxrwx    3 503      users        4096 Aug 26 06:44 server-tools
drwxrwxrwx    4 503      users        4096 Aug 26 06:43 sql
drwxrwxrwx    5 503      users        4096 Aug 26 06:44 sql-bench
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 sql-common
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 strings
drwxrwxrwx    3 503      users        4096 Aug 26 06:44 support-files
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 tests
drwxrwxrwx    2 503      users        4096 Aug 26 06:44 tools
drwxrwxrwx    2 503      users        4096 Aug 26 06:43 vio
drwxrwxrwx    2 503      users        4096 Aug 26 06:42 zlib
[root@venus5 mysql-5.0.24a]# 
  • sennaのbindings関連ファイルを確認する.
  • 今回は,sennaのインストールの際に展開されたディレクトリ配下にある,bindings/mysqlファイルを見る.
[root@venus5 mysql-5.0.24a]# ls -la ../senna-0.8.2/bindings/mysql/
total 400
drwxr-xr-x    4 1000     1000         4096 Oct 19 16:59 .
drwxr-xr-x    4 1000     1000         4096 Oct 20 02:01 ..
drwxr-xr-x    3 1000     1000         4096 Dec 21 16:25 myisenna
-rw-r--r--    1 1000     1000        23060 Oct 19 16:59 mysql-4.0.27.senna.2ind.diff
-rw-r--r--    1 1000     1000        13503 Oct 19 16:59 mysql-4.0.27.senna.2ind.skipmode.diff
-rw-r--r--    1 1000     1000        68779 Oct 19 16:59 mysql-4.0.27.senna.diff
-rw-r--r--    1 1000     1000        22704 Oct 19 16:59 mysql-4.1.20.senna.2ind.diff
-rw-r--r--    1 1000     1000        63849 Oct 19 16:59 mysql-4.1.20.senna.diff
-rw-r--r--    1 1000     1000        23318 Oct 19 16:59 mysql-5.0.24a.senna.2ind.diff
-rw-r--r--    1 1000     1000        61439 Oct 19 16:59 mysql-5.0.24a.senna.diff
-rw-r--r--    1 1000     1000        23710 Oct 19 16:59 mysql-5.1.11-beta.senna.2ind.diff
-rw-r--r--    1 1000     1000        63253 Oct 19 16:59 mysql-5.1.11-beta.senna.diff
drwxr-xr-x    2 1000     1000         4096 Oct 20 02:01 udf
[root@venus5 mysql-5.0.24a]# 
  • ここにあるdiffファイルを使って,パッチを適用する.
[root@venus5 mysql-5.0.24a]# patch -p1 <  ../senna-0.8.2/bindings/mysql/mysql-5.0.24a.senna.diff
patching file config.h.in
patching file configure.in
patching file include/myisam.h
patching file libmysqld/ha_myisam.cc
patching file libmysqld/sql_db.cc
patching file libmysqld/sql_delete.cc
patching file libmysqld/sql_show.cc
patching file libmysqld/sql_table.cc
patching file myisam/Makefile.am
patching file myisam/ft_boolean_search.c
patching file myisam/ft_nlq_search.c
patching file myisam/ft_update.c
patching file myisam/fulltext.h
patching file myisam/mi_check.c
patching file myisam/mi_close.c
patching file myisam/mi_create.c
patching file myisam/mi_delete_all.c
patching file myisam/mi_delete_table.c
patching file myisam/mi_info.c
patching file myisam/mi_open.c
patching file myisam/mi_rename.c
patching file myisam/myisam_ftdump.c
patching file myisam/myisamchk.c
patching file myisam/myisamlog.c
patching file myisam/myisampack.c
patching file myisammrg/Makefile.am
patching file sql/Makefile.am
patching file sql/ha_myisam.cc
patching file sql/handler.h
patching file sql/lex.h
patching file sql/mysqld.cc
patching file sql/sql_class.h
patching file sql/sql_db.cc
patching file sql/sql_delete.cc
patching file sql/sql_lex.h
patching file sql/sql_show.cc
patching file sql/sql_table.cc
patching file sql/sql_yacc.yy
patching file sql/structs.h
[root@venus5 mysql-5.0.24a]
  • 2つめのパッチを適用する.
[root@venus5 mysql-5.0.24a]# patch -p1 <  ../senna-0.8.2/bindings/mysql/mysql-5.0.24a.senna.2in
d.diff 
patching file include/my_pthread.h
patching file libmysqld/filesort.cc
patching file libmysqld/item_cmpfunc.cc
patching file libmysqld/item_func.cc
patching file libmysqld/item_sum.cc
patching file libmysqld/records.cc
patching file libmysqld/sql_select.cc
patching file myisam/ft_boolean_search.c
patching file myisam/ft_nlq_search.c
patching file sql/filesort.cc
patching file sql/item.h
patching file sql/item_cmpfunc.cc
patching file sql/item_cmpfunc.h
patching file sql/item_func.cc
patching file sql/item_func.h
patching file sql/item_sum.cc
patching file sql/records.cc
patching file sql/sql_select.cc
[root@venus5 mysql-5.0.24a]# 
  • autoconf 2.59, automake 1.8(aclocal 1.8), libtool 1.4,bison 1.75が必要なので,確認する.
  • インストールし直しをしている場合は,次のような手順で確認する.
[root@venus5 aho]# /usr/local/bin/autoconf --version
autoconf (GNU Autoconf) 2.61
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
[root@venus5 aho]# which automake
/usr/local/bin/automake
[root@venus5 aho]# /usr/local/bin/automake --version
automake (GNU automake) 1.9.6
Written by Tom Tromey <tromey@redhat.com>.

Copyright 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@venus5 aho]# which libtool
/usr/local/bin/libtool
[root@venus5 aho]# /usr/local/bin/libtool --version
ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)

Copyright (C) 2005  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@venus5 aho]# which bison
/usr/local/bin/bison
[root@venus5 aho]# /usr/local/bin/bison --version
bison (GNU Bison) 2.3
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@venus5 aho]# 
  • 以下,手順通りに実行する.(各コマンドの意味は,理解していない・・・)
[root@venus5 mysql-5.0.24a]# /usr/local/bin/libtoolize -c -f
Using `AC_PROG_RANLIB' is rendered obsolete by `AC_PROG_LIBTOOL'
You should update your `aclocal.m4' by running aclocal.
[root@venus5 mysql-5.0.24a]# 
  • なにやらメッセージがエラーが出ているが,無視して良いらしい.
[root@venus5 mysql-5.0.24a]# /usr/local/bin/aclocal-1.9
[root@venus5 mysql-5.0.24a]# 
  • 少し待つ感じ.
[root@venus5 mysql-5.0.24a]# /usr/local/bin/autoheader          
[root@venus5 mysql-5.0.24a]# 
  • うまくいかない場合には,autoconfのバージョンを確認する.
[root@venus5 mysql-5.0.24a]# /usr/local/bin/automake -c -a -i
[root@venus5 mysql-5.0.24a]# 
  • 少し待つ感じがある.
[root@venus5 mysql-5.0.24a]# /usr/local/bin/autoconf
[root@venus5 mysql-5.0.24a]#
  • 直ぐ終わる.
  • 同じな井をしておく.
[root@venus5 mysql-5.0.24a]# touch sql/sql_yacc.yy
[root@venus5 mysql-5.0.24a]# 
  • configureを行う.
[root@venus5 mysql-5.0.24a]# ./configure --with-charset=sjis --with-extra-chars
ets=ujis,utf8 --with-named-curses-libs=/usr/lib/libncurses.so.5 --with-senna -
-enable-thread-safe-client --enable-assembler --with-readline --disable-shared 
--with-big-tables
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking "character sets"... default: sjis, collation: sjis_japanese_ci; compi
led in: sjis latin1 utf8 ujis utf8
checking whether to compile national Unicode collations... yes
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gawk... (cached) gawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes


〜略〜



config.status: creating mach/Makefile
config.status: creating mem/Makefile
config.status: creating mtr/Makefile
config.status: creating page/Makefile
config.status: creating pars/Makefile
config.status: creating que/Makefile
config.status: creating read/Makefile
config.status: creating rem/Makefile
config.status: creating row/Makefile
config.status: creating srv/Makefile
config.status: creating sync/Makefile
config.status: creating thr/Makefile
config.status: creating trx/Makefile
config.status: creating usr/Makefile
config.status: creating ib_config.h
config.status: ib_config.h is unchanged
config.status: executing depfiles commands

MySQL has a Web site at http://www.mysql.com/ which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.

Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.

Thank you for choosing MySQL!

[root@venus5 mysql-5.0.24a]# 
  • 問題なく終了した模様.
  • makeを行う.
[root@venus5 mysql-5.0.24a]# make
cd libmysql; make link_sources
make[1]: Entering directory `/mysqltest/mysql-5.0.24a/libmysql'
set -x; ¥
  ss=`echo strmov.lo strxmov.lo strxnmov.lo strnmov.lo strmake.lo strend.lo st
rtod.lo strnlen.lo strfill.lo is_prefix.lo int2str.lo str2int.lo strinstr.lo s
trcont.lo strcend.lo bcmp.lo ctype-latin1.lo bchange.lo bmove.lo bmove_upp.lo 
longlong2str.lo strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo ctype.lo ctype
-simple.lo ctype-bin.lo ctype-mb.lo ctype-big5.lo ctype-czech.lo ctype-cp932.l
o ctype-eucjpms.lo ctype-euc_kr.lo ctype-win1250ch.lo ctype-utf8.lo ctype-extr
a.lo ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo ctype-sjis.lo ctype-tis620.lo 
ctype-ujis.lo ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo  | sed "s;¥.lo;.
c;g"`; ¥
  ds=`echo dbug.lo  | sed "s;¥.lo;.c;g"`; ¥
  ms=`echo my_init.lo my_static.lo my_malloc.lo my_realloc.lo my_create.lo my_
delete.lo mf_tempfile.lo my_open.lo my_file.lo my_read.lo my_write.lo errors.l
o my_error.lo my_getwd.lo my_div.lo mf_pack.lo my_messnc.lo mf_dirname.lo mf_f
n_ext.lo mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo mf_format.lo mf_path.
lo mf_unixpath.lo my_fopen.lo my_symlink.lo my_fstream.lo mf_loadpath.lo my_pt
hread.lo my_thr_init.lo thr_mutex.lo mulalloc.lo string.lo default.lo default_
modify.lo my_compress.lo array.lo my_once.lo list.lo my_net.lo charset.lo char
set-def.lo hash.lo mf_iocache.lo mf_iocache2.lo my_seek.lo my_sleep.lo my_prea
d.lo mf_cache.lo md5.lo sha1.lo my_getopt.lo my_gethostbyname.lo my_port.lo my
_rename.lo my_chsize.lo my_lib.lo | sed "s;¥.lo;.c;g"`; ¥
  vs=`echo vio.lo viosocket.lo viossl.lo viosslfactories.lo | sed "s;¥.lo;.c;g
"`; ¥
  scs=`echo pack.lo client.lo my_time.lo | sed "s;¥.lo;.c;g"`; ¥
  for f in $ss; do ¥
    rm -f $f; ¥
    /bin/ln -s ../strings/$f $f; ¥
  done; ¥
  for f in $vs vio_priv.h; do ¥
    rm -f $f; ¥
    /bin/ln -s ../vio/$f $f; ¥
  done; ¥
  for f in $scs; do ¥
    rm -f $f; ¥
    /bin/ln -s ../sql-common/$f $f; ¥
  done; ¥
  for f in strto.c; do ¥
    rm -f $f; ¥

						
〜略〜
g++ -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER -I. -I. -I../.. -I../../zlib -I../.
./include -I../../include    -O3 -DDBUG_OFF    -fno-implicit-templates -fno-ex
ceptions -fno-rtti -c -o parse_output.o parse_output.cc
/bin/sh ../../libtool --preserve-dup-deps --tag=CXX --mode=link g++  -O3 -DDBU
G_OFF    -fno-implicit-templates -fno-exceptions -fno-rtti  -rdynamic  -o mysq
lmanager  command.o mysqlmanager.o manager.o log.o thread_registry.o listener.
o protocol.o mysql_connection.o user_map.o messages.o commands.o instance.o in
stance_map.o instance_options.o buffer.o parse.o guardian.o parse_output.o lib
options.la libnet.a ../../vio/libvio.a ../../mysys/libmysys.a ../../strings/li
bmystrings.a ../../dbug/libdbug.a ../../zlib/libz.la -lpthread -lcrypt -lnsl -
lm  -lpthread 
g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic 
-o mysqlmanager command.o mysqlmanager.o manager.o log.o thread_registry.o lis
tener.o protocol.o mysql_connection.o user_map.o messages.o commands.o instanc
e.o instance_map.o instance_options.o buffer.o parse.o guardian.o parse_output.
o  ./.libs/liboptions.a -lpthread -lpthread -lpthread -lpthread libnet.a ../..
/vio/libvio.a ../../mysys/libmysys.a ../../strings/libmystrings.a ../../dbug/l
ibdbug.a ../../zlib/.libs/libz.a -lpthread -lpthread -lpthread -lpthread -lpth
read -lcrypt -lnsl -lm -lpthread
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools/instance-man
ager'
make[3]: Entering directory `/mysqltest/mysql-5.0.24a/server-tools'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools'
make[2]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools'
make[1]: Leaving directory `/mysqltest/mysql-5.0.24a'
[root@venus5 mysql-5.0.24a]
  • 問題なく終了した模様.問題があった場合は,エラー表示が最後にでる.
  • インストールする.
[root@venus5 mysql-5.0.24a]# make install
make  install-recursive
make[1]: Entering directory `/mysqltest/mysql-5.0.24a'
Making install in .
make[2]: Entering directory `/mysqltest/mysql-5.0.24a'
make[3]: Entering directory `/mysqltest/mysql-5.0.24a'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a'
make[2]: Leaving directory `/mysqltest/mysql-5.0.24a'
Making install in include
make[2]: Entering directory `/mysqltest/mysql-5.0.24a/include'
make  install-am
make[3]: Entering directory `/mysqltest/mysql-5.0.24a/include'
make[4]: Entering directory `/mysqltest/mysql-5.0.24a/include'
make[4]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/mysql" || mkdir -p -- "/usr/local/include/mysql"
 /usr/bin/install -c -m 644 'my_dbug.h' '/usr/local/include/mysql/my_dbug.h'
 /usr/bin/install -c -m 644 'm_string.h' '/usr/local/include/mysql/m_string.h'
 /usr/bin/install -c -m 644 'my_sys.h' '/usr/local/include/mysql/my_sys.h'

						
〜略〜
test -z "/usr/local/share/mysql" || mkdir -p -- "/usr/local/share/mysql"
 /usr/bin/install -c 'mysql.server' '/usr/local/share/mysql/mysql.server'
make[4]: Leaving directory `/mysqltest/mysql-5.0.24a/support-files'
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a/support-files'
make[2]: Leaving directory `/mysqltest/mysql-5.0.24a/support-files'
Making install in tools
make[2]: Entering directory `/mysqltest/mysql-5.0.24a/tools'
make[3]: Entering directory `/mysqltest/mysql-5.0.24a/tools'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
  /bin/sh ../libtool --preserve-dup-deps --mode=install /usr/bin/install -c 'm
ysqltestmanager' '/usr/local/bin/mysqltest/manager'
/usr/bin/install -c mysqltestmanager /usr/local/bin/mysqltest/manager
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a/tools'
make[2]: Leaving directory `/mysqltest/mysql-5.0.24a/tools'
Making install in server-tools
make[2]: Entering directory `/mysqltest/mysql-5.0.24a/server-tools'
Making install in instance-manager
make[3]: Entering directory `/mysqltest/mysql-5.0.24a/server-tools/instance-ma
nager'
make[4]: Entering directory `/mysqltest/mysql-5.0.24a/server-tools/instance-ma
nager'
test -z "/usr/local/libexec" || mkdir -p -- "/usr/local/libexec"
  /bin/sh ../../libtool --preserve-dup-deps --mode=install /usr/bin/install -c 
'mysqlmanager' '/usr/local/libexec/mysqlmanager'
/usr/bin/install -c mysqlmanager /usr/local/libexec/mysqlmanager
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools/instance-man
ager'
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools/instance-man
ager'
make[3]: Entering directory `/mysqltest/mysql-5.0.24a/server-tools'
make[4]: Entering directory `/mysqltest/mysql-5.0.24a/server-tools'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools'
make[3]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools'
make[2]: Leaving directory `/mysqltest/mysql-5.0.24a/server-tools'
make[1]: Leaving directory `/mysqltest/mysql-5.0.24a'
[root@venus5 mysql-5.0.24a]#  
  • 問題なく,完了した.

3.初期セットアップ

  • 設定ファイルを複写する.
[root@venus5 mysql-5.0.24a]# cp -p ./support-files/my-medium.cnf /etc/my.cnf
[root@venus5 mysql-5.0.24a]#
  • 初期データベースを作成する.
[root@venus5 mysql-5.0.24a]# ./scripts/mysql_install_db
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/bin/mysqladmin -u root password 'new-password'
/usr/local/bin/mysqladmin -u root -h venus5 password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local ; /usr/local/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[root@venus5 mysql-5.0.24a]# 
  • 作成完了.
  • mysqlユーザを作成する.
[root@venus5 mysql-5.0.24a]# /usr/sbin/useradd -u 800 mysql
[root@venus5 mysql-5.0.24a]# 
  • 初期データベースが格納されているディレクトリ以下のファイルオーナーを変更する.
[root@venus5 mysql-5.0.24a]# chown -R mysql:mysql /usr/local/var
[root@venus5 mysql-5.0.24a]# 
  • mysqlデーモンの起動スクリプトを確認する.
[root@venus5 mysql-5.0.24a]# ls -la support-files/mysql.server
-rw-r--r--    1 root     root         9398 Jan  4 17:57 support-files/mysql.server
[root@venus5 mysql-5.0.24a]#
  • 実行権限を付ける.
[root@venus5 mysql-5.0.24a]# chmod +x support-files/mysql.server
[root@venus5 mysql-5.0.24a]# ls -la support-files/mysql.server
-rwxr-xr-x    1 root     root         9398 Jan  4 17:57 support-files/mysql.server
[root@venus5 mysql-5.0.24a]#
  • MySQLを起動させる.
[root@venus5 mysql-5.0.24a]# ./support-files/mysql.server start
Starting MySQL                                             [  OK  ]
[root@venus5 mysql-5.0.24a]# 
  • 起動しているか確認する.
[root@venus5 mysql-5.0.24a]# ps -ef | grep mysqld
root      9352     1  0 18:05 pts/0    00:00:00 /bin/sh /usr/local/bin/mysqld_
safe --datadir=/usr/local/var --pid-file=/usr/local/var/venus5.pid
mysql     9379  9352  0 18:05 pts/0    00:00:00 /usr/local/libexec/mysqld --ba
sedir=/usr/local --datadir=/usr/local/var --user=mysql --pid-file=/usr/local/v
ar/venus5.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock
root     10043 18392  0 18:07 pts/0    00:00:00 grep mysqld
[root@venus5 mysql-5.0.24a]# 
  • mysqladminコマンドでバージョンやステータス情報を確認する.
[root@venus5 mysql-5.0.24a]# mysqladmin version
mysqladmin  Ver 8.41 Distrib 5.0.24a, for pc-linux-gnu on i686
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          5.0.24a-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 2 min 50 sec

Threads: 1  Questions: 1  Slow queries: 0  Opens: 12  Flush tables: 1  Open ta
bles: 6  Queries per second avg: 0.006
[root@venus5 mysql-5.0.24a]# 
  • 起動用スクリプトを自動起動として設定する.
[root@venus5 mysql-5.0.24a]# cp ./support-files/mysql.server /etc/init.d/mysql
[root@venus5 mysql-5.0.24a]# 
  • rootユーザのパスワードを変更する.
[root@venus5 mysql-5.0.24a]# mysqladmin -uroot password 'password'
[root@venus5 mysql-5.0.24a]#
  • データベースをシャットダウンする・
[root@venus5 mysql-5.0.24a]# mysqladmin -uroot -ppassword shutdown
[root@venus5 mysql-5.0.24a]#
  • これで終了.


広告スペース
Google