MySQL 的安装步骤
时间:2010-03-17 来源:wizardzj
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 &
cd bin
./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
./mysqladmin -u root -ppassword shutdown
cd /infowarelab/mysql
bin/mysqld_safe --user=mysql &
# Post-Installation: Start mysql automatically
cd bin
./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
# Post-Installation: my.cnf configuration
# For <10.0.0.34>
cp /infowarelab/src/34.my.ini /etc/my.cnf
# For <10.0.0.35>
cp /infowarelab/src/35.my.ini /etc/my.cnf
# Restart the mysql instance
cd /infowarelab/mysql
bin/mysqld_safe --user=mysql &
ps -ef | grep mysql