In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today Xiaobian to share with you how mysql only export table structure related knowledge points, detailed content, clear logic, I believe most people still know too much about this knowledge, so share this article for everyone to refer to, I hope you have some gains after reading this article, let's learn about it together.
Methods: 1. Using "mysqldump --opt -d database name-u root -p >... "statement export database table structure;2, using"mysqldump -uroot -p -B database name--table table name>... "Statement exports the structure of the specified table.
Operating environment of this tutorial: Windows 10 system, mysql version 8.0.22, Dell G3 computer.
How does mysql export table structure only?
mysql mysqldump exports only table structures, not data
1. Export structure Do not export data
The code is as follows:
mysqldump --opt -d database name-u root -p > xxx.sql
2. Export data without exporting structure
The code is as follows:
mysqldump -t database name-uroot -p > xxx.sql
3. Export data and table structures
The code is as follows:
database name-urot-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
Extended knowledge:
mysqldump is MySQL's logical backup tool.
Its backup principle is to connect to MySQL database through protocol, query the data that needs to be backed up, and convert the queried data into corresponding insert statements. When we need to restore these data, as long as these insert statements are executed, the corresponding data can be restored.
backup command
command format
mysqldump [options] database name [table name] > script name
or
mysqldump [options] --database name [options table name] > script name
or
mysqldump [options] --all-databases [options] > Script name above is "mysql how to export only table structure" All the contents of this article, thank you for reading! I believe everyone has a great harvest after reading this article. Xiaobian will update different knowledge for everyone every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.