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

The method of backing up data in MySQL Database

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

How to back up data in MySQL database? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

If you want to backup the database, you must first go to the bin directory under the installation directory of the MySQL server in the command line window and execute the backup command.

Backup command mysqldump format

Format: mysqldump-h hostname-P port-u user name-p password-database database name > file name. Sql

Back up the MySQL database in a format with deleted tables

The backup MySQL database is in the format with deleted tables, which allows the backup to overwrite the existing database without manually deleting the existing database.

Mysqldump-- add-drop-table-uusername-ppassword-database databasename > backupfile.sql

Compress backup of MySQL database directly

Mysqldump-hhostname-uusername-ppassword-database databasename | gzip > backupfile.sql.gz

Back up some table (s) in the MySQL database

Mysqldump-hhostname-uusername-ppassword databasename specific_table1 specific_table2 > backupfile.sql

Backup multiple MySQL databases at the same time

Mysqldump-hhostname-uusername-ppassword-databases databasename1 databasename2 databasename3 > multibackupfile.sql prepares only 6, backup-only database structure

Mysqldump-no-data-databases databasename1 databasename2 databasename3 > structurebackupfile.sql

Back up all databases on the server

Mysqldump-all-databases > allbackupfile.sql

Note: if you execute the backup command in the bin directory under the MySQL server installation directory, the backed up sql files will also be in the bin directory under the MySQL server installation directory.

Thank you for reading! After reading the above, do you have a general idea of how to back up data in the MySQL database? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow 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.

Share To

Database

Wechat

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

12
Report