详解CentOS 7.0源码包搭建LNMP 实际环境搭建_Linux

Centos7+Nginx1.11.7+MySQL5.7.16+PHP7.1.0+openssl-1.1.0c

一、linux 系统限制配置

1、关闭系统防火墙    

systemctl stop firewalld.service 关闭防火墙
systemctl disable firewalld.service 禁用防火墙

2、关闭SElinux

sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0 selinux 立即生效

二、系统安装约定

软件源代码包存放位置:/usr/local/src

源码包编译安装位置:/usr/local/软件名字

三、下载软件包

1、下载nginx最新稳定版本

 wget -P /usr/local/src http://nginx.org/download/nginx-1.11.7.tar.gz

2、下载mysql-boost-5.7.16 带 boost 如果不带源码安装如果网络环境不会可能会出现错误

wget -P /usr/local/src http://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.16.tar.gz

3、下载php-7.1.0版本

wget -P /usr/local/src http://cn2.php.net/distributions/php-7.1.0.tar.gz

4、下载libmemcached-1.0.18

wget -P /usr/local/src https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz

5、下载php-memcached

yum -y install git
cd /usr/local/src
git clone -b php7 https://github.com/php-memcached-dev/php-memcached.git

6、下载openssl-1.1.0c

wget -P /usr/local/src https://www.openssl.org/source/openssl-1.1.0c.tar.gz

四、安装编译器及依赖

yum -y insyall epel-release
yum -y install patch gcc gcc-c++ readline-devel zlib-devel libffi-devel \
 openssl openssl-devel make autoconf automake libtool bison libxml2 \
 libxml2-devel libxslt-devel libyaml-devel python python-docutils \
 cmake imake expat-devel libaio libaio-devel bzr ncurses-devel wget \
 libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \
 pcre-devel curl-devel libmcrypt libmcrypt-devel

五、编译安装mysql-boost-5.7.16 方便再次安装创建mysql_install.sh脚本

1、mysql_install.sh内容

#!/bin/bash
#yum update -y
#yum install -y cmake gcc-c++ ncurses-devel gcc make openssl*
#mysql安装脚本
DBDIR='/data/mysql' #mysql数据存储目录
MYSQLDIR='/usr/local/mysql' # mysql安装目录
PASSWD='123456' # mysql root密码 安装完成可远程ip登陆
[ -d $DBDIR ] || mkdir $DBDIR -p
id mysql &> /dev/null
if [ $? -ne 0 ];then
 useradd mysql -s /sbin/nologin -M
fi
chown -R mysql:mysql $DBDIR
cd /usr/local/src
tar -xvf mysql-boost-5.7.16.tar.gz
cd mysql-5.7.16
cmake . -DCMAKE_INSTALL_PREFIX=$MYSQLDIR \
-DMYSQL_DATADIR=$DBDIR \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_LIBWRAP=0 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_BOOST=/usr/local/src/mysql-5.7.16/boost/boost_1_59_0 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
if [ $? != 0 ];then
 echo "cmake error!"
 exit 1
fi
make && make install
if [ $? -ne 0 ];then
 echo "install mysql is failed!" && /bin/false
fi
sleep 2
chown -R mysql:mysql $MYSQLDIR
chown -R root:root $MYSQLDIR
cp $MYSQLDIR/support-files/my-default.cnf /etc/my.cnf
echo export PATH=$PATH:$MYSQLDIR/bin:$MYSQLDIR/lib >>/etc/profile
source /etc/profile
cat >> /etc/my.cnf << EOF
character_set_server = utf8
basedir = $MYSQLDIR
datadir = $DBDIR
port = 3306
server_id = 1
socket = /tmp/mysql.sock
explicit_defaults_for_timestamp=true
EOF
sed -i 's/sql_mode=.*/sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER/g' /etc/my.cnf
  source /etc/profile
  sleep 5
  cd $MYSQLDIR
  cp support-files/mysql.server /etc/init.d/mysqld
  chmod 700 /etc/init.d/mysqld
  mysql_ssl_rsa_setup
  rm -rf $DBDIR
  mysqld --initialize --user=mysql
  if [ $? -ne 0 ];then
 echo "install mysql is failed!" && /bin/false
