shell脚本自动安装mysql-5.5.30

shell脚本自动安装mysql-5.5.30

ID:8806411

大小:30.00 KB

页数:4页

时间:2018-04-08

shell脚本自动安装mysql-5.5.30_第1页
shell脚本自动安装mysql-5.5.30_第2页
shell脚本自动安装mysql-5.5.30_第3页
shell脚本自动安装mysql-5.5.30_第4页
资源描述:

《shell脚本自动安装mysql-5.5.30》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、shell脚本自动安装mysql-5.5.30cmake编译#!/bin/bash##automaticconfiguremysqlfromsourcecodesincemysql5.5#editbyfrankhwang#e-mailMyDBA2006@gmail.com#version1.0#2013/03/25##checkoutlockfilewhetherornotexistlockfile=/tmp/$(basename$0)_lockfileif[-f$lockfile];thenpid=$(cat$lockfile)ps-p$pid

2、grep$pid&>/de

3、v/nullif[$?==0];thenecho"thescriptisalreadyrunning!!!"&&exit16elseecho$$>$lockfilefielseecho$$>$lockfilefiechoecho"***step1:checkwhethermysqlisalreadyinstalled?"echoforiinmysqlmysql-servermysql-testmysql-benchmysql-connector-javamysql-connector-odbcmysql-develdorpm-q$i&>/dev/nullif[$?==0];

4、thenrpm-e$i--nodeps&>/dev/nullecho$i"wasuninstalled"fidoneechoecho"***step2:installpackages"echoyumlist

5、grepmysql-server&>/dev/nullif[$?==0];thenecho"YUMinstallationsourcesareready..."elseecho"YUMinstallationsourcesarenotFOUND!!!"echo"pleasecheckit!!!"fiyum-yinstallgccgcc-c++flexbisonautoc

6、onfautomakecmakencurses-develcurl-develmakelynx&>/dev/nullechoecho"***step3:configureinstallationvariablesformysql"echoread-p"pleaseinputmysql_dir(/usr/local/mysql-VERSION):"mysql_dirif[-d$mysql_dir];thenecho$mysql_dirisexist,OK!elseecho$mysql_dirisnotexistread-p"makeit?(yes/NO):"answer[-z

7、$answer]&&answer=noif[$answer=="yes"-o$answer=="y"];thenmkdir$mysql_dir&&echo$mysql_dirisOK!elseexit11;fifiread-p"pleaseinputmysql_data_dir(/mysql/data):"mysql_data_dirif[-d$mysql_data_dir];thenecho$mysql_data_dirisexist,OK!elseecho$mysql_data_dirisnotexistread-p"makeit?(yes/NO):"answer[-z

8、$answer]&&answer=noif[$answer=="yes"-o$answer=="y"];thenmkdir$mysql_data_dir&&echo$mysql_data_dirisOK!elseexit12;fifiread-p"pleaseinputmysql_conf_dir(/mysql/conf):"mysql_conf_dirif[-d$mysql_conf_dir];thenecho$mysql_conf_dirisexist,OK!elseecho$mysql_conf_dirisnotexistread-p"makeit?(yes/NO):

9、"answer[-z$answer]&&answer=noif[$answer=="yes"-o$answer=="y"];thenmkdir$mysql_conf_dir&&echo$mysql_conf_dirisOK!elseexit13;fifiechoecho$mysql_direcho$mysql_data_direcho$mysql_conf_dirread-p"pleaseconfirmagain,thesevariablesarecorrectly?(yes/NO):"answer[-z$answ

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。