伺服器資訊:centos7
安裝步驟:
yum install lrzsz -y
rz # 選擇檔案,上傳
rpm -ivh mysql-community-5.7.29-1.el7.src.rpm
cd /root/rpmbulid/SOURCES
tar xf mysql-5.7.29.tar.gz
tar xf boost_1_59_0.tar.bz2
mv boost_1_59_0 mysql-5.7.29
cd mysql-5.7.29
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/yst_mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=boost_1_59_0
make -j 2
make install
cp /etc/my.cnf /root/mysql.cnf.bak #備份原來的
>/etc/my.cnf # 清空檔案
cd /usr/local/yst_mysql/bin
./mysqld --initialize --user=mysql --basedir=/usr/local/yst_mysql --datadir==/data/mysql &>/root/temp_password.txt
echo "PATH=$PATH:/usr/local/sc_mysql/bin" >>/etc/bashrc
cp ../support-files/mysql.server /etc/init.d/mysqld
service firewalld stop #關閉防火牆firewalld服務
systemctl disable firewalld #設定firewalld服務開機不啓動
setenforce 0 #臨時關閉selinux
sed -i 's/=enforcing/=disabled/g' /etc/selinux/config #永久修改selinux組態檔裡的內容
chkconfig mysqld on
service mysqld start
netstat -anplut |grep mysql # 檢視mysql的進程是否起來
lsof -i:3306