Home >Database >Mysql Tutorial >linux下mysql数据库的备份与还原

linux下mysql数据库的备份与还原

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:34:241313browse

一、进入数据库的目录 /var/lib/mysql 二、备份数据库 mysqldump -u root -paaaaaa bugtracker /opt/bugtracker_bak.sql 其中root为用户名,aaaaaa为密码,bugtracker为要备份导出的数据库,/opt/bugtracker_bak.sql为数据库保存为的sql式文件 三、导入数据

一、进入数据库的目录

/var/lib/mysql

二、备份数据库

mysqldump -u root -paaaaaa bugtracker > /opt/bugtracker_bak.sql

其中root为用户名,aaaaaa为密码,bugtracker为要备份导出的数据库,/opt/bugtracker_bak.sql为数据库保存为的sql格式文件

三、导入数据库

mysql -uroot -paaaaaa  bugtracker

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