takt@Wiki

MYSQL5 in RedHatLinux EnterPrice4

最終更新:

Bot(ページ名リンク)

- view
メンバー限定 登録/ログイン

MYSQL5(バイナリファイル) インストールメモ


1.インストール
mysqlバイナリファイルをDL

$ cd /usr/loca/
$ wget mysql-5.0.37-linux-i686-glibc23.tar.gz
$ tar zxvf mysql-5.0.37-linux-i686-glibc23.tar.gz
$ ln -s ./mysql-5.0.37-linux-i686-glibc23 ./mysql
$ cd ./mysql
$ chmod u+rx ./scripts/mysql_install_db
$ ./scripts/mysql_install_db


2.ユーザとグループの作成

# groupadd mysql
# useradd -M -g mysql mysql
$ pwd
/usr/local/mysql
$ chown -R root  .
$ chown -R mysql ./data
$ chgrp -R mysql .


3.設定ファイルの編集

$ cp ./support-files/my-medium.cnf /etc/my.cnf
$ emacs /etc/my.cnf

[client]
port = 3306
socket = /tmp/mysql.sock

[mysql]
#safe-updatesはコメント(使わない通常モード)のままで
#safe-updates
default-character-set = ujis

[mysqldump]
default-character-set = ujis

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-networking
default-character-set = ujis
tmpdir = /tmp/


4.確認

$ pwd
/usr/local/mysql
$ ./bin/mysqlshow
$ ./bin/safe_mysqld --user=mysql &

$ ./bin/mysqladmin -u root drop test

$ ./bin/mysqladmin -u root password *******

$ ./bin/mysql -u root -p
Enter password: ******:
mysql> use mysql
mysql> delete from user where user='';
mysql> flush privileges;
mysql> exit


5.パスを通す(通してない)
/etc/profileに追記

if ! echo $PATH | /bin/grep -q "/usr/local/mysql/bin" ; then
	PATH="$PATH:/usr/local/mysql/bin"
fi


6.Linux起動時にMySQLを起動

$ cp /usr/local/mysql/support-files/mysql/mysql.server /etc/init.d
$ /sbin/chkconfig --add mysql.server


7.httpd.conにphpを追記

$ emacs /etc/httpd/conf/httpd.conf

DirectoryIndex index.html index.html.var index.php # index.phpを追記する。
AddType application/x-httpd-php .php


参考URL:



ウィキ募集バナー