四虎影视在线影院在线观看,小s货再浪些再咬紧点h,国产精品水嫩水嫩,97精产国品一二三产区
標(biāo)題:
[教程]
升級到MYSQL8.0腳本
[打印本頁]
作者:
windsage
時間:
2019-3-9 16:25
標(biāo)題:
升級到MYSQL8.0腳本
#!/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.15"
else
MYS_VER=$1
fi
echo "升級有風(fēng)險 操作需謹(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-${MYS_VER}.tar.gz ];then
# 因mysql5.7需要boost,所以這個直接是包含boost的源碼包
wget -c https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-boost-${MYS_VER}.tar.gz -O mysql-${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ù)庫文件夾默認(rèn)要求是data
mkdir -p $IN_DIR/mysql-${MYS_VER}/data
fi
if [ ! -d mysql-${MYS_VER} ];then
tar zxvf mysql-${MYS_VER}.tar.gz
fi
cd mysql-${MYS_VER}
echo "START CONFIGURING MYSQL"
sleep 3
make clean
cmake \
-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_68_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
# 建立備份文件夾,這個可以自定義設(shè)置
if [ ! -d /mnt/mysql_bk ];then
mkdir -p /mnt/mysql_bk
cp -pR /www/wdlinux/mysql/var/* /mnt/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ù)庫復(fù)制回來,注意不要覆蓋performance_schema
# cp -pR /mnt/mysql_bk/* /www/wdlinux/mysql/data/
echo
echo "-------------------------------------------------------------"
echo "數(shù)據(jù)庫需要初始化,自動生成的密碼會存入mysql的日志,默認(rèn)在/var/log/mysql/error.log"
echo
echo "此時查看mysql日志,應(yīng)該一切正常了,但新手朋友注意了,此時你的httpd無法啟動了,需要編譯安裝php。"
echo
復(fù)制代碼
有不足的地方歡迎指出
作者:
admin
時間:
2019-3-10 10:53
數(shù)據(jù)文件,最好不要直接復(fù)制,版本差距大時,應(yīng)該會有問題
可以使用mysqldump導(dǎo)出再導(dǎo)入
作者:
windsage
時間:
2019-4-25 10:02
#!/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.15"
else
MYS_VER=$1
fi
echo "升級有風(fēng)險 操作需謹(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,所以這個直接是包含boost的源碼包
wget -c https://cdn.mysql.com//Downloads/MySQL-8.0/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ù)庫文件夾默認(rèn)要求是data
mkdir -p $IN_DIR/mysql-${MYS_VER}/data
fi
if [ ! -d mysql-${MYS_VER} ];then
tar zxvf mysql-${MYS_VER}.tar.gz
fi
cd mysql-${MYS_VER}
echo "START CONFIGURING MYSQL"
sleep 3
mkdir -p build
cd build/
make clean
cmake. \
-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_68_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
復(fù)制代碼
service mysqld stop
# 建立備份文件夾,這個可以自定義設(shè)置
if [ ! -d /mnt/mysql_bk ];then
mkdir -p /mnt/mysql_bk
cp -pR /www/wdlinux/mysql/var/* /mnt/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ù)庫復(fù)制回來,注意不要覆蓋performance_schema
# cp -pR /mnt/mysql_bk/* /www/wdlinux/mysql/data/
echo
echo "-------------------------------------------------------------"
echo "數(shù)據(jù)庫需要初始化,自動生成的密碼會存入mysql的日志,默認(rèn)在/var/log/mysql/error.log"
echo
echo "此時查看mysql日志,應(yīng)該一切正常了,但新手朋友注意了,此時你的httpd無法啟動了,需要編譯安裝php。"
echo
復(fù)制代碼
修改了一下 解決In-source builds are not allowed
作者:
冬至雨
時間:
2019-5-18 12:03
這個腳本對菜鳥來說,是比較困難的
作者:
24447678@qq.com
時間:
2019-5-24 17:38
START CONFIGURING MYSQL
make: *** 沒有規(guī)則可以創(chuàng)建目標(biāo)“clean”。 停止。
報錯了啊
作者:
andylau918
時間:
2019-7-10 13:44
有站長能成功更新嗎?謝謝
作者:
yixianbin
時間:
2019-8-9 15:36
沒有 我準(zhǔn)備試試
歡迎光臨 WDlinux官方論壇 (http://cd-genova.com/bbs/)
Powered by Discuz! 7.2