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

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

WBOY
Release: 2016-06-07 15:34:24
Original
1288 people have browsed it

一、进入数据库的目录 /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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template