安装依赖库
yum install gcc-c++
yum install bison cmake
yum install ncurses-libs
yum install ncurses-devel
yum install automake
创建用户组
/usr/sbin/groupadd MysqL
/usr/sbin/useradd -g MysqL MysqL
解压源码包,编译安装
tar zxf MysqL-5.5.49.tar.gz
cd MysqL-5.5.49/
cmake .
make && make install
cd /usr/local/MysqL
chown -R MysqL .
chgrp -R MysqL .
scripts/MysqL_install_db --user=MysqL
chown -R root .
chown -R MysqL data
启动服务,并检查是否能正常运行
bin/MysqLd_safe --user=MysqL &
查看MysqL进程是否启动,
cp support-files/MysqL.server /etc/init.d/MysqLd
chmod 755 /etc/init.d/MysqLd
ll /etc/init.d/MysqLd
用service启动MysqL
export PATH=/usr/local/MysqL/bin:$PATH
source /etc/profile
ln -s /var/lib/MysqL/MysqL.sock /tmp/MysqL.sock
service MysqLd start/stop/restart
MysqL -u root
原文链接:https://www.f2er.com/centos/382165.html