Home  >  Article  >  Database  >  MySQL导出导入数据库_MySQL

MySQL导出导入数据库_MySQL

WBOY
WBOYOriginal
2016-06-01 13:51:44798browse

1、假设

假设有数据库gatesvote,数据库gatesvote中有表g_user

2、方案

1)导出整个数据库

mysqldump -u root -p gatesvote > gatesvote.sql

2)导出某个表

mysqldump -u root -p gatesvote g_user > gatesvote.g_user.sql

3)导入数据库

在MySQL中建立名为gatesvote的数据库,此时数据库是空的,没有数据表,没有数据

E:/>mysql -u root -p

mysql> use gatesvote;

mysql> source gatesvote.sql;

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