四虎影视在线影院在线观看,小s货再浪些再咬紧点h,国产精品水嫩水嫩,97精产国品一二三产区
標(biāo)題:
[教程]
WDCP升級(jí)mysql 8.0腳本,親測(cè)可用 2021.01.26
[打印本頁(yè)]
作者:
helen5106
時(shí)間:
2021-1-26 12:39
標(biāo)題:
WDCP升級(jí)mysql 8.0腳本,親測(cè)可用 2021.01.26
#!/bin/bash
# mysql 8.0 update scripts
# Author: wdlinux
# Url: http://cd-genova.com
# Modify: windsage
IN_DIR="/www/wdlinux"
if [ ! $1 ];then
MYS_VER="8.0.11"
else
MYS_VER=$1
fi
echo "升級(jí)有風(fēng)險(xiǎn) 操作需謹(jǐn)慎"
echo "歡迎學(xué)習(xí)交流互助提高"
echo "qq:242013800"
echo
read -p "DO YOU REALLY WANT TO UPDATE? (Y/N): " yn
if [ "$yn" == "Y" ] || [ "$yn" == "y" ]; then
echo "MYSQL IS NOW UPDATING!"
else
exit
fi
echo
echo "-------------------------------------------------------------"
echo
if [ ! -f mysql-boost-${MYS_VER}.tar.gz ];then
# 因mysql5.7需要boost,所以這個(gè)直接是包含boost的源碼包
wget -c https://downloads.mysql.com/archives/get/p/23/file/mysql-boost-${MYS_VER}.tar.gz
fi
yum install -y cmake bison libmcrypt-devel libjpeg-devel libpng-devel freetype-devel curl-devel openssl-devel libxml2-devel zip unzip
if [ ! -d $IN_DIR/mysql-${MYS_VER} ];then
mkdir -p $IN_DIR/mysql-${MYS_VER}
# 數(shù)據(jù)庫(kù)文件夾默認(rèn)要求是data
mkdir -p $IN_DIR/mysql-${MYS_VER}/data
fi
if [ ! -d mysql-${MYS_VER} ];then
tar zxvf mysql-boost-${MYS_VER}.tar.gz
fi
cd mysql-${MYS_VER}
echo "START CONFIGURING MYSQL"
sleep 3
#mkdir -p build
#cd build/
make clean
cmake \
-DFORCE_INSOURCE_BUILD=1 \
-DCMAKE_INSTALL_PREFIX=$IN_DIR/mysql-$MYS_VER \
-DSYSCONFDIR=$IN_DIR/etc \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_SSL=bundled \
-DWITH_DEBUG=OFF \
-DWITH_EXTRA_CHARSETS=complex \
-DENABLED_PROFILING=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DENABLE_DOWNLOADS=1 \
-DWITH_BOOST=./boost/boost_1_66_0/
[ $? != 0 ] && echo "NO! CONFIGURE ERROR! :(" && exit
echo "START MAKE"
sleep 3
make
[ $? != 0 ] && echo "NO! MAKE ERROR! :(" && exit
echo "START MAKE INSTALL"
sleep 3
make install
[ $? != 0 ] && echo "NO! MAKE INSTALL ERROR! :(" && exit
service mysqld stop
#cd ..
# 建立備份文件夾,這個(gè)可以自定義設(shè)置,建議一開(kāi)始就先備份,不要問(wèn)我為什么,這樣可視化安全更放心
if [ ! -d /www/wdlinux/mysql_bk ];then
mkdir -p /www/wdlinux/mysql_bk
cp -pR /www/wdlinux/mysql/data/* /www/wdlinux/mysql_bk
fi
rm -f /www/wdlinux/mysql
ln -sf $IN_DIR/mysql-$MYS_VER /www/wdlinux/mysql
sh scripts/mysql_install_db.sh --user=mysql --basedir=/www/wdlinux/mysql --datadir=/www/wdlinux/mysql/data
chown -R mysql.mysql /www/wdlinux/mysql
chown -R mysql.mysql /www/wdlinux/mysql/data
mv /www/wdlinux/mysql/data/mysql /www/wdlinux/mysql/data/mysqlo
cp support-files/mysql.server /www/wdlinux/init.d/mysqld
chmod 755 /www/wdlinux/init.d/mysqld
service mysqld restart
ln -sf $IN_DIR/mysql/lib/libmysqlclient.so.20. /usr/lib/libmysqlclient.so.20
cd ..
rm -rf mysql-${Ver}/
# rm -rf mysql-${Ver}.tar.gz
sleep 2
service mysqld restart
sleep 2
mysqld --initialize --user=mysql --console
# 或者把備份的數(shù)據(jù)庫(kù)復(fù)制回來(lái),注意不要覆蓋performance_schema
# cp -pR /mnt/mysql_bk/* /www/wdlinux/mysql/data/
echo
echo "-------------------------------------------------------------"
echo "數(shù)據(jù)庫(kù)需要初始化,自動(dòng)生成的密碼會(huì)存入mysql的日志,默認(rèn)在/var/log/mysql/error.log"
echo
echo "此時(shí)查看mysql日志,應(yīng)該一切正常了,但新手朋友注意了,此時(shí)你的httpd無(wú)法啟動(dòng)了,需要編譯安裝php。"
echo
復(fù)制代碼
注意,安裝的事8.0.11, 如果是其他的,需要修改boost的文件夾名字,boost_1_66_0 這個(gè)地方,可以解壓mysql后看看,可能是其他名字
作者:
helen5106
時(shí)間:
2021-1-27 15:51
遇到的問(wèn)題
1. 內(nèi)存不夠容易卡死,增加swap文件
2. my.cnf有寫(xiě)參數(shù)錯(cuò)誤,導(dǎo)致初始化錯(cuò)誤,根據(jù)提示,刪掉一些沒(méi)用參數(shù),把/www/wdlinux/mysql/data重新命名,然后重新初始化
mysqld --initialize --user=mysql --console --basedir=/www/wdlinux/mysql --datadir=/www/wdlinux/mysql/data
作者:
helen5106
時(shí)間:
2021-1-27 16:02
升級(jí)完mysql, 重新編譯php
下面是php 7.3.26
#!/bin/bash
# PHP 7.1 update scripts
# Author: wdlinux
# Url: http://cd-genova.com
# Modify: slrainy
if [ ! $1 ];then
Ver=7.3.26
else
Ver=$1
fi
echo "升級(jí)有風(fēng)險(xiǎn) 操作需謹(jǐn)慎"
echo "歡迎學(xué)習(xí)交流互助提高"
echo "qq:6824498"
echo "點(diǎn)擊鏈接加入群(207118653)【lanmp php thinkphp5 交流】:https://jq.qq.com/?_wv=1027&k=45CsOTO"
echo
#read -p "PRESS ENTER IF YOU REALLY WANT TO UPDATE"
read -p "DO YOU REALLY WANT TO UPDATE? (Y/N): " yn
if [ "$yn" == "Y" ] || [ "$yn" == "y" ]; then
echo "PHP IS NOW UPDATING!"
else
exit
fi
echo
echo "-------------------------------------------------------------"
echo
###yum
yum clean all
yum install -y gcc gcc-c++ make autoconf libtool-ltdl-devel gd-devel freetype-devel libxml2-devel libjpeg-devel libpng-devel openssl-devel curl-devel patch libmcrypt-devel libmhash-devel ncurses-devel bzip2-devel libcap-devel gmp-devel t1lib-devel libc-client-devel sqlite-devel aspell-devel readline-devel recode-devel libtidy-devel libxslt-devel openldap-devel
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
###
if [ ! -f php-${Ver}.tar.gz ];then
wget -c http://cn2.php.net/distributions/php-${Ver}.tar.gz
fi
if [ ! -f iconv_ins.sh ];then
wget -c http://down.wdlinux.cn/in/iconv_ins.sh
fi
sh iconv_ins.sh
###
if [ -f /www/wdlinux/mysql/lib/libmysqlclient.so.20 ];then
if [ -d /usr/lib64 ];then
LIBNCU="/usr/lib64"
else
LIBNCU="/usr/lib"
fi
ln -sf /www/wdlinux/mysql/lib/libmysqlclient.so.20 $LIBNCU
fi
if [ ! -f php-${Ver} ];then
tar zxvf php-${Ver}.tar.gz
fi
cd php-${Ver}
if [ -d /www/wdlinux/apache_php ];then
make clean
./configure \
--prefix=/www/wdlinux/apache_php-${Ver} \
--exec-prefix=/www/wdlinux/apache_php-${Ver} \
--bindir=/www/wdlinux/apache_php-${Ver}/bin \
--sbindir=/www/wdlinux/apache_php-${Ver}/sbin \
--libdir=/www/wdlinux/apache_php-${Ver}/lib/php \
--mandir=/www/wdlinux/apache_php-${Ver}/php/man \
--with-config-file-path=/www/wdlinux/apache_php-${Ver}/etc \
--with-apxs2=/www/wdlinux/apache/bin/apxs \
--with-mhash \
--with-openssl \
--with-mysqli=/www/wdlinux/mysql/bin/mysql_config \
--with-pdo-mysql=/www/wdlinux/mysql \
--with-gd \
--with-iconv \
--with-zlib \
--enable-zip \
--with-kerberos \
--with-pcre-regex \
--with-libxml-dir=/usr \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-curl \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--enable-opcache \
--enable-fpm \
--without-gdbm \
--disable-fileinfo
[ $? != 0 ] && echo "configure err" && exit
make ZEND_EXTRA_LIBS='-liconv'
[ $? != 0 ] && echo "make err" && exit
make install
[ $? != 0 ] && echo "make install err" && exit
cp php.ini-production /www/wdlinux/apache_php-${Ver}/etc/php.ini
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /www/wdlinux/apache_php-${Ver}/etc/php.ini
rm -f /www/wdlinux/apache_php
ln -sf /www/wdlinux/apache_php-${Ver} /www/wdlinux/apache_php
if [ ! -d /www/wdlinux/apache_php-${Ver}/lib/php/extensions ];then
mkdir -p /www/wdlinux/apache_php-${Ver}/lib/php/extensions/no-debug-zts-20131226
ln -sf /www/wdlinux/apache_php-${Ver}/lib/php/extensions/no-debug-zts-20131226 /www/wdlinux/apache_php-${Ver}/lib/php/extensions/no-debug-non-zts-20131226
fi
service httpd restart
echo
echo "如果升級(jí)后httpd無(wú)法啟動(dòng),打開(kāi)httpd.conf,注釋 #LoadModule php5_module modules/libphp5.so"
echo "php update compelete"
fi
if [ -d /www/wdlinux/nginx_php ];then
make clean
./configure --prefix=/www/wdlinux/nginx_php-${Ver} --with-config-file-path=/www/wdlinux/nginx_php-${Ver}/etc --with-mysql=/www/wdlinux/mysql --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-soap --with-imap --with-kerberos --with-imap-ssl --enable-ftp --enable-sockets --enable-zip --enable-fpm --with-mysqli=/www/wdlinux/mysql/bin/mysql_config --with-pdo-mysql=/www/wdlinux/mysql
[ $? != 0 ] && echo "configure err" && exit
make
[ $? != 0 ] && echo "make err" && exit
make install
[ $? != 0 ] && echo "make install err" && exit
cp php.ini-production /www/wdlinux/nginx_php-${Ver}/etc/php.ini
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /www/wdlinux/nginx_php-${Ver}/etc/php.ini
service php-fpm stop
rm -f /www/wdlinux/nginx_php
ln -sf /www/wdlinux/nginx_php-${Ver} /www/wdlinux/nginx_php
cp /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf.default /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf
sed -i 's/user = nobody/user = www/g' /www/wdlinux/nginx_php/etc/php-fpm.conf
sed -i 's/group = nobody/group = www/g' /www/wdlinux/nginx_php/etc/php-fpm.conf
sed -i 's/;pid =/pid =/g' /www/wdlinux/nginx_php/etc/php-fpm.conf
cp -f sapi/fpm/init.d.php-fpm /www/wdlinux/init.d/php-fpm
chmod 755 /www/wdlinux/init.d/php-fpm
if [ ! -d /www/wdlinux/nginx_php-${Ver}/lib/php/extensions ];then
mkdir -p /www/wdlinux/nginx_php-${Ver}/lib/php/extensions/no-debug-zts-20131226
ln -sf /www/wdlinux/nginx_php-${Ver}/lib/php/extensions/no-debug-zts-20131226 /www/wdlinux/nginx_php-${Ver}/lib/php/extensions/no-debug-non-zts-20131226
fi
service php-fpm start
echo
echo "php update is OK"
fi
echo
復(fù)制代碼
作者:
helen5106
時(shí)間:
2021-1-27 16:03
php安裝過(guò)程中, Lib可能出錯(cuò),參考https://blog.csdn.net/zsl10/article/details/52143713
作者:
besthome
時(shí)間:
2021-3-31 23:40
可能還是每個(gè)服務(wù)器有其獨(dú)特的情況吧,在wdcp下升級(jí)mysql,極少有順利的。
mysql升級(jí)后,pid有問(wèn)題,不想折騰,好在云服務(wù)器快照下,回滾了。
作者:
jotian
時(shí)間:
2021-6-25 19:01
我也是昨天折騰了一天,全報(bào)錯(cuò),我是想升級(jí)到5.7.3.4,可能就如上面說(shuō)的我沒(méi)有設(shè)置boost_1_66_0
歡迎光臨 WDlinux官方論壇 (http://cd-genova.com/bbs/)
Powered by Discuz! 7.2