MySQL-4 を FreeBSD 5.2.1-RELEASE にインストールする。
まずは最新ソースを落としてくる。
serv2# cd /usr/local/src
serv2# lynx http://www.mysql.com/downloads/
Database Server をクリックしてダウンロードファイルの一覧を表示。
FreeBSD 用バイナリは 4.X 用しかないので、 Source Downloads のリンクを辿り、Tarball (tar.gz) 4.0.20 13.2M を落とす。(現在の最新版 mysql-4.0.20.tar.gz)
ダウンロードする前にユーザー登録が必要だが、タダの RDB を使わせてもらうわけだから、正直にきちんと入力しような。
First Name: Masanori____________
Last Name: Shinoda_____________
Job Function: [IT Director________________________________]
Company/Organization: Net & Field Co.,Ltd.
Primary Business Activity:
[Computer software_________________________________________________]
Email Address: * shinoda@netandfield.
Phone: ____________________
State/Province: * [Other or N/A___________]
Country: * [Japan_______________________________________]
What best describes how you plan on using MySQL?
[Client/server application_____________]
Tell us about your project or interest in MySQL:
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
What is the primary language interface you expect to use? [Perl____________________]
What other database systems do you use in your organization? [Postgres________________]
[ ] Please contact me to discuss how MySQL fits into my technical environment.
[ ] Sign me up for the monthly MySQL newsletter.
Submit form
serv2# ls -la my*
-rw-r--r-- 1 root wheel 13807983 Aug 16 23:27 mysql-4.0.20.tar.gz
serv2# tar xvfz mysql-4.0.20.tar.gz
<略>
mysql-4.0.20/innobase/include/rem0types.h
mysql-4.0.20/innobase/include/eval0eval.h
mysql-4.0.20/innobase/include/ibuf0types.h
mysql-4.0.20/innobase/include/page0page.h
MySQL 専用ユーザーの作成(root でも起動出来るが、専用ユーザーを作った方が安全)
serv2# vi /etc/group
mysql:*:1110: を、追加。
serv2# vipw
mysql:*:1110:1110::0:0:MySQL Admin:/usr/local/var:/bin/csh を追加。
で、コンフィギュア。
serv2# cd mysql-4.0.20/
serv2# ./configure --with-charset=ujis --with-extra-charset=all --with-mysqld-user=mysql
checking build system type... i386-unknown-freebsd5.2.1
checking host system type... i386-unknown-freebsd5.2.1
checking target system type... i386-unknown-freebsd5.2.1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
<略>
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!
よし、よし、正常終了。
serv2# make
<略>
/usr/bin/sed -e 's!@''bindir''@!/usr/local/bin!g' -e 's!@''sbindir''@!/usr/local/sbin!g' -e 's!@''scriptdir''@!/usr/local/bin!g' -e 's!@''prefix''@!/usr/local!g' -e 's!@''datadir''@!/usr/local/share!g' -e 's!@''localstatedir''@!/usr/local/var!g' -e 's!@''libexecdir''@!/usr/local/libexec!g' -e 's!@''CC''@!gcc!' -e 's!@''CXX''@!g++!' -e 's!@''GXX''@!yes!' -e 's!@''PERL''@!/usr/bin/perl!' -e 's!@''CFLAGS''@!!' -e 's!@''CXXFLAGS''@!!' -e 's!@''LDFLAGS''@!!' -e 's!@''VERSION''@!4.0.20!' -e 's!@''MYSQL_SERVER_SUFFIX''@!!' -e 's!@''COMPILATION_COMMENT''@!Source distribution!' -e 's!@''MACHINE_TYPE''@!i386!' -e 's!@''HOSTNAME''@!/bin/hostname!' -e 's!@''SYSTEM_TYPE''@!unknown-freebsd5.2.1!' -e 's!@''CHECK_PID''@!/bin/kill -0 $PID > /dev/null 2> /dev/null!' -e 's!@''FIND_PROC''@!/bin/ps p $PID | grep mysqld > /dev/null!' -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!!' -e 's!@''MYSQL_UNIX_ADDR''@!/tmp/mysql.sock!' -e 's!@''IS_LINUX''@!false!' -e "s!@""CONF_COMMAND""@!./configure '--with-charset=ujis' '--with-extra-charset=all' '--with-mysqld-user=mysql'!" -e 's!@''MYSQLD_USER''@!mysql!' -e 's!@''sysconfdir''@!/usr/local/etc!' -e 's!@''SHORT_MYSQL_INTRO''@!@SHORT_MYSQL_INTRO@!' -e 's!@''SHARED_LIB_VERSION''@!12:0:0!' -e 's!@''MYSQL_BASE_VERSION''@!4.0!' -e 's!@''MYSQL_NO_DASH_VERSION''@!4.0.20!' -e 's!@''MYSQL_TCP_PORT''@!3306!' -e 's!@''PERL_DBI_VERSION''@!@PERL_DBI_VERSION@!' -e 's!@''PERL_DBD_VERSION''@!@PERL_DBD_VERSION@!' -e 's!@''PERL_DATA_DUMPER''@!@PERL_DATA_DUMPER@!' MySQL-shared-compat.spec.sh > MySQL-shared-compat.spec-t/bin/mv MySQL-shared-compat.spec-t MySQL-shared-compat.spec
serv2# make install
Making install in .
Making install in include
make install-am
/bin/sh ../mkinstalldirs /usr/local/include/mysql
mkdir /usr/local/include/mysql
/usr/bin/install -c -m 644 my_dbug.h /usr/local/include/mysql/my_dbug.h
<略>
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib/mysql
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
<略>
/usr/bin/install -c -m 644 MySQL-shared-compat.spec /usr/local/share/mysql/MySQL-shared-compat.spec
/bin/sh ../mkinstalldirs /usr/local/share/mysql
/usr/bin/install -c mysql.server /usr/local/share/mysql/mysql.server
/usr/local/bin 以下にインストールされたファイルを確認。
たくさんあるなあ。
serv2# ls -la /usr/local/bin/*|grep 'Aug 17'
-rwxr-xr-x 1 root wheel 46418 Aug 17 07:03 /usr/local/bin/comp_err
-rwxr-xr-x 1 root wheel 186663 Aug 17 07:03 /usr/local/bin/isamchk
-rwxr-xr-x 1 root wheel 137900 Aug 17 07:03 /usr/local/bin/isamlog
-rwxr-xr-x 1 root wheel 4358 Aug 17 07:03 /usr/local/bin/make_win_binary_distribution
-rwxr-xr-x 1 root wheel 8248 Aug 17 07:03 /usr/local/bin/make_win_src_distribution
-rwxr-xr-x 1 root wheel 1468 Aug 17 07:03 /usr/local/bin/msql2mysql
-rwxr-xr-x 1 root wheel 57792 Aug 17 07:03 /usr/local/bin/my_print_defaults
-rwxr-xr-x 1 root wheel 151436 Aug 17 07:03 /usr/local/bin/myisam_ftdump
-rwxr-xr-x 1 root wheel 292252 Aug 17 07:03 /usr/local/bin/myisamchk
-rwxr-xr-x 1 root wheel 197808 Aug 17 07:03 /usr/local/bin/myisamlog
-rwxr-xr-x 1 root wheel 223804 Aug 17 07:03 /usr/local/bin/myisampack
-rwxr-xr-x 1 root wheel 199498 Aug 17 07:03 /usr/local/bin/mysql
-rwxr-xr-x 1 root wheel 4156 Aug 17 07:03 /usr/local/bin/mysql_config
-rwxr-xr-x 1 root wheel 2977 Aug 17 07:03 /usr/local/bin/mysql_convert_table_format
-rwxr-xr-x 1 root wheel 10419 Aug 17 07:03 /usr/local/bin/mysql_explain_log
-rwxr-xr-x 1 root wheel 2654 Aug 17 07:03 /usr/local/bin/mysql_find_rows
-rwxr-xr-x 1 root wheel 483 Aug 17 07:03 /usr/local/bin/mysql_fix_extensions
-rwxr-xr-x 1 root wheel 10320 Aug 17 07:03 /usr/local/bin/mysql_fix_privilege_tables
-rwxr-xr-x 1 root wheel 50519 Aug 17 07:03 /usr/local/bin/mysql_install
-rwxr-xr-x 1 root wheel 14376 Aug 17 07:03 /usr/local/bin/mysql_install_db
-rwxr-xr-x 1 root wheel 6308 Aug 17 07:03 /usr/local/bin/mysql_secure_installation
-rwxr-xr-x 1 root wheel 17275 Aug 17 07:03 /usr/local/bin/mysql_setpermission
-rwxr-xr-x 1 root wheel 13647 Aug 17 07:03 /usr/local/bin/mysql_tableinfo
-rwxr-xr-x 1 root wheel 26851 Aug 17 07:03 /usr/local/bin/mysql_waitpid
-rwxr-xr-x 1 root wheel 3123 Aug 17 07:03 /usr/local/bin/mysql_zap
-rwxr-xr-x 1 root wheel 111528 Aug 17 07:03 /usr/local/bin/mysqlaccess
-rwxr-xr-x 1 root wheel 26287 Aug 17 07:03 /usr/local/bin/mysqladmin
-rwxr-xr-x 1 root wheel 48870 Aug 17 07:03 /usr/local/bin/mysqlbinlog
-rwxr-xr-x 1 root wheel 9451 Aug 17 07:03 /usr/local/bin/mysqlbug
-rwxr-xr-x 1 root wheel 24276 Aug 17 07:03 /usr/local/bin/mysqlcheck
-rwxr-xr-x 1 root wheel 20159 Aug 17 07:03 /usr/local/bin/mysqld_multi
-rwxr-xr-x 1 root wheel 10813 Aug 17 07:03 /usr/local/bin/mysqld_safe
-rwxr-xr-x 1 root wheel 41094 Aug 17 07:03 /usr/local/bin/mysqldump
-rwxr-xr-x 1 root wheel 4986 Aug 17 07:03 /usr/local/bin/mysqldumpslow
-rwxr-xr-x 1 root wheel 31897 Aug 17 07:03 /usr/local/bin/mysqlhotcopy
-rwxr-xr-x 1 root wheel 19822 Aug 17 07:03 /usr/local/bin/mysqlimport
-rwxr-xr-x 1 root wheel 8765 Aug 17 07:03 /usr/local/bin/mysqlmanager-pwgen
-rwxr-xr-x 1 root wheel 10036 Aug 17 07:03 /usr/local/bin/mysqlmanagerc
-rwxr-xr-x 1 root wheel 18598 Aug 17 07:03 /usr/local/bin/mysqlshow
-rwxr-xr-x 1 root wheel 58259 Aug 17 07:03 /usr/local/bin/mysqltest
-rwxr-xr-x 1 root wheel 152853 Aug 17 07:03 /usr/local/bin/pack_isam
-rwxr-xr-x 1 root wheel 53095 Aug 17 07:03 /usr/local/bin/perror
-rwxr-xr-x 1 root wheel 56855 Aug 17 07:03 /usr/local/bin/replace
-rwxr-xr-x 1 root wheel 52381 Aug 17 07:03 /usr/local/bin/resolve_stack_dump
-rwxr-xr-x 1 root wheel 51041 Aug 17 07:03 /usr/local/bin/resolveip
デーモンもちゃんとインストールされているか?
serv2# ls -la /usr/local/libexec/mysql*
-rwxr-xr-x 1 root wheel 2935660 Aug 17 07:03 /usr/local/libexec/mysqld
以上でインストールは終了なので、DB の初期化を行う。
serv2# /usr/local/bin/mysql_install_db --user=mysql
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
040817 7:30:57 /usr/local/libexec/mysqld: Shutdown Complete
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 serv2.netandfield.com 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 https://order.mysql.com
serv2# ls -la /usr/local/var
total 14
drwxr-xr-x 7 mysql wheel 512 Aug 17 07:30 .
drwxr-xr-x 21 root wheel 512 Aug 17 07:03 ..
drwx------ 2 mysql wheel 512 Aug 17 07:30 mysql
drwx------ 2 root wheel 512 Aug 10 09:48 openldap-data
drwx------ 2 root wheel 512 Aug 10 01:21 openldap-slurp
drwxr-xr-x 2 root wheel 512 Aug 10 09:55 run
drwx------ 2 mysql wheel 512 Aug 17 07:30 test
serv2# ls -la /usr/local/var/mysql
total 82
drwx------ 2 mysql wheel 512 Aug 17 07:30 .
drwxr-xr-x 7 mysql wheel 512 Aug 17 07:30 ..
-rw-rw---- 1 root wheel 0 Aug 17 07:30 columns_priv.MYD
-rw-rw---- 1 root wheel 1024 Aug 17 07:30 columns_priv.MYI
-rw-rw---- 1 root wheel 8778 Aug 17 07:30 columns_priv.frm
-rw-rw---- 1 root wheel 306 Aug 17 07:30 db.MYD
-rw-rw---- 1 root wheel 3072 Aug 17 07:30 db.MYI
-rw-rw---- 1 root wheel 9088 Aug 17 07:30 db.frm
-rw-rw---- 1 root wheel 0 Aug 17 07:30 func.MYD
-rw-rw---- 1 root wheel 1024 Aug 17 07:30 func.MYI
-rw-rw---- 1 root wheel 8641 Aug 17 07:30 func.frm
-rw-rw---- 1 root wheel 0 Aug 17 07:30 host.MYD
-rw-rw---- 1 root wheel 1024 Aug 17 07:30 host.MYI
-rw-rw---- 1 root wheel 9064 Aug 17 07:30 host.frm
-rw-rw---- 1 root wheel 0 Aug 17 07:30 tables_priv.MYD
-rw-rw---- 1 root wheel 1024 Aug 17 07:30 tables_priv.MYI
-rw-rw---- 1 root wheel 8877 Aug 17 07:30 tables_priv.frm
-rw-rw---- 1 root wheel 192 Aug 17 07:30 user.MYD
-rw-rw---- 1 root wheel 2048 Aug 17 07:30 user.MYI
-rw-rw---- 1 root wheel 9806 Aug 17 07:30 user.frm
serv2# ls -la /usr/local/var/test
total 4
drwx------ 2 mysql wheel 512 Aug 17 07:30 .
drwxr-xr-x 7 mysql wheel 512 Aug 17 07:30 ..
/usr/local/var の下に mysql と test というディレクトリが作られている。
DB の初期化OK。
MySQL サーバ実行
起動スクリプトを修正(FreeBSD 的に、PID ファイルを /var/run 下に。
serv2# ls -la /usr/local/share/mysql/mysql.server
-rwxr-xr-x 1 root wheel 5599 Aug 17 07:03 /usr/local/share/mysql/mysql.server
serv2# cp /usr/local/share/mysql/mysql.server /usr/local/share/mysql/mysql.server_org
serv2# vi /usr/local/share/mysql/mysql.server
#pid_file=$datadir/`/bin/hostname`.pid
pid_file=/var/run/mysql/mysql.pid
で、mysql ユーザーが PID ファイルが書き込めるよう、権限変更。
serv2# mkdir /var/run/mysql
serv2# chown mysql:mysql /var/run/mysql
serv2# /usr/local/share/mysql/mysql.server start
serv2# ps -auxww | grep mysql
mysql 72662 7.7 7.2 37732 18264 p0 S 9:39AM 0:00.17 /usr/local/libexec/mysqld --basedir=/usr/local --datadir=/usr/local/var --user=mysql --pid-file=/var/run/mysql/mysql.pid
root 72646 0.0 0.1 924 356 p0 S 9:39AM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --datadir=/usr/local/var --pid-file=/var/run/mysql/mysql.pid
お!起動した・・・しかし、起動してもすぐに落ちてしまう!!
ログを確認。
serv2# cat /usr/local/var/serv2.netandfield.com.err
040817 10:00:36 mysqld started
040817 10:00:36 InnoDB: Started
040817 10:00:36 Fatal error: Can't open privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
040817 10:00:36 Aborting
040817 10:00:36 InnoDB: Starting shutdown...
040817 10:00:39 InnoDB: Shutdown completed
040817 10:00:39 /usr/local/libexec/mysqld: Shutdown Complete
040817 10:00:39 mysqld ended
./mysql/host.frm が見つからないと言うてらっしゃる。
所有者を root から mysql に変更するのを忘れてました。
serv2# ls -la /usr/local/var/mysql/host.frm
-rw-rw---- 1 root wheel 9064 Aug 17 07:30 /usr/local/var/mysql/host.frm
serv2# chown mysql:mysql /usr/local/var/mysql/*
serv2# ls -la /usr/local/var/mysql/host.frm
-rw-rw---- 1 mysql mysql 9064 Aug 17 07:30 /usr/local/var/mysql/host.frm
再度実行!
serv2# /usr/local/share/mysql/mysql.server start
serv2# ps -aux | grep mysql
mysql 73417 3.2 7.2 37732 18332 p0 S 10:07AM 0:00.16 /usr/local/libexec/mysqld --based
root 73401 0.0 0.1 924 356 p0 S 10:07AM 0:00.01 /bin/sh /usr/local/bin/mysqld_saf
root 73419 0.0 0.1 324 188 p0 R+ 10:07AM 0:00.00 grep mysql
serv2# ls -la /var/run/mysql
total 6
drwxr-xr-x 2 mysql mysql 512 Aug 17 10:07 .
drwxr-xr-x 5 root wheel 512 Aug 17 09:29 ..
-rw-rw---- 1 mysql mysql 6 Aug 17 10:07 mysql.pid
今度は問題無し!ずっと起動中!!
ちゃんと起動出来ているか確認。
serv2# /usr/local/bin/mysqlshow
+----------------+
| Databases |
+----------------+
| mysql |
| openldap-data |
| openldap-slurp |
| run |
| test |
+----------------+
同じ /usr/local/var 以下にある OpenLDAP のディレクトリなんかも自分の DB 用のディレクトリとして表示しちゃってるなあ。
別のディレクトリにする必要があるね。(/usr/local/var の所有者が mysql というのも気持ち悪かったし)
mysql.server と mysql_install_db を修正する必要あり。
serv2# vi /usr/local/share/mysql/mysql.server
47〜48行目
#datadir=/usr/local/var
datadir=/usr/local/var/mysql
124行目
if test "$datadir" != "/usr/local/var/mysql"
serv2# /usr/local/share/mysql/mysql.server stop
Killing mysqld with pid 73417
Wait for mysqld to exit.. done
serv2# cp /usr/local/bin/mysql_install_db /usr/local/bin/mysql_install_db_org
serv2# vi /usr/local/bin/mysql_install_db
77行目
test -z "$ldata" && ldata=/usr/local/var/mysql
serv2# pwd
/usr/local/var
serv2# ls -la
total 20570
drwxr-xr-x 7 mysql wheel 512 Aug 17 10:48 .
drwxr-xr-x 21 root wheel 512 Aug 17 07:03 ..
-rw-rw---- 1 mysql wheel 25088 Aug 17 09:25 ib_arch_log_0000000000
-rw-rw---- 1 mysql wheel 5242880 Aug 17 10:48 ib_logfile0
-rw-rw---- 1 mysql wheel 5242880 Aug 17 09:25 ib_logfile1
-rw-rw---- 1 mysql wheel 10485760 Aug 17 10:48 ibdata1
drwx------ 2 mysql wheel 512 Aug 17 07:30 mysql
drwx------ 2 root wheel 512 Aug 10 09:48 openldap-data
drwx------ 2 root wheel 512 Aug 10 01:21 openldap-slurp
drwxr-xr-x 2 root wheel 512 Aug 10 09:55 run
-rw-rw---- 1 mysql wheel 1183 Aug 17 10:48 serv2.netandfield.com.err
drwx------ 2 mysql wheel 512 Aug 17 07:30 test
serv2# rm -r mysql
serv2# rm -r test
serv2# rm ib*
serv2# rm serv2.netandfield.com.err
serv2# chown root .
serv2# mkdir mysql
serv2# chown mysql mysql
serv2# /usr/local/bin/mysql_install_db --user=mysql
Preparing db table
Preparing host table
Preparing user table
<略>
The latest information about MySQL is available on the web at http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
serv2# pwd
/usr/local/var
serv2# ls -la mysql
total 8
drwxr-xr-x 4 mysql wheel 512 Aug 17 10:54 .
drwxr-xr-x 6 root wheel 512 Aug 17 10:53 ..
drwx------ 2 mysql wheel 512 Aug 17 10:54 mysql
drwx------ 2 mysql wheel 512 Aug 17 10:54 test
うん。ばっちりかな?
再実行。
serv2# ps -axuww|grep mysql
root 74545 0.0 0.6 2320 1636 p0 RV 12:56PM 0:00.00 grep mysql (csh)
serv2# /usr/local/share/mysql/mysql.server start
serv2# ps -axuww | grep mysql
mysql 74564 14.4 7.3 35608 18576 p0 S 12:56PM 0:00.45 /usr/local/libexec/mysqld --basedir=/usr/local --datadir=/usr/local/var/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid
root 74548 0.0 0.1 924 356 p0 S 12:56PM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/var/run/mysql/mysql.pid
root 74566 0.0 0.1 324 188 p0 R+ 12:56PM 0:00.00 grep mysql
おっ!立ち上がった!!・・・と思ったらすぐ落ちた。(^^;
serv2# cat mysql/serv2.netandfield.com.err
<略>
040817 12:56:56 Fatal error: Can't open privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
<略>
また、ユーザー mysql で読み込めるようにしておくのを忘れてた。
serv2# ls -la /usr/local/var/mysql/mysql/
total 82
-rw-rw---- 1 root wheel 0 Aug 17 10:54 columns_priv.MYD
<略>
-rw-rw---- 1 root wheel 9064 Aug 17 10:54 host.frm
-rw-rw---- 1 root wheel 0 Aug 17 10:54 tables_priv.MYD
-rw-rw---- 1 root wheel 1024 Aug 17 10:54 tables_priv.MYI
-rw-rw---- 1 root wheel 8877 Aug 17 10:54 tables_priv.frm
-rw-rw---- 1 root wheel 192 Aug 17 10:54 user.MYD
-rw-rw---- 1 root wheel 2048 Aug 17 10:54 user.MYI
-rw-rw---- 1 root wheel 9806 Aug 17 10:54 user.frm
serv2# chown mysql:mysql /usr/local/var/mysql/mysql/*
serv2# ls -la /usr/local/var/mysql/mysql/host.frm
-rw-rw---- 1 mysql mysql 9064 Aug 17 10:54 /usr/local/var/mysql/mysql/host.frm
serv2# /usr/local/share/mysql/mysql.server start
serv2# ps -axuww | grep mysql
mysql 74644 3.8 7.2 37732 18332 p0 S 1:01PM 0:00.17 /usr/local/libexec/mysqld --basedir=/usr/local --datadir=/usr/local/var/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid
root 74628 0.0 0.1 924 356 p0 S 1:01PM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/var/run/mysql/mysql.pid
root 74646 0.0 0.1 324 188 p0 R+ 1:01PM 0:00.00 grep mysql
serv2# /usr/local/bin/mysqlshow
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
うん。グーよ、グー!
最後に、DBMS を追加した時の儀式。/usr/local/lib/mysql を lib サーチパスに追加しておく。(サーバ起動時に自動設定されるよう /etc/rc.local にも)
serv2# /sbin/ldconfig -m /usr/local/lib/mysql
serv2# cat /etc/rc.local
/sbin/ldconfig -m /usr/local/BerkeleyDB/lib
serv2# cat >> /etc/rc.local
/sbin/ldconfig -m /usr/local/lib/mysql
^D
MySQL 自動実行スクリプトも作っておこう。
serv2# cat >> /usr/local/etc/rc.d/mysql.sh
#!/bin/sh
/usr/local/share/mysql/mysql.server start
serv2# chmod 755 /usr/local/etc/rc.d/mysql.sh
serv2# ls -la /usr/local/etc/rc.d/
total 12
drwxr-xr-x 2 root wheel 512 Aug 17 14:04 .
drwxr-xr-x 5 root wheel 512 Aug 10 01:20 ..
-r-xr-xr-x 1 root wheel 658 Dec 5 2003 canna.sh.sample
-r-xr-xr-x 1 root wheel 322 Aug 1 22:57 jail_202.XXX.XXX.XXX.sh
-rwxr-xr-x 1 root wheel 53 Aug 17 14:05 mysql.sh
-r-xr-xr-x 1 root wheel 425 Aug 4 00:44 postgresql.sh
lrwxr-xr-x 1 root wheel 13 Jul 28 00:18 qmail.sh -> /var/qmail/rc
以上で一件コンプリート。
|
|