fi
#/etc/init.d/mysqld stop
  mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
  sleep 5
  echo "update user set authentication_string=Password('$PASSWD') where user='root'; flush privileges;" | mysql mysql

  echo "set password=Password('$PASSWD'); flush privileges;" | mysql -u root -p$PASSWD --connect-expired-password
  sleep 5
  echo "GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY '$PASSWD'; FLUSH PRIVILEGES; " | mysql -u root -p$PASSWD
  /etc/init.d/mysqld restart
  if [ $? -ne 0 ];then
 echo "install mysql is failed!" && /bin/false
fi
IDSO=`cat /etc/ld.so.conf| grep $MYSQLDIR/lib | wc -l `
if [ $IDSO -eq 0 ];then
echo "$MYSQLDIR/lib" >> /etc/ld.so.conf
ldconfig
fi
chkconfig mysqld on

2、给 mysql_install.sh  可执行权限

chmod +x mysql_install.sh

3、运行mysql_install.sh 

./mysql_install.sh

六、编译安装php7  创建php安装脚本php7_install.sh

1、vim php7_install.sh

#!/bin/bash
if [ $( find / -name mysql | wc -l ) -gt 1 ];then
echo " mysql is install "
else
yum install -y mysql
fi
cd /usr/local/src
tar -xzvf php-7.1.0.tar.gz
cd ./php-7.1.0
./configure \
--prefix=/usr/local/php7 \
--exec-prefix=/usr/local/php7 \
--with-config-file-path=/usr/local/php7/etc \
 --with-curl \
 --with-freetype-dir \
 --with-gd \
 --with-gettext \
 --with-iconv-dir \
 --with-kerberos \
 --with-libdir=lib64 \
 --with-libxml-dir \
 --with-mysqli \
 --with-openssl \
 --with-pcre-regex \
 --with-pdo-mysql \
 --with-pdo-sqlite \
 --with-pear \
 --with-png-dir \
 --with-xmlrpc \
 --with-xsl \
 --with-zlib \
 --with-zlib-dir \
 --with-mhash \
 --with-mcrypt \
 --with-openssl-dir \
 --with-jpeg-dir \
 --enable-fpm \
 --enable-bcmath \
 --enable-libxml \
 --enable-inline-optimization \
 --enable-gd-native-ttf \
 --enable-mbregex \
 --enable-mbstring \
 --enable-opcache \
 --enable-pcntl \
 --enable-shmop \
 --enable-soap \
 --enable-sockets \
 --enable-sysvsem \
 --enable-xml \
 --enable-zip
make && make install

# 中文php画图取消这个参数,不然会出现乱码
# --enable-gd-jis-conv \

2、给 php7_install.sh 可执行权限

chmod +x php7_install.sh

3、执行 php7_install.sh

./php7_install.sh

4、编译安装libmemcached-1.0.18

vim libmemcached_install.sh

#/!bin/bash
cd /usr/local/src
tar -zxvf libmemcached-1.0.18.tar.gz
cd ./libmemcached-1.0.18
./configure --prefix=/usr/local/libmemcached
make && make install

chmod +x libmemcached_install.sh
./libmemcached_install.sh

5、编译安装php-memcached

vim memcached_install.sh

#!/bin/bash
cd /usr/local/src/php-memcached
/usr/local/php7/bin/phpize
./configure --with-libmemcached-dir=/usr/local/libmemcached \
 --with-php-config=/usr/local/php7/bin/php-config \
 --disable-memcached-sasl
make && make install

chmod +x memcached_install.sh
./memcached_install.sh

留意编完成生成文件路径

Installing shared extensions:  /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/

七、编译安装openssl-1.1.0c

vim openssl_install.sh

#!/bin/bash
#openssl install
cd /usr/local/src
tar -xvf openssl-1.1.0c.tar.gz
cd /usr/local/src/openssl-1.1.0c
./config --openssldir=/usr/local/ssl
make && make install
./config shared --openssldir=/usr/local/ssl
make clean
make && make install
IDSO=`cat /etc/ld.so.conf| grep /usr/local/lib64 | wc -l `
if [ $IDSO -eq 0 ];then
echo "/usr/local/lib64" >> /etc/ld.so.conf
fi
ldconfig

chmod +x openssl_install.sh
./openssl_install.sh

八、编译安装nginx-1.11.7

vim nginx_install.sh

#!/bin/bash
# nginx install
id nginx &> /dev/null
if [ $? -ne 0 ];then
 groupadd -r nginx
 useradd -g nginx -r nginx
