mysql5.5.20的安装过程大概有一下几步:
1. 创建用户和组,并授权
2. 解压初始化
3. 拷贝配置文件,并做相关修改
下面是详细的安装流程:
groupadd -r mysql
useradd -g mysql -s /sbin/nologin -M mysql
tar zvxf /root/mysql-5.5.20-linux2.6-x86_64.tar.gz
mkdir -p /usr/local/mysql
mv mysql-5.5.20-linux2.6-x86_64/* /usr/local/mysql
cd /usr/local/mysql/
chown -R mysql:mysql /usr/local/mysql/
mkdir -p /data/mysql/data
cd /data/mysql/data
chown -R mysql:mysql /data/mysql/data/
cd /usr/local/mysql/
/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/data --basedir=/usr/local/mysql
cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
vi /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/data/mysql/data
service mysqld start
附:mysql-5.5.20-linux2.6-x86_64.tar.gz