Home  >  Article  >  Database  >  MySQL通过命令导出数据表

MySQL通过命令导出数据表

WBOY
WBOYOriginal
2016-06-07 15:17:461277browse

1. 导出整张数据表 命令行进入安装目录/Bin/mysqldump -u用户名 -p密码 -hIP地址或localhost 数据库名 表名 C:\table1.txt 回车 2. 根据条件导出表中的数据 命令行进入安装目录/Bin/mysqldump -u用户名 -p密码 -hIP地址或localhost 数据库名 表 名 --where=

1. 导出整张数据表

命令行进入安装目录/Bin/mysqldump -u用户名 -p密码 -hIP地址或localhost 数据库名 表名 > C:\table1.txt 回车

2. 根据条件导出表中的数据

命令行进入安装目录/Bin/mysqldump -u用户名 -p密码 -hIP地址或localhost 数据库名 表 --where="条件" > C:\table2.txt 回车

例如:

命令行进入安装目录/Bin/mysqldump -u用户名 -p密码 -hIP地址或localhost 数据库名 表 --where="id>100 and userName like 'Lee%' order by id limit 100" > C:\demo2.txt 回车

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