Home >Database >Mysql Tutorial >linux+tomcat+mysql相关命令_MySQL

linux+tomcat+mysql相关命令_MySQL

WBOY
WBOYOriginal
2016-06-01 11:52:211445browse

备份数据库:

mysqldump -u root -p 数据库名>sql文件所在的路径(例:/soft/bak/mysqlbak/xx201508242248.sql)

备份项目:

即:将tomcat的root文件夹下的所有文件备份到新文件夹中

cp 空格-rf空格 源文件夹 空格 目标文件夹

例:cp -rf soft/apache-tomcat-7.0.59/webapps/ROOT/ soft/bak/xxbak/bak_201508242248

将sql文件导入到mysql数据库:

1、mysql -u root -p

2、mysql>use 数据库名称;

3、mysql>source sql文件的路径全名

导入成功后用此命令查看表:mysql>describe 表名;

查看mysql字符集:show variables like 'character%';

退出mysql:mysql>quit;

新建文件夹:mkdir -p 文件夹名称

进入一级:cd /xx/xx

退出一级:cd ../

退出两级:cd ../..

查看目录中文件:ls

查看tomcat控制台打印日志:

1、cd /soft/apache-tomcat-7.0.59/logs回车

2、tail -f catalina.logs


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn