1 安装依赖库和创建用户
yum install ncurses-devel -y
useradd -M -s /sbin/nologin MysqL
2 解压文件及安装
tar zxvf MysqL-5.1.73.tar.gz
cd MysqL-5.1.73
./configure --prefix=/usr/local/MysqL
make
make install
3 设置目录访问权限和拷贝配置及启动文件
chown -R MysqL.MysqL /usr/local/MysqL/
cp support-files/my-medium.cnf /etc/my.cnf
/usr/local/MysqL/bin/MysqL_install_db --user=MysqL
chown -R root /usr/local/MysqL/
chown -R MysqL /usr/local/MysqL/var/
cp support-files/MysqL.server /etc/init.d/MysqLd
chmod +x /etc/init.d/MysqLd
chkconfig MysqLd on
4 加入环境变量
echo 'PATH=/usr/local/MysqL/bin/:$PATH' >>/etc/profilesource /etc/profile
原文链接:https://www.f2er.com/centos/378698.html