分类: Mysql/postgreSQL
2008-06-24 10:53:54
# Install mysql
groupadd mysql
useradd -g mysql -s `which nologin` mysql
cd /infowarelab
tar zxf /infowarelab/src/mysql-standard-5.0.24a-linux-x86_64-glibc23.tar.gz
mv mysql-standard-5.0.24a-linux-x86_64-glibc23 mysql
cd mysql
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
bin/mysqld_safe --user=mysql &
mysqladmin -u root password 'password'
# To verify mysql installation
mysqladmin -u root -ppassword version
mysqladmin -u root -ppassword variables
# To make sure the mysql server could be shutdown and startup normally
cd /infowarelab/mysql
mysqladmin -u root -ppassword shutdown
bin/mysqld_safe --user=mysql &
# Post-Installation: Start mysql automatically
mysqladmin -u root -ppassword shutdown
ps -ef | grep mysql
cp /infowarelab/mysql/support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
chkconfig --level 345 mysql on