shell一键安装mysql5.5.35

#!/bin/bash

VERSION=5.5.35
program_path=$HOME/work/odp/programs/mysql-${VERSION}
tmp_dir=$HOME/work/odp/tmp

mkdir -p ${tmp_dir}
cd ${tmp_dir}
#wget http://downloads.mysql.com/archives/get/file/mysql-5.5.35.tar.gz
wget http://cp01-ocean-705.epc.baidu.com:8920/www/mysql-5.5.35.tar.gz

tar zxf mysql-${VERSION}.tar.gz
cd mysql-${VERSION}
cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=${program_path} -DMYSQL_DATADIR=${program_path}/var
make -j 8
make install

cd $program_path
wget http://cp01-ocean-705.epc.baidu.com:8920/www/my.cnf
scripts/mysql_install_db --defaults-file=./my.cnf

猜你喜欢

转载自blog.csdn.net/weixin_36521716/article/details/81032037