fi
cd /usr/local/src
tar -xvf nginx-1.11.7.tar.gz
cd /usr/local/src/nginx-1.11.7
./configure --prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-threads \
--with-stream \
--with-openssl=/usr/local/src/openssl-1.1.0c \ # openssl 源码解压路径
--with-stream_ssl_module \
--with-http_slice_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-http_v2_module \
--with-ipv6
mkdir -pv /var/cache/nginx/{client_temp,proxy_temp,fastcgi_temp,uwsgi_temp,scgi_temp}
make && make install

2、给nginx_install.sh可执行权限

 chmod +x nginx_install.sh
 ./nginx_install.sh

九、配置PHP7

/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/memcached.so

这个路径是 随机可变的所以要注意

留意变完成生成文件路径

Installing shared extensions:     /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/

cd /usr/local/src/php-7.1.0
cp php.ini-production /usr/local/php7/etc/php.ini
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
sed -i "s/user = .*/user = nginx/g" /usr/local/php7/etc/php-fpm.d/www.conf
sed -i "s/group = .*/group = nginx/g" /usr/local/php7/etc/php-fpm.d/www.conf
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig php-fpm on
cat >> /usr/local/php7/etc/php.ini<< EOF
soap.wsdl_cache_enabled=1
max_input_time = 600
max_execution_time = 300
date.timezone = Asia/Shanghai
post_max_size = 32M
memory_limit = 128M
mbstring.func_overload = 1
extension=/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/memcached.so
EOF
cat > /usr/local/nginx/html/index.php<<EOF
<?php
phpinfo();
?>
EOF
service php-fpm start

十、配置nginx

1、重命名:/etc/nginx/nginx.conf

mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.back

2、新建/etc/nginx/nginx.conf

cat > /etc/nginx/nginx.conf << EOF
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid  /var/run/nginx.pid;

events {
 worker_connections 1024;
}

