I. Environment
System CentOS 6.4x64
Two. Installing dependent packages
#添加epel源 [[email protected] ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64 /epel-release-6-8.noarch.rpm[[email protected] ~]# sed -i ' [email protected]#[ Email protected]@g ' /etc/yum.repos.d/epel.repo [[email protected] ~]# sed -i ' [email protected]@#[email protected] ' /etc/yum.repos.d/epel.repo# Configure time synchronization [email protected] ~]# echo "*/10 * * * * /usr/sbin/ntpdate Asia.pool.ntp.org &>/dev/null " >/var/spool/cron/root[[email protected] ~]# yum groupinstall "Development tools" -y[[email protected] ~]# yum update && yum upgrade[[email protected] ~]# yum install vim python wget curl git openssh-server -y[[email protected] ~]# Yum install sqlite sqlite-devel mysql mysql-libs mysql-devel -y[[email protected] ~]# Yum install ncurses-devel libcurl-devel libcurl patch -y[[email protected] ~]# yum install libxslt-devel libyaml-devel libxml2 libxml2-devel gdbm-devel libffi libffi-devel zlib zlib-devel openssl-devel readline Readline-devel curl-devel openssl-devel pcre-devel memcached-devel valgrind-devel imagemagick-devel imagemagick libicu libicu-devel make bzip2 autoconf automake libtool bison redis libpq-devel libicu-devel postgresql-libs postgresql-devel -y[[email protected] ~]# chkconfig redis on[[email protected] ~]# chkconfig postfix on[[email protected] ~]# service Redis startstarting redis-server:   [  OK  ]
Three. Install the configuration MySQL
Here we use the script to install MySQL, the version is the pre-downloaded good mysql-5.5.37
The script content is as follows
[[email protected] ~]# cat install_mysql.sh #!/bin/bash datadir= '/data/ Mysql/data ' version= ' mysql-5.5.37 ' EXPORT LANG=ZH_CN. utf-8 #Source function library. /etc/init.d/functions #camke install mysql5.5.xinstall_mysql () { read -p "Please input a password for root: " PASSWD if [ ! -d $DATADIR ];then mkdir -p $DATADIR fi yum install cmake make gcc-c++ bison-devel ncurses-devel -y id mysql &>/dev/null if&nBsp [ $? -ne 0 ];then useradd mysql -s /sbin/nologin -M fi #useradd mysql -s /sbin/ nologin -m #change datadir owner to mysql chown -r mysql.mysql $DATADIR cd #wget http:// mirrors.sohu.com/mysql/mysql-5.5/mysql-5.5.38.tar.gz tar xf $VERSION .tar.gz cd $VERSION cmake . -dcmake_install_prefix=/usr/local/$VERSION -dmysql_datadir= $DATADIR -dmysql_unix_addr= $DATADIR /mysql.sock -ddefault_charset=utf8 -DDEFAULT_COLLATION=utf8_general_ci -denabled_local_infile=on -dwith_ Innobase_storage_engine=1 -dwith_federated_storage_engine =1 -dwith_blackhole_storage_engine=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -dwithout_partition_storage_engine=1 make && make install if [ $? -ne 0 ];then action "install Mysql is failed " /bin/false exit $? fi sleep 2 #link ln -s /usr/local/$VERSION/ /usr/local/mysql ln -s /usr/local/mysql/bin/* /usr/bin/ #copy config and start file /bin/cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf cp /usr/local/mysql/support-files/mysql.server /etc/init.d/ Mysqld chmod 700 /etc/init.d/mysqld # init mysql /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir= $DATADIR --user=mysql if [ $? -ne 0 ];then action "install mysql is failed" /bin/false exit $? fi #check mysql /etc/init.d/mysqld start if [ $? -ne 0 ];then action "Mysql start is failed" / Bin/false exit $? fi Chkconfig --add mysqld chkconfig mysqld on /usr/local/mysql/bin/mysql -e "update Mysql.user set password=password (' $PASSWD ') where host= ' localhost ' and user= ' Root '; ' /usr/local/mysql/bin/mysql -e "update Mysql.user set password=password (' $PASSWD ') where host= ' 127.0.0.1 ' and user= ' Root '; ' /usr/local/mysql/bin/mysql -e "Delete from mysql.user where Password= "; /usr/local/mysql/bin/mysql -e "Flush privileges ;" #/usr/local/mysql/bin/mysql -e "Select version ( );" >/dev/null 2>&1 if [ $? -eq 0 ];then echo "+---------------------------+" echo "+------MySQL Installation complete--------+" echo "+---------------------------+" fi #/etc/init.d/ Mysqld stop} install_mysql
This article is from the "ly36843" blog, please be sure to keep this source http://ly36843.blog.51cto.com/3120113/1693196
Install Deployment Gitlab CI