Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How can mysql mysqldump export only table structure or only data?

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "mysql mysqldump how to export only table structure or only export data". In daily operation, I believe many people have doubts about how mysql mysqldump can only export table structure or only export data. Xiaobian consulted all kinds of information and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for everyone to answer the question of "how to achieve mysql mysqldump to export only table structure or only export data". Next, please follow the editor to study!

Mysql mysqldump only exports table structure, not data server

The copy code is as follows:

Mysqldump-- opt-d database name-u root-p > xxx.sql

Backup database

The code is as follows:

# mysqldump database name > database backup name # mysqldump-A-u user name-p password database name > database backup name # mysqldump-d-A-- add-drop-table-uroot-p > xxx.sql

1. Export structure does not export data

The code is as follows:

Mysqldump-- opt-d database name-u root-p > xxx.sql

two。 Export data does not export structure

The code is as follows:

Mysqldump-t database name-uroot-p > xxx.sql

3. Export data and table structure

The code is as follows:

Mysqldump database name-uroot-p > xxx.sql

4. Export the structure of a specific table

The code is as follows:

Mysqldump-uroot-p-B database name-- table table name > xxx.sql

Import data:

Because mysqldump exports complete SQL statements, it is easy to import data with a mysql client:

The code is as follows:

# mysql database name

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report