linux发布常用命令

一、linux发布常用命令

//启动Tomcat
sh /opt/apache-tomcat-8.5.29/bin/startup.sh
//停止tomcat
sh /opt/apache-tomcat-8.5.29/bin/shutdown.sh

//查看实时日志
tail -f /opt/apache-tomcat-8.5.29/logs/catalina.out


//备份数据库 prodData:数据库名称,prodData_20190201:压缩包名称
mysqldump -h127.0.0.1 -uroot -pabc=123 prodData | gzip > /opt/project/prodData_20190201.sql.gz
//导入数据库数据
gunzip < /opt/project/leasing001_20190222.sql.gz | mysql -uroot -p123=abc leasing001


//删除相应文件
rm -rf /opt/project/leasing /opt/project/fileUpload.zip /opt/project/prodData_20190215.sql.gz
//解压代码
unzip -d /opt/project /opt/project/leasing.zip
//删除代码压缩包
rm -rf /opt/project/leasing.zip


//链接数据库
mysql -h127.0.0.1 -uroot -pabc=123
//还原数据库
mysql -uroot -p123=abc, drop database leasing001; create database leasing001 DEFAULT CHARACTER SET utf8 ;  exit;

 

posted @ 2019-09-03 10:33  生活这把杀猪刀  阅读(515)  评论(0编辑  收藏  举报