# mysql 소스 설치
tar xvfpz mysql-5.0.83.tar.gz
cd mysql-5.0.83
useradd -M -r -d /var/lib/mysql -s /bin/bash -c "MySQL Server" -u 27 mysql
./configure
--prefix=/opt/webapps/mysql5
--localstatedir=/var/lib/mysql5
--with-thread-safe-client
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--enable-thread-safe-client
--without-debug
--without-docs
--without-bench
--with-charset=utf8
--with-language=korea
--with-extra-charsets=all
--with-plugins=innobase
make
make install
mv my.cnf /etc/my.cnf
mv mysqld.log /etc/logrotate.d/mysqld
mv mysqld_5 /etc/init.d/mysqld
chmod 700 /etc/init.d/mysqld
chkconfig --level 345 mysqld on
chmod 640 /etc/logrotate.d/mysqld
chown root.root /etc/logrotate.d/mysqld
/opt/webapps/mysql5/bin/mysql_install_db
chown mysql.nobody /var/lib/mysql5/
chown mysql.mysql /var/lib/mysql5/* -R
chmod 710 /var/lib/mysql5/
rm -rf /opt/webapps/mysql5/mysql-test
rm -rf /var/lib/mysql5/test
ln -s /tmp/mysql.sock /var/lib/mysql5/mysql.sock
update user set password=password('pwpwpwpw') where user='root';
update user set host='%' where host='localhost' and user='root';
flush privileges;