http {
 include  /etc/nginx/mime.types;
 default_type application/octet-stream;

 log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" '
      '\$status \$body_bytes_sent "\$http_referer" '
      '"\$http_user_agent" "\$http_x_forwarded_for"';

 access_log /var/log/nginx/access.log main;

 sendfile  on;
 #tcp_nopush  on;

 keepalive_timeout 65;

 #gzip on;

 include /etc/nginx/conf.d/*.conf;
}
EOF

3、创建/etc/nginx/conf.d

mkdir -p /etc/nginx/conf.d

4、创建支持php-fpm web nginx配置

cat > /etc/nginx/conf.d/default.conf << EOF
server {
  listen  80;
  server_name localhost;

  #charset koi8-r;

  #access_log logs/host.access.log main;

  location / {
   root /usr/local/nginx/html;
   index index.php index.html index.htm;
  }

  #error_page 404    /404.html;

  # redirect server error pages to the static page /50x.html
  #
  error_page 500 502 503 504 /50x.html;
  location = /50x.html {
   root html;
  }

  # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  #
  #location ~ \.php$ {
  # proxy_pass http://127.0.0.1;
  #}

  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  location ~ \.php$ {
   root   /usr/local/nginx/html;
   fastcgi_pass 127.0.0.1:9000;
   fastcgi_index index.php;
   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
   include  fastcgi_params;
  }
  location ~* ^.+\.(jpg|jpeg|gif|png|bmp)$ {
   access_log off;
   root  opencart;
   expires  30d;
      break;
  }
}
EOF

5、创建nginx启动脚本

vim /etc/init.d/nginx

# chkconfig: 2345 10 90
# description: Start and Stop nginx

PATH=/usr/local/bin:/sbin:/usr/bin:/bin

EXEC=/usr/sbin/nginx
PIDFILE=/var/run/nginx.pid
CONF="/etc/nginx/nginx.conf"
AUTH="1234"

case "$1" in
  start)
    if [ -f $PIDFILE ]
    then
      echo "$PIDFILE exists, process is already running or crashed."
    else
      echo "Starting nginx server..."
      $EXEC -c $CONF &
    fi
    if [ "$?"="0" ]
    then
      echo "nginx is running..."
    fi
    ;;
  stop)
    if [ ! -f $PIDFILE ]
    then
      echo "$PIDFILE exists, process is not running."
    else
      PID=$(cat $PIDFILE)
      echo "Stopping..."
      kill -9 $PID
      PID=$(pidof nginx)
      kill -9 $PID
      rm -rf /var/run/nginx.pid
      sleep 2
      while [ -x $PIDFILE ]
      do
        echo "Waiting for nginx to shutdown..."
        sleep 1
      done
      echo "nginx stopped"
    fi
    ;;
  reload)

   $EXEC -s reload
    ;;
  restart|force-reload)
    ${0} stop
    ${0} start
    ;;
  *)
    echo "Usage: /etc/init.d/nginx {start|stop|restart|force-reload|reload}" >&2
    exit 1
esac

6、给 /etc/init.d/nginx 可执行权限

chmod +x /etc/init.d/nginx

7、设置开机启动

chkconfig nginx on

8、启动nginx

service nginx start

十一、测试

[root@QKA169 src]# openssl version
OpenSSL 1.1.0c 10 Nov 2016
mysql -u root -p123456
mysql> show databases;
+--------------------+
| Database   |
+--------------------+
| information_schema |
| mysql    |
| performance_schema |
| sys    |
+--------------------+
4 rows in set (0.00 sec)
看看是否登陆成功。远程带IP是否登陆成功
mysql -u root -h192.168.1.69 -p123456
mysql> show databases;
+--------------------+
| Database   |
+--------------------+
| information_schema |
| mysql    |
| performance_schema |
| sys    |
+--------------------+
4 rows in set (0.00 sec)

mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.16 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

测试nginx 是否能打开

[root@QKA169 html]# ps -ef | grep php-fpm
root  337433  1 0 18:03 ?  00:00:00 php-fpm: master process (/usr/local/php7/etc/php-fpm.conf)
nobody 337434 337433 0 18:03 ?  00:00:00 php-fpm: pool www
nobody 337435 337433 0 18:03 ?  00:00:00 php-fpm: pool www
root  337454 37888 0 18:12 pts/0 00:00:00 grep --color=auto php-fpm
[root@QKA169 html]# ps -ef | grep nginx
root  337400  1 0 18:01 ?  00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx  337401 337400 0 18:01 ?  00:00:00 nginx: worker process
root  337456 37888 0 18:13 pts/0 00:00:00 grep --color=auto nginx
[root@QKA169 html]# netstat -nalp | grep 80
tcp  0  0 0.0.0.0:80    0.0.0.0:*    LISTEN  337400/nginx: maste
tcp  0  0 192.168.1.69:80   192.168.6.6:54714  TIME_WAIT -
tcp  0  0 192.168.1.69:80   192.168.6.6:54709  TIME_WAIT -
远程打开
http://192.168.1.69/

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索centos
, centos7
, lnmp环境搭建
centos7搭建lnmp
centos7 lnmp环境搭建、centos lnmp环境搭建、centos7搭建lnmp、centos6.5搭建lnmp、centos6 lnmp环境搭建,以便于您获取更多的相关知识。

时间: 2024-10-30 10:21:29

详解CentOS 7.0源码包搭建LNMP 实际环境搭建_Linux的相关文章

库-配置QT5.5.0源码包时总出现找不到工具链,各种情况尝试如下:请纠错!!!

问题描述 配置QT5.5.0源码包时总出现找不到工具链,各种情况尝试如下:请纠错!!! 前提: 自己用户的shell:修改了$HOME/.bashrc 中的export PATH=/usr/local/arm/arm-2009q3/bin:$PATH 系统环境变量:修改了/etc/profile 中的 export PATH=/usr/local/arm/arm-2009q3/bin:$PATH 全部用户的shell:修改了/etc/bash.bashrc中的 export PATH=/usr/

Android编程动态加载布局实例详解【附demo源码】_Android

本文实例讲述了Android编程动态加载布局的方法.分享给大家供大家参考,具体如下: 由于前段时间项目需要,需要在一个页面上加载根据不同的按钮加载不同的布局页面,当时想到用 tabhot .不过美工提供的界面图完全用不上tabhot ,所以想到了动态加载的方法来解决这一需求.在这里我整理了一下,写了一个 DEMO 希望大家以后少走点弯路. 首先,我们先把界面的框架图画出来,示意图如下: 中间白色部门是一个线性布局文件,我喜欢在画图的时候用不同的颜色将一块布局标示出来,方便查看.布局文件代码如下:

jQuery实现可以编辑的表格实例详解【附demo源码下载】_jquery

本文实例讲述了jQuery实现可以编辑的表格.分享给大家供大家参考,具体如下: 今天小编主要给大家讲解一下,如何利用jQuery+js+css实现表格的编辑.接下来,小编就简单总结一下如何实现这个小例子. 第一步:编写html代码,代码如下所示: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> &l

jQuery实现的纵向下拉菜单实例详解【附demo源码下载】_jquery

本文实例讲述了jQuery实现的纵向下拉菜单.分享给大家供大家参考,具体如下: 当我们浏览网页和使用word编辑一下文字的时候,我们都能看见横向下拉的身影,有了横向菜单,我们能对整个界面进行更好的布局,达到我们想要的效果,那么这些横向菜单式如何用代码实现的,当我们浏览或使用的时候她又是如何呈现在我们面前的,学习了JQuery之后,小编渐渐看到她美丽的容颜,接下来,小编主要讲解如何通过jquery实现纵向下拉菜单. 第一步,我们来编写html的代码,如下所示: <!DOCTYPE html PUB

最新源码包通过脚本部署LAMP搭建Discuz论坛

LAMP是一个缩写,它指一组通常一起使用来运行动态网站或者服务器的自由软件:Linux+Apache+MySQL+php,自从Nginx的出现,Apache的一部分市场份额被Nginx获得,原因是由于Apache的高并发性能不及Nginx.前不久Apache团队发布了httpd的2.4版本,性能上做了非常大的提升,为的就是挽回失去的市场份额,当然2.4版本刚刚出来不久,需要1-2年的时间才能够流通.本实验就是通过安装2.4版本,mysql用的是mysql-5.5版本进行安装部署的.接着我们开始进

Android编程实现的微信支付功能详解【附Demo源码下载】

本文实例讲述了Android编程实现的微信支付功能.分享给大家供大家参考,具体如下: 最近公司弄Ionic框架,项目中需要微信支付,无奈,把我调过去弄,期间也是几近崩溃,好在皇天不负有心人,在看别人的文档,终于是在项目中集成了微信支付,下面作为一个小白的我,想要把我的经验分享给大家,希望对大家有所帮助. 先给一个可用的demo吧(运行前先看txt文件) demo代码点击此处本站下载. 这个demo是基于eclipse开发的,博主也在Android Studio开发过微信支付,原理都是一样的,大家

Android编程实现仿优酷圆盘旋转菜单效果的方法详解【附demo源码下载】

本文实例讲述了Android编程实现仿优酷圆盘旋转菜单效果的方法.分享给大家供大家参考,具体如下: 目前,用户对安卓应用程序的UI设计要求越来越高,因此,掌握一些新颖的设计很有必要. 比如菜单,传统的菜单已经不能满足用户的需求. 其中优酷中圆盘旋转菜单的实现就比较优秀,这里我提供下我的思路及实现,仅供参考. 该菜单共分里外三层导航菜单.可以依次从外向里关闭三层菜单,也可以反向打开,并且伴有圆盘旋转的动画效果 首先,看下效果: 以下是具体的代码及解释: 1. 菜单布局文件: 大家看到主要有三个Ra

如何在源码包编译安装的 LEMP 环境下开启 OpenSSL 功能

如何在源码包编译安装的 LEMP 环境下开启 OpenSSL 功能 Hello,大家好!我是--邪恶君子! 今天,给大家分享一下解决源码包编译安装 LEMP 环境下开启 OpenSSL 功能问题的过程.前几天,在访问页面时,突然报错,要求开启 openssl 功能.那怎么办呢,首先想到的是 yum 安装,但是,安装后还是没解决,因为 LEMP 的环境是源码包编译安装的,所以,还需要编译安装 openssl. 经过邪恶不懈的努力,终于找到了解决办法,而且真的成功了,下面就给大家分享一下! 首先,要

Centos 5.8中用Shell脚本一键安装mysql 5.5.25源码包

最近在研究mysql集群,至少要安装部署2台或者多台mysql数据库,操作起来即麻烦又很耗时,今天根据安装步骤写了一个Shell脚本,只需执 行以下脚本就可以快速安装mysql数据库,对初学者或者想学习mysql集群的朋友非常方便,即省时,又省力. 操作系统及其mysql配置文件说明: Linux系统:Centos5.8 mysql:mysql-5.5.25tar.gz源码包 安装目录:/usr/local/mysql/ 数据目录:/data/mysql/3306/data/ 二进制日志:/da