ファイルの拡張子をhtmlからphpに変更したためアドレスが変わりました。 新しいページはこちらからお入りください。

2003年11月29日

Mysqlのインストール

# tar xvfz /home/****/work/mysql-3.23.58-pc-linux-i686.tar.gz
# ln -s ./mysql-3.23.58-pc-linux-i686 ./mysql
# cd mysql
# chmod u+rx ./scripts/mysql_install_db
# ./scripts/mysql_install_db
# groupadd mysql
# useradd -M -g mysql mysql
# chown -R root .
# chown -R mysql ./data
# chgrp -R mysql .
# cp ./support-files/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf


# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-networking
user = mysql
default-character-set = ujis

skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = table_cache=64
set-variable = sort_buffer=512K
set-variable = net_buffer_length=8K
set-variable = myisam_sort_buffer_size=8M
log-bin
server-id = 1

# Point the following paths to different dedicated disks
tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#set-variable = bdb_cache_size=4M
#set-variable = bdb_max_lock=10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/var/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/var/
#innodb_log_arch_dir = /usr/local/mysql/var/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
set-variable = max_allowed_packet=16M
#add kato
default-character-set = ujis

[mysql]
no-auto-rehash
#add kato
default-character-set = ujis
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
set-variable = key_buffer=20M
set-variable = sort_buffer=20M
set-variable = read_buffer=2M
set-variable = write_buffer=2M

[myisamchk]
set-variable = key_buffer=20M
set-variable = sort_buffer=20M
set-variable = read_buffer=2M
set-variable = write_buffer=2M

[mysqlhotcopy]
interactive-timeout


バックグラウンドでsafe_mysqldスクリプトを起動
# ./bin/safe_mysqld --user=mysql &

テスト用DBを削除
# ./bin/mysqladmin -u root drop test
Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the 'test' database [y/N] y
Database "test" dropped

パスワードを設定
# ./bin/mysqladmin -u root password 'kokonipassword'

# ./bin/mysql -u root -p
mysql> use mysql
Database changed
mysql> delete from user where user='';
Query OK, 2 rows affected (0.00 sec)
mysql> create database xoops;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on xoops.* to xoops@localhost identified by 'kokonipassword';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye

Mysqlを自動起動
/etc/rc.d/rc.localの一番最後に追加
/bin/sh -c 'cd /usr/local/mysql ;
./bin/safe_mysqld &'


とりあえず・・・

投稿者 kazuhiko : 2003年11月29日 01:08
コメント
コメントする









名前、アドレスを登録しますか?