mysql 数据的备份和恢复
2010-05-25 17:02
513 查看
MySQL Tutorial - Import or Export A Database
This tutorial section deals with mysqldump which is a tool to import and export MySQL databases.
It can be used to back up a database or to move database information from one server to another.
1. Export A MySQL Database
This example shows you how to export a database. It is a good idea to export your data often as a backup.
# mysqldump -u username -ppassword database_name > FILE.sql
Replace username, password and database_name with your MySQL username, password and database name.
File FILE.sql now holds a backup of your database, download it to your computer.
2. Import A MySQL Database
Here, we import a database. Use this to restore data from a backup or to import from another MySQL server.
Start by uploading the FILE.sql file to the server where you will be running this command.
# mysql -u username -ppassword database_name < FILE.sql
Replace the parts in red with your own information.
This powerful, easy to use command has many uses. Let's say you wanted to switch web hosting providers.
Simply export your data on the old provider's server and import it on your account with the new host.
也可以进到mysql命令行用source filename.sql 来导入。
This tutorial section deals with mysqldump which is a tool to import and export MySQL databases.
It can be used to back up a database or to move database information from one server to another.
1. Export A MySQL Database
This example shows you how to export a database. It is a good idea to export your data often as a backup.
# mysqldump -u username -ppassword database_name > FILE.sql
Replace username, password and database_name with your MySQL username, password and database name.
File FILE.sql now holds a backup of your database, download it to your computer.
2. Import A MySQL Database
Here, we import a database. Use this to restore data from a backup or to import from another MySQL server.
Start by uploading the FILE.sql file to the server where you will be running this command.
# mysql -u username -ppassword database_name < FILE.sql
Replace the parts in red with your own information.
This powerful, easy to use command has many uses. Let's say you wanted to switch web hosting providers.
Simply export your data on the old provider's server and import it on your account with the new host.
也可以进到mysql命令行用source filename.sql 来导入。
相关文章推荐
- MySQL数据备份和恢复的方法大全
- MYSQL常用操作(二),MYSQL用户管理,数据备份恢复
- mysql数据备份和恢复
- 烂泥:通过binlog恢复mysql备份之前的数据
- mysql数据备份恢复详述
- 重装MySQL后如何恢复没有备份的早先数据
- Mysql 恢复纯数据文本备份的两种方式
- [数据库] Navicat for MySQL定时备份数据库及数据恢复
- Navicat for MySQL定时备份数据库及数据恢复
- mysql--覆盖原表,然后用备份的文件(.frm和.ibd)恢复原来的数据
- MySQL备份恢复数据的一般步骤
- MySQL学习笔记之十四 备份和恢复数据表的方法
- 结合mysqlbinlog与mysqldump进行MySQL数据备份与恢复(适用于较小的数据量)
- mysql数据的备份与恢复
- MySQL数据故障时备份与恢复
- mysql学习之数据备份和恢复
- mysql定期备份数据并压缩上传到ftp服务器的bat文件脚本,恢复建议使用SQLyog enterprise
- innobackupex 完整备份,增量备份,恢复 mysql 数据库
- MySQL 数据恢复 全备份恢复以及增量恢复 (以手残删库为例)
- java代码实现mysql数据备份与恢复