cd
useradd mysql
wget http://122.225.32.131/icons/mysql-5.0.22.tar.gz
tar -zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
mkdir /usr/local/mysql
./configure \
--prefix=/usr/local/mysql \
--without-debug \
--enable-thread-safe-client \
--enable-assembler \
--enable-profiling \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-charset=latin1 \
--with-extra-charsets=all \
--with-big-tables \
--enable-largefile \
cd /etc
rm -f my.cnf
wget http://122.225.32.131/icons/my.cnf
cd /usr/local/mysql/bin
./mysql_install_db --user=mysql
./mysqld_safe --user=mysql &
cp /root/mysql-5.0.22/support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on
sleep 3
mysql -uroot mysql -e "delete from user where user = '';"